-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ORT fails with axes_tensor != nullptr was false
#18338
Comments
This is what I am seeing when trying to load the model with the latest ORT
|
Correction, this was my branch with |
it looks ok (float)? |
I debugged it and it is onnx.checker that fails while checking this attribute. The So the int field is present, but the type is float, so that causes a mismatch. |
This takes place before any optimizations, when the model proto get's loaded. |
This comment was marked as outdated.
This comment was marked as outdated.
I searched the text in model proto. Strange that it doesn't look like the |
Comparing float values `1.0` and `2.0` can be fragile. Should we do it? Related: microsoft/onnxruntime#18338
It is not in the text. I fed it to the parser: Name: onnx-weekly def save_as_model(model_script_file):
file = open(model_script_file, 'r')
script = file.read()
file.close()
model_proto = onnx.parser.parse_model(script)
pre, ext = os.path.splitext(model_script_file)
model_file_name = pre + '.onnx';
onnx.save_model(model_proto, model_file_name) And it produced the invalid model. Looks like the same with the latest onnx-weekly. |
Same with tip of the main. I called the parser directly from C++, same result. |
Discussed in Teams with @yuslepukhin. The model can be obtained with the code under the "To Reproduce" section. I create an issue in ONNX on the parser bug. |
### Description Our function inliner converts call nodes to a proto. `Node::ToProto()` function recreates optional NodeArgs into a `NodeProto`. While handling missing input parameters, our inliner simply renames them as empty strings. `Graph::InlineFunctionProto()` recreates missing NodeArgs even though the original call node did not have them. This results in the below mentioned issue. The inlined model has the following entries, notice the second argument is present, but has no value in `ReduceSum` call (from a Dynamo exported model). > InsertedPrecisionFreeCast__inlfunc__aten_linalg_vector_norm_no_dim_onnx_result_12 = ReduceSum <keepdims: int = 0, noop_with_empty_axes: int = 0> (InsertedPrecisionFreeCast__inlfunc_ReduceL1_data_abs, ) We now allow second input to ReduceSum to be nullptr and ignore it as it is optional. ### Motivation and Context This seeks to address #18338
This issue has been automatically marked as stale due to inactivity and will be closed in 7 days if no further activity occurs. If further support is needed, please provide an update and/or more details. |
…osoft#18423) ### Description Our function inliner converts call nodes to a proto. `Node::ToProto()` function recreates optional NodeArgs into a `NodeProto`. While handling missing input parameters, our inliner simply renames them as empty strings. `Graph::InlineFunctionProto()` recreates missing NodeArgs even though the original call node did not have them. This results in the below mentioned issue. The inlined model has the following entries, notice the second argument is present, but has no value in `ReduceSum` call (from a Dynamo exported model). > InsertedPrecisionFreeCast__inlfunc__aten_linalg_vector_norm_no_dim_onnx_result_12 = ReduceSum <keepdims: int = 0, noop_with_empty_axes: int = 0> (InsertedPrecisionFreeCast__inlfunc_ReduceL1_data_abs, ) We now allow second input to ReduceSum to be nullptr and ignore it as it is optional. ### Motivation and Context This seeks to address microsoft#18338
Summary
ORT fails with error
axes_tensor != nullptr was false
for the following model even though axis is not empty.Reproduction report
Summary
ONNX Runtime raises
[ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running If node. Name:'_inline__aten_linalg_vector_norm_no_dim_onnxn10' Status Message: Non-zero status code returned while running If node. Name:'_inline__aten_linalg_vector_norm_no_dim_onnxn1' Status Message: Non-zero status code returned while running If node. Name:'_inline__aten_linalg_vector_norm_no_dim_onnxn3' Status Message: Non-zero status code returned while running If node. Name:'_inline__aten_linalg_vector_norm_no_dim_onnxn3' Status Message: Non-zero status code returned while running If node. Name:'_inline__aten_linalg_vector_norm_no_dim_onnxn3' Status Message: Non-zero status code returned while running ReduceSum node. Name:'' Status Message: /onnxruntime_src/onnxruntime/core/providers/cpu/reduction/reduction_ops.cc:692 void onnxruntime::ValidateCommonFastReduce(const onnxruntime::Tensor*) axes_tensor != nullptr was false. Axes input is null
when executing testops_test.TestOutputConsistencyFullGraphCPU.test_output_match_opinfo__linalg_vector_norm_cpu_float16
in ONNX ScriptTorchLib
.To recreate this report, use
ONNX Script function
To reproduce
Full error stack
The ONNX model text for visualization
Environment
cc @BowenBao @gramalingam @thiagocrepaldi
The text was updated successfully, but these errors were encountered: