-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CoreMLGPT2 crashing on iPhone X #3
Comments
iPhone X "only" has 3 GB RAM and the OS pretty aggressively kills your app if it goes above 1.7 GB used memory. Your best bet is to run the model on either an iPhone XS (4 GB RAM) or an iPad Pro (up to 6 GB RAM). |
Makes sense. Thanks! Wondering if we can train a lightweight or dumber version of the GPT2 model that can run on older devices like the X. |
Yes – quantization could work here, see #1. It's also built in to CoreML so it shouldn't be too hard to try. https://developer.apple.com/documentation/coreml/reducing_the_size_of_your_core_ml_app |
Thanks @julien-c. I attempted to quantize this to half precision as suggested by the Apple docs. Getting this error which might or might not be related to the model itself -
Refer to this Colab notebook to try it out - https://colab.research.google.com/drive/1QC90lE-LUDEUXMUGer-5HHLLFRG6dF7F |
Hmm, I think your version of coremltools is way too old :) Also related to this issue I believe that @LysandreJik converted a smaller version of |
You are right. But I only managed to get a different error with the latest version of coremltools - 3.0b4
Is the smaller model available in the Resources folder of this project? I will check them out. |
Message from debugger: Terminated due to memory issue
Is the GPT2-512 model working better on newer devices?
The text was updated successfully, but these errors were encountered: