Pull Request has been successfully merged by CANN-robot.
(Thank you for 陈展熹's contribution.)变更摘要
本 PR 是 NpuArch 整改的一部分,将 Index 与 Pooling 类算子(AvgPool、GatherV2、ScatterNd、IndexFill、SegmentSum 等 31 个算子)的 AI Core 注册、图融合平台判断、tiling 架构判断与二进制编译配置由「按 soc 版本名(ascend950/ascend350)分支」统一改为「按 NpuArch(DAV_3510)」判断,使 Ascend950 与 Ascend350 走同一套注册与执行路径,同时保留 GatherV2 等算子在 950/350 上的既有二进制差异与非 DAV_3510 平台的原有配置。
主要改动
- 算子定义统一按架构注册:各
*_def.cpp引入op_common/op_host/util/op_arch_helper.h,将原先分别调用AddConfig("ascend950", ...)与AddConfig("ascend350", ...)的两处注册合并为一次opbase::ArchConfigHelper::AddConfigByArch(this->AICore(), Ops::Base::DAV_3510, ...),dtype、format、属性和opFile.value配置保持不变。 - 融合 pass 平台判断改为读取编译目标 NpuArch:
common/inc/op_graph/arch_utils.h新增GetNpuArch接口,CheckNpuArch改为基于其查询结果的集合匹配;bucketize_v2、gather_fusion_pass、tensor_scatter_add_fusion_pass、tensor_scatter_update_fusion_pass、inplace_add_fusion_pass、inplace_sub_fusion_pass、sorted_sparse_segment_mean_grad_fusion_pass均删除本地short_soc_version字符串判断,改用ops::CheckNpuArch/ops::GetNpuArch(如{"3510"}、{"3510", "5102", "9201"}),使未在平台表中列举的 DAV_3510 soc 也能命中。 - 架构常量与 tiling 判断统一:
aclnn_gather_nd.cpp、aclnn_scatter.cpp、aclnn_scatter_nd_update.cpp、scatter_elements_v2_asc_tiling.cpp中的NpuArch::DAV_3510改为Ops::Base::DAV_3510,ScatterElementsV2的确定性判断由GetSocVersion() == ASCEND950改为GetCurNpuArch() == Ops::Base::DAV_3510;LinearIndexV2CompileInfo字段isAscend950重命名为isRegbase,tiling 逻辑随之调整。 - 二进制编译配置合并:
scripts/kernel/binary_config/ascendc_config.json中相关算子的compute_units由ascend950/ascend350合并为dav_3510(compile_options同步改为dav_3510键,mc62、ascend960dt、ascend960pr等其余平台项保留);build_binary_opc_gen_task.sh中当soc_version_lower为ascend950/ascend350时额外匹配dav_3510配置项。 - 测试桩与用例补充:新增
tests/ut/common/ut_platform_utils.h,提供Ops::NN::Test::SetPlatformNpuArch(含 soc→NpuArch 映射表)用于构造平台资源;各融合 pass UT 在设置平台后调用该桩,并新增「未列举 soc + NpuArch=3510」的融合成功用例及 350 上跳过 legacy 融合的 dtype 覆盖用例。
🧩 本次 Review 已使用自定义 Skill:


Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| */*/op_host/*_def.cpp | ✅ 汤磊, 汤平川, 钱泽洪 (3/2) | ✅ 汤磊 (1/1) |
| index | ✅ 汤平川, 钱泽洪 (2/2) | ✅ 汤平川, 钱泽洪 (2/1) |
| pooling | ✅ 汤平川, 钱泽洪 (2/2) | ✅ 汤平川, 钱泽洪 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
yourealize, thanks for your pull request. All authors of the commits have signed the CLA. 👍


The MR can not be merged, because of CodeReview discussion not resolved
If you want to solve this problem, you can click here to do it in the FAQs.


Pull Request 已合并或已关闭。
If you want to solve this problem, you can click here to do it in the FAQs.


描述
对 Index、Pooling 共 31 个 AI Core 算子进行 NpuArch 整改,统一 DAV_3510 及原有 DAV_9201/DAV_9202 平台的注册、构建配置和相关平台判断。
ArchConfigHelper::AddConfigByArch按架构注册,沿用原有 dtype、format、属性及平台支持范围。dav_3510、dav_9201、dav_9202配置目标平台,与 tiling 目录逐项配对;删除与dav_3510重复的ascend350及对应目录项,950/350 统一由 DAV_3510 覆盖,其他平台保留原有 SoC 配置。Ops::Base::DAV_3510/DAV_9201/DAV_9202。关联的Issue
测试
文档更新
无。
类型标签
AI/Agent生成声明