-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[FIX] symbolic shape infer error with onnx-1.11.0 #10674
[FIX] symbolic shape infer error with onnx-1.11.0 #10674
Conversation
Can you re-enable tests for symbolic shape infer that were disabled by https://github.com/microsoft/onnxruntime/pull/10441/files#diff-95f6d8002a2b02785895316d5a8268de674a67e7ed3fc0bae0e7274a762a144b |
@baijumeswani That reminds me of the issue you were seeing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this fix. Please remove this line in the test to enable the test:
onnxruntime/onnxruntime/test/python/onnxruntime_test_python_symbolic_shape_infer.py
Line 30 in a9d9c6b
test_skip_due_to_onnx_1_11_shape_inference_change = ["GPT2", "GPT2_LM_HEAD", "test_GPT2"] |
653b927
to
3678858
Compare
I enable tests which were disabled and pass the unit test. |
* [FIX] symbolic shape infer error with onnx-1.11.0 * [FIX] consider inputs name contains 'unk__' * [TEST] enable gpt2 test * [FIX] gpt2_megatron_opt.onnx graph
* [FIX] symbolic shape infer error with onnx-1.11.0 * [FIX] consider inputs name contains 'unk__' * [TEST] enable gpt2 test * [FIX] gpt2_megatron_opt.onnx graph
When the input shape of the op is uncertain, the inferred output shape is uncertain.
Before onnx1.11.0, the uncertain shape dim is represented by None. In onnx 1.11.0, the uncertain shape is represented by "unk__#index". The method of verifying whether the output shape is certained invalid.
For example, a Where op has three inputs[1,1,min(1024,dim0), min(1024,dim1)],[1,12,dim0,dim1],[], the infered output has shape [1,12,None,None] in onnx1.10 but has shape[1,12,"unk__0",'unk__1'] in onnx1.11.
It's caused by https://github.com/onnx/onnx/blob/main/onnx/shape_inference/implementation.cc#L437, the symbolic shape generated before it's assign to output.
Fixes #10761