已合并
feat: ThresholdV2 与 ConcatOffset 算子适配 ascend350/ascend960pr/ascend960dt #11280
esok11创建于 29 天前
feat: ThresholdV2 与 ConcatOffset 算子适配 ascend350/ascend960pr/ascend960dt #11280
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 esok11 的贡献)atomgit-bot
29 天前 评论:
29 天前 评论:
变更摘要
本 PR 为 ascend960 系列芯片做适配,主要通过在算子定义中新增 AddConfig 平台注册以及补充对应平台的二进制配置 JSON,使相关算子能够在新增芯片平台上被识别与选择。涉及 ThresholdV2(activation/threshold_v2)和 ConcatOffset(index/concat_offset)两个算子,并顺带修复了 threshold_v2_def.cpp 文件末尾缺失换行的问题。
主要改动
ThresholdV2算子新增平台注册: 在threshold_v2/op_host/threshold_v2_def.cpp的AICore()中新增ascend350、ascend960pr、ascend960dt三个平台配置,复用同一aicore_config,使该算子在上述平台可用。ConcatOffset算子新增平台注册: 在concat_offset/op_host/concat_offset_def.cpp的AICore()中新增ascend960pr、ascend960dt两个平台配置(沿用ascend350已有的aicoreConfig)。- 新增
ThresholdV2二进制配置: 在ascend350、ascend960dt、ascend960pr目录下新增threshold_v2_binary.json,覆盖bfloat16、float16、float32、int8、uint8、int16、int32、int64共 8 种 dtype,输入为x、threshold(必选)与value(可选),输出为y,均采用ND格式。 - 新增
ConcatOffset二进制配置: 在ascend960dt、ascend960pr目录下新增concat_offset_binary.json,定义ConcatOffset_int32_bin,包含concat_dim与动态输入x、动态输出y(int32、FormatAgnostic),并声明属性N。 - 补充可选输入与动态张量声明:
ThresholdV2配置中value标记为paramType: optional,ConcatOffset配置中x、y标记为dynamic,为对应平台提供更完整的输入输出契约描述。


不准确?
atomgit-bot
29 天前 评论:
29 天前 评论:
29 天前 添加了label:cann-cla/yes
CANN-robot
29 天前 评论:
29 天前 评论:
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 | ✅ 汤磊, 王永光, 王星, 王瑞 (4/2) | ✅ 汤磊, 王永光 (2/1) |
| activation | ✅ 王星, 王瑞 (2/2) | ✅ 王瑞, 王星 (2/1) |
| index | ✅ 王星, 王瑞 (2/2) | ✅ 王星, 王瑞 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
esok11, thanks for your pull request. All authors of the commits have signed the CLA. 👍


此处折叠了44条消息 查看更多
19 天前 修改标题为 “feat: ThresholdV2 与 ConcatOffset 算子适配 ascend350/ascend960pr/ascend960dt”,原标题为“[WIP][WIP]feat: ThresholdV2 与 ConcatOffset 算子适配 ascend350/ascend960pr/ascend960dt”
19 天前 关闭了关联的issue
19 天前 合入了pull request
描述
为
ThresholdV2(activation/threshold_v2)与ConcatOffset(index/concat_offset)两个算子扩展芯片支持,新增适配ascend350、ascend960pr、ascend960dt产品型号。改动原因:新芯片需要在算子定义、编译单元与 tiling 配置中显式声明支持,否则算子不会为这些芯片生成 kernel 及二进制配置。
改动方法:
activation/threshold_v2CMakeLists.txt:SUPPORT_COMPUTE_UNIT新增ascend350、ascend960pr、ascend960dt,SUPPORT_TILING_DIR统一映射到arch35。op_host/threshold_v2_def.cpp:为ascend350、ascend960pr、ascend960dt注册AICore().AddConfig。op_kernel/CMakeLists.txt:COMPUTE_UNITS补充ascend350 ascend960pr ascend960dt。op_host/config/{ascend350,ascend960pr,ascend960dt}/threshold_v2_binary.json(沿用 arch35/ascend950 tiling 配置)。index/concat_offsetCMakeLists.txt:SUPPORT_COMPUTE_UNIT新增ascend960pr、ascend960dt(ascend350原已支持),SUPPORT_TILING_DIR同步补齐为 4 个arch35。op_host/concat_offset_def.cpp:为ascend960pr、ascend960dt注册AICore().AddConfig。op_kernel/CMakeLists.txt,声明ascend950 ascend350 ascend960pr ascend960dt编译单元。op_host/config/{ascend960pr,ascend960dt}/concat_offset_binary.json。关联的Issue
测试
文档更新
类型标签
AI/Agent生成声明