-
Notifications
You must be signed in to change notification settings - Fork 514
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
Failed to export Llama with past-key-values to ONNX #2204
Comments
Hi there 👋 This was fixed in #2191, so could you install optimum from source with
? cc @echarlaix I think we should put out a new release for this because I also ran into this error in google colab (link). |
Hello @xenova, thanks for you respond, but it is not working also with me, the model is exported but it can not verify the exported model the following warning was generated
Is that normal ? |
What are the differences in values? Anything around 1e-4 should be fine. |
myenv/lib/python3.11/site-packages/transformers/models/llama/modeling_llama.py:731: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!
|
System Info
google colab python 3.11 optimum version -> Collecting optimum Downloading optimum-1.24.0-py3-none-any.whl.metadata (21 kB)
Who can help?
Hello @michaelbenayoun ,
hope you are doing well,
Trying to export llama model with past key values to onnx failed while using google colab, would you please help with that ?
the exported model can not be verified successfully
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction (minimal, reproducible, runnable)
Steps to reproduce:
! pip install optimum
! pip install onnx
! optimum-cli export onnx -m meta-llama/Llama-3.2-1B --task text-generation-with-past llama321b
Expected behavior
exported and verified onnx model
Exception: An error occured during validation, but the model was saved nonetheless at llama321b-optimun. Detailed error: Required inputs (['onnx::Gather_35']) are missing from input feed (['input_ids', 'attention_mask', 'position_ids', 'past_key_values.0.key', 'past_key_values.0.value', 'past_key_values.1.key', 'past_key_values.1.value', 'past_key_values.2.key', 'past_key_values.2.value', 'past_key_values.3.key', 'past_key_values.3.value', 'past_key_values.4.key', 'past_key_values.4.value', 'past_key_values.5.key', 'past_key_values.5.value', 'past_key_values.6.key', 'past_key_values.6.value', 'past_key_values.7.key', 'past_key_values.7.value', 'past_key_values.8.key', 'past_key_values.8.value', 'past_key_values.9.key', 'past_key_values.9.value', 'past_key_values.10.key', 'past_key_values.10.value', 'past_key_values.11.key', 'past_key_values.11.value', 'past_key_values.12.key', 'past_key_values.12.value', 'past_key_values.13.key', 'past_key_values.13.value', 'past_key_values.14.key', 'past_key_values.14.value', 'past_key_values.15.key', 'past_key_values.15.value'])..
The text was updated successfully, but these errors were encountered: