onnx / onnx/optimizer

Optimizer reports "Unresolved value references" since v0.3.0

Open
#104 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
834
Forks
109
Avg merge
6h 55m
Merged PRs (30d)
2

Description

Via onnxcli https://github.com/zhenhuaw-me/onnxcli/issues/28

The model: https://github.com/zhenhuaw-me/onnxcli/blob/v0.2.0/assets/tests/conv.float32.onnx

Last pass version: v0.2.7

Log

2022-11-13 12:15:29,988 D [testing][test_dispatcher.py:34] Running optimize ./assets/tests/conv.float32.onnx optimized.onnx
2022-11-13 12:15:29,988 D [onnxcli][dispatcher.py:25] Running ['optimize', './assets/tests/conv.float32.onnx', 'optimized.onnx']
2022-11-13 12:15:29,994 I [onnxcli][optimize.py:27] Running <Optimization> on model ./assets/tests/conv.float32.onnx
2022-11-13 12:15:30,483 W [onnxcli][optimize.py:38] No optimization passes specified, running all available passes: ['rename_input_output', 'set_unique_name_for_nodes', 'nop', 'eliminate_nop_cast', 'eliminate_nop_dropout', 'eliminate_nop_flatten', 'extract_constant_to_initializer', 'eliminate_if_with_const_cond', 'eliminate_nop_monotone_argmax', 'eliminate_nop_pad', 'eliminate_nop_expand', 'eliminate_shape_gather', 'eliminate_slice_after_shape', 'eliminate_nop_transpose', 'fuse_add_bias_into_conv', 'fuse_bn_into_conv', 'fuse_consecutive_concats', 'fuse_consecutive_log_softmax', 'fuse_consecutive_reduce_unsqueeze', 'fuse_consecutive_squeezes', 'fuse_consecutive_transposes', 'fuse_matmul_add_bias_into_gemm', 'fuse_pad_into_conv', 'fuse_pad_into_pool', 'fuse_transpose_into_gemm', 'replace_einsum_with_matmul', 'lift_lexical_references', 'split_init', 'split_predict', 'fuse_concat_into_reshape', 'eliminate_nop_reshape', 'eliminate_deadend', 'eliminate_identity', 'eliminate_shape_op', 'eliminate_unused_initializer', 'eliminate_duplicate_initializer']
Traceback (most recent call last):
  File "/Users/zhenhuaw/workspace/ONNX/onnxcli/tests/test_dispatcher.py", line 55, in <module>
    test_dispatch_core()
  File "/Users/zhenhuaw/workspace/ONNX/onnxcli/tests/test_dispatcher.py", line 36, in test_dispatch_core
    dispatch_core(shlex.split(cmd))
  File "/Users/zhenhuaw/workspace/ONNX/onnxcli/onnxcli/dispatcher.py", line 40, in dispatch_core
    args.func(args)
  File "/Users/zhenhuaw/workspace/ONNX/onnxcli/onnxcli/optimize.py", line 44, in run
    optimized = onnxoptimizer.optimize(model, passes)
  File "/Users/zhenhuaw/workspace/toolchain/runtime.git/python/venv/onnx/lib/python3.10/site-packages/onnxoptimizer/__init__.py", line 50, in optimize
    optimized_model_str = C.optimize(model_str, passes)
RuntimeError: Unresolved value references: Conv2D_bias,Variable/read,

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the failure with assets/tests/conv.float32.onnx from onnxcli v0.2.0 and follow the test_dispatcher.py path into onnxcli/dispatcher.py and onnxcli/optimize.py. Compare behavior with v0.2.7 and v0.3.0; done means optimization completes without unresolved value references for this model and the dispatcher test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.