Skip to content

[CANN] Fix test errors during onnxruntime-cann build and compilation - #27091

Merged
tianleiwu merged 3 commits into
microsoft:mainfrom
bachelor-dou:update
Mar 18, 2026
Merged

[CANN] Fix test errors during onnxruntime-cann build and compilation#27091
tianleiwu merged 3 commits into
microsoft:mainfrom
bachelor-dou:update

Conversation

@bachelor-dou

@bachelor-dou bachelor-dou commented Jan 21, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes test errors encountered during the build and compilation of onnxruntime-cann.
error1:
Unrecognized because HiSilicon CPU info was not added, leading to CTest errors.

onnxruntime cpuid_info warning: Unknown CPU vendor. cpuinfo_vendor value: 15

10: [----------] Global test environment tear-down
10: [==========] 15 tests from 1 test suite ran. (772 ms total)
10: [  PASSED  ] 15 tests.
10/10 Test #10: onnxruntime_ep_graph_test ...............   Passed    0.98 sec

90% tests passed, 1 tests failed out of 10

Total Test time (real) = 674.68 sec

The following tests FAILED:
          1 - onnxruntime_test_all (Failed)
Errors while running CTest

error2:
Some Python tests are failing here due to a previously submitted PR (#25867). In that PR, we introduced a new parameter enable_cann_subgraph to control subgraph partitioning for unsupported operators, with a preference for executing the entire graph as a whole. However, this change causes certain test cases to fail when specific operator versions in the models are not supported, leading to execution errors.

@bachelor-dou
bachelor-dou marked this pull request as ready for review January 21, 2026 09:01
@bachelor-dou

Copy link
Copy Markdown
Contributor Author

@fffrog

@bachelor-dou

Copy link
Copy Markdown
Contributor Author

@tianleiwu Please review this PR when you have time so that it can be merged in a timely manner. thank
you

tianleiwu
tianleiwu previously approved these changes Feb 19, 2026
@tianleiwu

Copy link
Copy Markdown
Contributor

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@tianleiwu
tianleiwu enabled auto-merge (squash) February 19, 2026 16:11
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses build/test failures seen in onnxruntime-cann by (1) recognizing HiSilicon/Huawei CPU vendor info to avoid CPUID warnings that trip CTest, and (2) configuring CANN EP tests to enable subgraph partitioning to avoid failures when full-graph execution hits unsupported op versions.

Changes:

  • Add HiSilicon (Huawei) CPU vendor mapping to prevent “Unknown CPU vendor” warnings during test runs.
  • Update several Python test modules to pass {"enable_cann_subgraph": True} when using CANNExecutionProvider.
  • Exclude CANN EP from a known-unsupported MLOps model test.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
onnxruntime/test/python/onnxruntime_test_python_sparse_matmul.py Adds a CANN EP provider-options tuple (enable subgraph partitioning) for a sparse matmul test session.
onnxruntime/test/python/onnxruntime_test_python_mlops.py Uses CANN EP provider-options tuple broadly; excludes CANN for one unsupported TreeEnsemble test.
onnxruntime/test/python/onnxruntime_test_python.py Introduces provider list with CANN subgraph enabled; updates provider filtering to handle tuple-based providers and uses it in select sessions.
onnxruntime/core/common/cpuid_info_vendor.cc Adds vendor mapping for cpuinfo_vendor_huawei to label as “HiSilicon” and assign vendor ID.

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

Comment thread onnxruntime/test/python/onnxruntime_test_python_mlops.py
Comment thread onnxruntime/test/python/onnxruntime_test_python_sparse_matmul.py
@tianleiwu

Copy link
Copy Markdown
Contributor

@bachelor-dou, please format the code with "lintrunner -a"

auto-merge was automatically disabled February 24, 2026 02:09

Head branch was pushed to by a user without write access

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 27091 in repo microsoft/onnxruntime

@bachelor-dou

Copy link
Copy Markdown
Contributor Author

@bachelor-dou, please format the code with "lintrunner -a"
The issue has been fixed. Please re-trigger the CI checks. Thank you

@tianleiwu

Copy link
Copy Markdown
Contributor

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

@tianleiwu

Copy link
Copy Markdown
Contributor

/azp run Linux QNN CI Pipeline, Win_TRT_Minimal_CUDA_Test_CI, Windows ARM64 QNN CI Pipeline, Windows GPU Doc Gen CI Pipeline

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 4 pipeline(s).

@tianleiwu tianleiwu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The core changes are reasonable and well-motivated. The CANN subgraph partitioning approach is the right way to handle unsupported operators, and the HiSilicon CPU vendor fix is straightforward.

@tianleiwu
tianleiwu enabled auto-merge (squash) March 6, 2026 07:28
@bachelor-dou

Copy link
Copy Markdown
Contributor Author

@tianleiwu Please help retrigger the CI. One of the CI jobs timed out, which is blocking the merge. thank you

@tianleiwu

Copy link
Copy Markdown
Contributor

@bachelor-dou, I've re-run the jobs. Please be patient since the CI pipeline has some issue right now.

@bachelor-dou

Copy link
Copy Markdown
Contributor Author

@bachelor-dou, I've re-run the jobs. Please be patient since the CI pipeline has some issue right now.

ok

@tianleiwu
tianleiwu merged commit 1a78d0d into microsoft:main Mar 18, 2026
109 of 122 checks passed
@bachelor-dou
bachelor-dou deleted the update branch March 25, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants