microsoft / microsoft/onnxruntime

Optimizing mbart model: ValueError: Message onnx.ModelProto exceeds maximum protobuf size of 2GB: 3468757994

Open
#8,527 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

Describe the bug
python -m onnxruntime.transformers.optimizer --input "/home/sysadmin/downlaod/onnx_models/nmbart/model.onnx" --output ${export_model_path} --num_heads 16 --hidden_size 1024 --float16 --input 32 --use_gpu --opt_level 99 --use_external_data_format

I am trying to optimizing the Mbart model with the above commond, But this error occurs
Urgency
If there are particular important use cases blocked by this or strict project-related timelines, please share more information and dates. If there are no hard deadlines, please specify none.

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • ONNX Runtime installed from (source or binary):
  • ONNX Runtime version:
  • Python version:
  • Visual Studio version (if applicable):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:

To Reproduce

  • Describe steps/code to reproduce the behavior.
  • Attach the ONNX model to the issue (where applicable) to expedite investigation.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here. If the issue is about a particular model, please share the model details as well to facilitate debugging.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported python -m onnxruntime.transformers.optimizer command and its --use_external_data_format option, then reproduce the failure using the referenced mBART ONNX model. Review the optimizer's handling of models exceeding the protobuf size limit; done means the cause and supported behavior are established with a reproducible result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.