[CANN] Fix test errors during onnxruntime-cann build and compilation - #27091
Conversation
|
@tianleiwu Please review this PR when you have time so that it can be merged in a timely manner. thank |
|
/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 successfully started running 4 pipeline(s). |
There was a problem hiding this comment.
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 usingCANNExecutionProvider. - 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.
|
@bachelor-dou, please format the code with "lintrunner -a" |
Head branch was pushed to by a user without write access
|
Commenter does not have sufficient privileges for PR 27091 in repo microsoft/onnxruntime |
|
|
/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 successfully started running 4 pipeline(s). |
|
/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 successfully started running 4 pipeline(s). |
tianleiwu
left a comment
There was a problem hiding this comment.
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 Please help retrigger the CI. One of the CI jobs timed out, which is blocking the merge. thank you |
|
@bachelor-dou, I've re-run the jobs. Please be patient since the CI pipeline has some issue right now. |
ok |
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.
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.