Skip to content

[BUG] For model larger than 2GB: model with IR version >= 3 must specify opset_import for ONNX #357

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

Open
tp-nan opened this issue Apr 18, 2025 · 0 comments

Comments

@tp-nan
Copy link

tp-nan commented Apr 18, 2025

Describe the bug
the model is llama2-7b (with MHA replaced by a simple local function like lambda q, k, v: return q). When the number of layers is set to 2, onnxsim works well. When number of layers is set to 32:

Simplifying...
Traceback (most recent call last):
  File "/usr/local/bin/onnxsim", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/onnxsim/onnx_simplifier.py", line 489, in main
    model_opt, check_ok = simplify(
                          ^^^^^^^^^
  File "/usr/local/lib/python3.12/dist-packages/onnxsim/onnx_simplifier.py", line 199, in simplify
    model_opt_bytes = C.simplify(
                      ^^^^^^^^^^^
RuntimeError: model with IR version >= 3 must specify opset_import for ONNX

onnxsim.version
0.4.36

torch.version
'2.7.0a0+7c8ec84dab.nv25.03'
onnxruntime.version
'1.18.0'

@tp-nan tp-nan changed the title [BUG] model with IR version >= 3 must specify opset_import for ONNX for model larger than 2GB [BUG] model with IR version >= 3 must specify opset_import for ONNX for model larger than 2GB Apr 18, 2025
@tp-nan tp-nan changed the title [BUG] model with IR version >= 3 must specify opset_import for ONNX for model larger than 2GB [BUG] For model larger than 2GB: model with IR version >= 3 must specify opset_import for ONNX Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant