Skip to content
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

memory issue during export_llama? #3480

Closed
antmikinka opened this issue May 2, 2024 · 5 comments
Closed

memory issue during export_llama? #3480

antmikinka opened this issue May 2, 2024 · 5 comments
Labels
module: coreml Issues related to Apple's Core ML delegation

Comments

@antmikinka
Copy link

I was following through on the llama pages for this repo.
I do have a 8GB macbook, so I do not know if this is the issue.
My ram did not skyrocket and it never said "ran out of ram". So, I don't think its a ram issue.

script to reproduce:

python -m examples.models.llama2.export_llama -kv --coreml -c stories110M.pt -p params.json

yes I ran and built coreml frameworks and dependencies
on 2.0 rc5

Running MIL default pipeline: 100%|██████████████████████████████████████████████| 78/78 [00:07<00:00, 10.37 passes/s]
Running MIL backend_mlprogram pipeline: 100%|████████████████████████████████████| 12/12 [00:00<00:00, 54.97 passes/s]
/opt/anaconda3/envs/executorch/lib/python3.10/site-packages/executorch/exir/emit/_emitter.py:1316: UserWarning: Mutation on a buffer in the model is detected. ExecuTorch assumes buffers that are mutated in the graph have a meaningless initial state, only the shape and dtype will be serialized.
  warnings.warn(
INFO:root:Required memory for activation in bytes: [0, 19002368]
INFO:root:Saved exported program to ./coreml_llama2.pte

@cccclai cccclai added the module: coreml Issues related to Apple's Core ML delegation label May 2, 2024
@cccclai
Copy link
Contributor

cccclai commented May 2, 2024

The log seems expected - is there any log that looks confusing?

@antmikinka
Copy link
Author

@cccclai The only thing that was confusing was it stating the "Required memory for activation in bytes: [0, 19002368]"
I wasn't sure if the ./coreml_llama2.pte file was complete or not.

@cccclai
Copy link
Contributor

cccclai commented May 2, 2024

Oh that was completed - "Required memory for activation in bytes: [0, 19002368]" means that, in addition to the model's weight, we need 19002368 extra memory for the activation when we run the model on device.

@DawerG
Copy link

DawerG commented May 2, 2024

@antmikinka Is the issue resolved? If not, can you please summarize what else is needed? Thanks.

@larryliu0820
Copy link
Contributor

I think @antmikinka was able to finish exporting, if not please file another issue. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: coreml Issues related to Apple's Core ML delegation
Projects
None yet
Development

No branches or pull requests

4 participants