Closed
[Requirement|需求建议]: DV122(Ascend960PR / dav_9202 / Ascend960PR_969A1)math/random/conversion 域算子适配 #4838
huairuchenAdd on  23 hours agoClosed at  18 hours ago
huairuchen
huairuchenCollaborators
23 hours ago Create

一、背景信息 (必填)

DV122(Ascend960PR / dav_9202 / Ascend960PR_969A1)math/random/conversion 域算子适配。参照 ascend960dt(DAV_9201) 既有适配模式,为 ChunkCat、UnfoldGrad、CdistGrad、DropOutV3Grad、TransformBiasRescaleQkv、AmpUpdateScale、StatelessExponential、StatelessSampleMultinomial 等算子补齐 ascend960dt/ascend960pr 平台支持,适配原则:9201 支持的能力 9202 均支持;此前仅有 960dt 的算子(如 ChunkCat)本批补齐 960pr 侧。

二、价值/作用 (必填)

使上述算子在 DV122(Ascend960PR)平台上可用,与 vector 算子批量适配(#4682)共同完成 DV122 算子使能,支撑 DV121/DV122 实机部署与模型验证。

三、设计方案 (必填)

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

Aclnn 直调、PyTorch 训练/推理。

3.2 总体设计

注册级适配:

  • CMakeLists.txt:SUPPORT_COMPUTE_UNIT 追加 "ascend960dt"/"ascend960pr",SUPPORT_TILING_DIR 按位插入对应 arch35
  • op_host/*_def.cpp:AICore().AddConfig("ascend960dt"/"ascend960pr", <960dt/ascend950 同款配置>)
  • op_host/config/ascend960dt、ascend960pr/:二进制配置(*_binary.json / *_simplified_key.ini,照抄 ascend950/ascend960dt 形态)

代码级补齐(9201 → 9201||9202):

  • ChunkCat:tiling isAscend960dt_ 补 DAV_9202;kernel 编译宏 NPU_ARCH==9201 / CCE_AICORE==310||9201 补 9202
  • DropOutV3Grad:op_api 门禁放行 DAV_9201/9202
  • CdistGrad:BF16→FP32 的 SocVersion 判断改为 NpuArch(DAV_2201,行为等价)
  • UnfoldGrad:op_api isArch35 判断补 DAV_9201/9202
  • dsa_random_uniform/aclnn_uniform:DAV_3510 单判断改 IsRegBase
3.2.1 算子支持的数据类型

与 ascend950/ascend960dt 既有支持一致,不新增。

3.2.2 host侧设计

tiling 复用 arch35 路径,芯片判断放行 DAV_9202,不涉及切分逻辑改动。

3.2.3 kernel侧设计

复用 ascend950/arch35 kernel(NPU_ARCH==9202 编译宏放行),不涉及 kernel 逻辑改动。

3.3 支持硬件

Ascend960DT(DAV_9201)、Ascend960PR(DAV_9202 / Ascend960PR_969A1)。

3.4 算子约束限制

与 ascend950/ascend960dt 一致,不新增约束。

💡 备注(选填)
关联 PR:https://gitcode.com/cann/ops-math/pull/7033

likedislike
huairuchenhuairuchenCollaborators
23 hours ago Added label: requirement
huairuchenhuairuchenCollaborators
23 hours ago Assign huairuchen as responsible person
CANN-robotCANN-robotCollaborators
18 hours ago Close issue
CANN-robotCANN-robotCollaborators
18 hours ago changed custom state from 待办的 to 已完成
CANN-robotCANN-robotCollaborators
16 hours ago Added label: resolved