fix(ascend): detect exact SoC version - #986
Open
baominghelly wants to merge 1 commit into
Open
baominghelly wants to merge 1 commit into
baominghelly wants to merge 1 commit into
Conversation
baominghelly
marked this pull request as ready for review
September 15, 2026 08:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
torch_npu, such asAscend910_9362, when automatically selecting AscendSOC_VERSION._TORCH_PYTHON,Python_EXECUTABLE, orPATHin that order.npu-smi infoas a fallback, but only accept model-qualified names such as910B4orAscend910_9362.Ascend910B4as the final fallback for existing environments where an exact model cannot be determined.torch_npudetection, rejection of HBM numbers such as3109, and model-qualifiednpu-smifallback.Motivation
Ascend 910C hosts can report the generic name
Ascend910throughnpu-smi, while AscendC compilation requires the exact SoC nameAscend910_9362. The previous text search could also mistake an HBM value such as3109 / 65536for an Ascend3109device. This makes automatic custom-kernel builds select the wrong SoC or fall back unnecessarily.Closes #
Type of Change
feat— new feature / new operator / new platformfix— bug fixperf— performance improvement (no behavioral change)refactor— code restructuring without behavior changetest— adding or fixing tests onlydocs— documentation onlybuild/ci— build system or CI configuration!in the Conventional Commits prefix or aBREAKING CHANGE:footer)Platforms Affected
WITH_CPU)WITH_NVIDIA)WITH_ILUVATAR)WITH_METAX)WITH_CAMBRICON)WITH_MOORE)WITH_ASCEND)WITH_TORCH)Smoke Test Result
Affected-platform smoke build was not run for this final rebased head. The changed detector was validated directly with:
Real Ascend 910C detector result:
Test Results on Supported Platforms
Full `pytest` output (optional)
Benchmark / Performance Impact
N/A
Notes for Reviewers
SOC_VERSIONstill takes precedence over automatic detection.torch_npuis preferred because it returns the exact runtime device model.Ascend910/Ascend310and numeric-only tokens to avoid interpreting HBM values as SoC names.Ascend910_9362). The existing fallback preserves 910B4 behavior, but 310P was not hardware-validated for this change.