已关闭
[Requirement|需求建议]: conversion/math类算子支持ascend960dt/ascend960pr平台 #3222
yangjinwen创建于  9月17日关闭于  4 天前
yangjinwen成员
9月17日 创建

一、背景信息 (必填)

ascend960dt / ascend960pr 新平台需要 conversion / math 类算子的支持。当前 conversion 类 batch_to_space_nd、concat、concat_d、concat_v2、depth_to_space、pack、space_to_depth 7 个算子与 math 类 erfc、rint 2 个算子(共 9 个)仅支持 ascend950 / ascend350(部分含 mc62),需要扩展到新平台。

二、价值/作用 (必填)

扩大上述 9 个算子的 SoC 覆盖范围,使 ascend960dt / ascend960pr 平台上的模型业务可直接调用这些算子,避免因算子缺失阻塞业务迁移。

三、设计方案 (必填)

3.1 使能方式(涉及哪些框架:如Aclnn直调、Pytorch训练等)

9 个算子均为 aclnn_exclude,随 CANN 算子包编译出包使能,供框架/图模式调用,与现有 ascend950 / ascend350 平台一致。

3.2 总体设计

复用现有 arch35 tiling 框架,按算子形态分三类接入:

  1. 平台注册(9 个算子):CMakeLists.txt 的 COMPUTE_UNIT/SUPPORT_COMPUTE_UNIT 新增 ascend960dt、ascend960pr(TILING_DIR 复用 arch35),op_host/*_def.cpp 新增 AICore().AddConfig 注册;
  2. 预编译 binary 与源码编译:batch_to_space_nd、concat_d、depth_to_space、pack、space_to_depth、rint 6 个算子新增 op_host/config/ascend960dt/、op_host/config/ascend960pr/ 下的 *_binary.json 与 *_simplified_key.ini;concat_v2 为 HOSTCPU 算子(依赖 concat),无独立 binary;erfc 的 kernel 源码(arch35/erfc.cpp)通过 add_kernel_sources 的 COMPUTE_UNITS 纳入新平台编译;
  3. concat 的 arch35 tiling/kernel 适配 DAV_9201 架构(仅 9201 生效,不影响既有平台):
    • tiling 侧:ubFactorDim0 按两倍 BLOCK(64B)对齐修正;新增 dtypeSize 提升优化(末轴字节满足 128/64/32/16B 对齐时提升 dtypeSize,减少搬运次数),并注册 bitwidth=16 系列 tilingKey(12116/12126/21116/21216/30016 等);
    • kernel 侧:__NPU_ARCH__ == 9201 下 DataCopyPad 使用带 enAtomicSync 参数的接口分支。
3.2.1 算子支持的数据类型

host 侧注册复用与现有平台相同的 aicoreConfig,支持的数据类型与 ascend950 / ascend350 保持一致,无变化。

3.2.2 host侧设计

仅新增 SoC config 注册(AddConfig);concat 的 arch35 tiling 新增 DAV_9201 专属分支(64B 对齐修正与 dtypeSize 提升),其余算子 infershape / tiling 逻辑复用现有实现,无逻辑修改。

3.2.3 kernel侧设计

batch_to_space_nd、concat_d、depth_to_space、pack、space_to_depth、rint 复用 arch35 预编译 binary;erfc 从 arch35 源码编译;concat 的 arch35 kernel 头文件新增 __NPU_ARCH__ == 9201 的 DataCopyPad 分支(带 enAtomicSync 参数),既有平台路径不变。

3.3 支持硬件

ascend960dt / ascend960pr

3.4 算子约束限制

与现有平台(ascend950 / ascend350)保持一致,无新增约束。

关联 PR:https://gitcode.com/cann/ops-math/pull/5778

likedislike
Yyangjinwen成员
9月17日 添加了label:requirement
yangjinwen成员
9月17日 评论:

/assign @yangjinwen

likedislike
CANN-robotCANN-robot成员
9月17日 将 yangjinwen 设为负责人
Yyangjinwen成员
6 天前 修改标题为 “[Requirement|需求建议]: conversion/math类算子支持ascend960dt/ascend960pr平台”,原标题为“[Requirement|需求建议]: conversion类算子支持ascend960dt/ascend960pr平台”
Yyangjinwen成员
6 天前 修改了issue 的描述
CANN-robotCANN-robot成员
4 天前 关闭了 issue
CANN-robotCANN-robot成员
3 天前 添加了label:resolved