Skip to content

[BUG] Pass “split_init“ produces invalid model (missing value_info.type) #256

@C1ri007

Description

@C1ri007

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)

  1. Download and unzip the attached archive, then cd into the extracted directory

split_init_repro.tar.gz

tar -xzvf split_init_repro.tar.gz
cd split_init_repro
  1. 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
  1. 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.
  1. 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_seed21153785 prints: 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 only split_init and saves model.opt.onnx)
  • diff_test.py (runs original vs optimized with oracle inputs; prints equality when all outputs match)
  • case_00114_seed21153785/ (contains model.onnx and oracle.pkl used for both runs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions