-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Model optimization fails with Protobuf serialization failed error #20371
Comments
Could you provide the stack trace for protobuf serialization error? |
Traceback (most recent call last): |
Hello, give the following commands a try:
You can also try the convert_to_onnx tool for Llama, which will convert & optimize in the same script. Thanks @kunal-vaishnavi for the suggestions :) |
Thanks @carzh and @kunal-vaishnavi for the suggestion. This command works for codellama. I tried to optimize Qwen/Qwen1.5-7B-Chat onnx model with the same optimizer.py script but getting "Segmentation fault". Can you please help me on this? |
Can you clone ORT from the main branch and try again? I can run the ORT transformer optimizer successfully with the following steps.
|
You can also run |
Describe the issue
Exported a Codellama (codellama/CodeLlama-7b-hf) model.
I tried to optimize the float model using the ORT optimizer (https://github.com/microsoft/onnxruntime/blob/v1.17.0/onnxruntime/python/tools/transformers/optimizer.py) with the below command
python optimizer.py --input <input_model> --output <out_dir> --use_external_data_format
Getting the below error
onnxruntime.capi.onnxruntime_pybind11_state.InvalidProtobuf: [ONNXRuntimeError] : 7 : INVALID_PROTOBUF : Protobuf serialization failed.
To reproduce
Export the codellama/CodeLlama-7b-hf ONNX model
optimum-cli export onnx --model codellama/CodeLlama-7b-hf codellama --no-post-process
Clone the onnxruntime repo (https://github.com/microsoft/onnxruntime/tree/v1.17.0)
cd onnxruntime/python/tools/transformers
Execute the python command
python optimizer.py --input <input_model> --output <out_dir> --use_external_data_format
Urgency
Basic funtionality is not working resulting in project delay
Platform
Linux
OS Version
CENTOS 7.4
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.17.0
ONNX Runtime API
Python
Architecture
X86
Execution Provider
Default CPU
Execution Provider Library Version
No response
The text was updated successfully, but these errors were encountered: