Skip to content

AIMIGRAPHX-824 Set basic graph optimization for ONNX sessions in accuracy_checker.py#4694

Merged
causten merged 5 commits intodevelopfrom
kqian1/CI_accuracy_test_ort_fix
Mar 25, 2026
Merged

AIMIGRAPHX-824 Set basic graph optimization for ONNX sessions in accuracy_checker.py#4694
causten merged 5 commits intodevelopfrom
kqian1/CI_accuracy_test_ort_fix

Conversation

@kentqian
Copy link
Contributor

Motivation

These files cannot be executed correctly during CI

image
  • bert_base_cased_1_fp16_gpu.onnx
  • bert_large_uncased_1_fp16_gpu.onnx
  • distilgpt2_1_fp16_gpu.onnx

Here is Error output:

Traceback (most recent call last):
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 359, in
main()
File "/src/AMDMIGraphX/tools/accuracy/accuracy_checker.py", line 278, in main
sess = ort.InferenceSession(model_name,
File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 485, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/usr/local/lib/python3.10/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 584, in _create_inference_session
sess.initialize_session(providers, provider_options, disabled_optimizers)
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/graph/graph_utils.cc:29 int onnxruntime::graph_utils::GetIndexFromName(const onnxruntime::Node&, const std::string&, bool) itr != node_args.end() was false. Attempting to get index by a name which does not exist:InsertedPrecisionFreeCast_onnx::Pow_1551for node: Mul_33/SimplifiedLayerNormFusion/

Technical Details

This defect is related to the level of graph optimization when the level setting is as default or ORT_ENABLE_ALL, since SimplifiedLayerNormFusion will be triggered by ORT_ENABLE_ALL setting. This is a workaround as replacing ORT_ENABLE_ALL
to ORT_ENABLE_BASIC. The latest ORT(1.23.2) via pip is impacted.
One issue thread on Microsoft’s OnnxRT public repro had been created for this similar issue. #26717 Microsoft's OnnxRT

@kentqian kentqian self-assigned this Mar 23, 2026
@kentqian kentqian requested a review from causten as a code owner March 23, 2026 03:38
@kentqian kentqian added the Continous Integration Pull request updates parts of continous integration pipeline label Mar 23, 2026
Copilot AI review requested due to automatic review settings March 23, 2026 03:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ONNXRuntime session configuration used by tools/accuracy/accuracy_checker.py to avoid a known ONNXRuntime crash triggered by higher graph optimization levels (e.g., ORT_ENABLE_ALL) on certain transformer ONNX models during CI.

Changes:

  • Set onnxruntime.SessionOptions.graph_optimization_level to ORT_ENABLE_BASIC for ONNX sessions created by the accuracy checker.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@causten causten merged commit 9ba5c4f into develop Mar 25, 2026
35 of 38 checks passed
@causten causten deleted the kqian1/CI_accuracy_test_ort_fix branch March 25, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Continous Integration Pull request updates parts of continous integration pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants