已合并
feat: ThresholdV2 与 ConcatOffset 算子适配 ascend350/ascend960pr/ascend960dt #11280
esok11创建于 29 天前
feat: ThresholdV2 与 ConcatOffset 算子适配 ascend350/ascend960pr/ascend960dt #11280
已合并
esok11创建于 29 天前
esok11成员
29 天前

描述

为 ThresholdV2(activation/threshold_v2)与 ConcatOffset(index/concat_offset)两个算子扩展芯片支持,新增适配 ascend350、ascend960pr、ascend960dt 产品型号。

改动原因:新芯片需要在算子定义、编译单元与 tiling 配置中显式声明支持,否则算子不会为这些芯片生成 kernel 及二进制配置。

改动方法:

  • activation/threshold_v2
    • CMakeLists.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_offset
    • CMakeLists.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

测试

  • 本 PR 为芯片适配配置变更,未新增/修改测试用例。

文档更新

  • 无

类型标签

AI/Agent生成声明

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 esok11 的贡献)
Eesok11成员
29 天前 创建了 pull request,commit 5e331f6b
atomgit-bot
atomgit-bot
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,为对应平台提供更完整的输入输出契约描述。
likedislike
不准确?
atomgit-bot
atomgit-bot
29 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
CANN-robotCANN-robot成员
29 天前 添加了label:cann-cla/yes
CANN-robot
CANN-robot成员
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 /approve or /lgtm
  • Commenting /approve implies 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. 👍

likedislike
此处折叠了44条消息 查看更多
Eesok11成员
19 天前 取消了草稿状态
Eesok11成员
19 天前 修改标题为 “feat: ThresholdV2 与 ConcatOffset 算子适配 ascend350/ascend960pr/ascend960dt”,原标题为“[WIP][WIP]feat: ThresholdV2 与 ConcatOffset 算子适配 ascend350/ascend960pr/ascend960dt”
esok11成员
19 天前 评论:

/check-pr

likedislike
CANN-robotCANN-robot成员
19 天前 关闭了关联的issue
CANN-robotCANN-robot成员
19 天前 合入了pull request