-
Notifications
You must be signed in to change notification settings - Fork 104
Description
Pass “split_init“ produces invalid model (missing value_info.type)
Issue
Running the single pass split_init with onnxoptimizer 0.3.19 makes the optimized model fail ONNX validation: ValidationError("Field 'type' of 'value_info' is required but missing."). The optimizer falls back to the original model. Differential testing shows outputs remain identical, indicating the failure is structural (missing type info) rather than numerical drift.
Environment
- Ubuntu 20.04
- Python 3.10
- onnx==1.19.0
- onnxruntime==1.23.2
- onnxoptimizer==0.3.19 (latest)
Repro steps (run from this folder)
- Download and unzip the attached archive, then
cdinto the extracted directory
tar -xzvf split_init_repro.tar.gz
cd split_init_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
- Optimize the case with only
split_init:
python optimize_model.py --case ./case_00114_seed21153785- Warning observed during optimize:
optimized model failed validation (ValidationError("Field 'type' of 'value_info' is required but missing.")); falling back to original model - The optimized model is invalid due to missing
value_info.type.
- Warning observed during optimize:
- Differential test original vs optimized outputs using stored oracle inputs:
python diff_test.py --case ./case_00114_seed21153785
Observed results
python optimize_model.py --case case_00114_seed21153785prints:Warning: optimized model failed validation (ValidationError("Field 'type' of 'value_info' is required but missing.")); falling back to original model- Differential test:
- Case: case_00114_seed21153785
- Each output node is identical (max_abs=0, max_rel=0)
Expected
split_init should produce a valid, checkable model. The pass currently emits a graph missing value_info.type, causing onnx.checker to fail even though numerical outputs match the original. Please investigate how the pass handles value_info when splitting the graph.
Differential Test Output Details
Case: case_00114_seed21153785
All outputs are identical (max_abs=0, max_rel=0)
Attachments
README.md(this document)requirements.txt(dependency versions)optimize_model.py(runs onlysplit_initand savesmodel.opt.onnx)diff_test.py(runs original vs optimized with oracle inputs; prints equality when all outputs match)case_00114_seed21153785/(containsmodel.onnxandoracle.pklused for both runs)