-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Describe the issue
lift_lexical_references pass fails and produces invalid model — unresolved value references and missing tensor elem_type
Describe the bug
Hi ONNX Runtime maintainers, thanks for the project!
When optimizing a valid ONNX model named model.onnx using only the lift_lexical_references pass, the pass crashes with unresolved value references and the optimized model becomes invalid.
Environment
OS: Ubuntu 20.04 LTS
Python: 3.10.18
onnx: 1.19.0
onnxruntime: 1.23.2
onnxoptimizer: 0.3.19 (latest)
Attachments:
left_lexical_references_repro.tar.gz
README.md(Details to reproduce this bug)requirements.txt(dependency versions)optimize_model.py(runslift_lexical_referencesand savesmodel.opt.onnx,althrough the passlift_lexical_referencesFAILED to generate an optimized model)- the minimal failing folder
./case_00057_seed20702402containingmodel.onnx,oracle.pkl(input data of onnx model).
Thanks for your help!
Urgency
This issue is urgent for me because I’m running differential testing on the ONNX Optimizer, and the failing lift_lexical_references pass blocks my workflow.
And I’m eager to help and contribute fixes back to the community. Please let me know how I can assist with debugging or validating a patch. Thank you!
Target platform
Linux
Build script
To Reproduce
left_lexical_references_repro.tar.gz
- Download and unzip the attached archive, then
cdinto the extracted directory
tar -xzvf lift_lexical_references_repro.tar.gz
cd lift_lexical_references_repro
- Create a Python environment (Python 3.10) and install dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt
- Run the
lift_lexical_references passon the case model and save
python optimize_model.py --case ./case_00057_seed20702402
Expected: model.opt.onnx is written.
Actual: the pass fails with unresolved value references and no model.opt.onnx is produced.
Error / output
Expected behavior
- There should be an optimized model which is named as
model.opt.onnxand should remain a valid ONNX model afterlift_lexical_referencesoptimization. - ONNX Runtime should be able to create an InferenceSession for
model.opt.onnx.
Actual behavior
Optimizer fails with:
RuntimeError: Unresolved value references: m3.bias,m3.weight,m5.bias,m5.weight,m6.bias,m6.running_mean,m6.running_var,m6.weight,m8.bias,m8.running_mean,m8.running_var,m8.weight,v17_0,v24_0,
Visual Studio Version
No response
GCC / Compiler Version
No response