-
Notifications
You must be signed in to change notification settings - Fork 36
[NPU] add A5 support for A2E and E2A ops #276
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,13 +6,28 @@ set -euo pipefail | |
|
|
||
| ROOT_DIR=$1 | ||
| SOC_VERSION=$2 | ||
| CANN_HOME="${ASCEND_HOME_PATH:-/usr/local/Ascend/ascend-toolkit/latest}" | ||
| OPP_CONFIG_DIR="${CANN_HOME}/opp/built-in/op_impl/ai_core/tbe/config" | ||
|
Comment on lines
+9
to
+10
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Respect supported Ascend environment paths when resolving A5. setup.py treats ASCEND_OPP_PATH as a supported Ascend environment and build.sh honors it, but this resolver derives OPP_CONFIG_DIR only from ASCEND_HOME_PATH or the default installation. With a CANN 9.1 installation exposed only through ASCEND_OPP_PATH, it selects ascend910_95 even when the ascend950 configuration exists. Please resolve through ASCEND_OPP_PATH/ASCEND_TOOLKIT_HOME as applicable and add a behavioral resolver test. |
||
|
|
||
| resolve_a5_compute_unit() { | ||
| # CANN 9.1+ names Atlas A5 as ascend950. CANN 8.5 used the | ||
| # transitional ascend910_95 alias for the same DAV_3510 arch. | ||
| if [ -d "${OPP_CONFIG_DIR}/ascend950" ]; then | ||
| echo "ascend950" | ||
| else | ||
| echo "ascend910_95" | ||
| fi | ||
| } | ||
|
|
||
| case "$SOC_VERSION" in | ||
| 910c|ascend910_93*|ascend910_9392) | ||
| SOC_ARG="ascend910_93" | ||
| ;; | ||
| 950|a5|ascend950*|ascend910_95*) | ||
| SOC_ARG="$(resolve_a5_compute_unit)" | ||
| ;; | ||
| *) | ||
| echo "AFD A2E/E2A custom ACLNN ops are currently built only for Ascend 910C; got ${SOC_VERSION}." | ||
| echo "AFD A2E/E2A custom ACLNN ops are currently built for Ascend 910C or Ascend 950/A5; got ${SOC_VERSION}." | ||
| exit 0 | ||
| ;; | ||
| esac | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Reject A5 groups beyond the 64-entry HCCL ABI. The new A5 context has only 64 windowsIn entries, while the kernels iterate through expertRankSize + attentionRankSize and current validation permits larger values. Such groups index beyond the context array. Please add an A5-specific rank-count guard here and in E2A before returning successful tiling.