已关闭
dvlite(Ascend350)SOC 适配:为 33 个算子启用 ascend350 计算单元支持。 #7724
oah_o创建于  4 天前关闭于  3 天前
oah_o
oah_o成员
4 天前 创建

dvlite(Ascend350)SOC 适配:为 33 个算子启用 ascend350 计算单元支持。

Ascend350 与 Ascend950 同为 DAV_3510 架构(regbase),共用 arch35 tiling 与 kernel 源码,
本次按仓内既有 ascend350 适配模式批量扩展:

  1. 算子注册(32 个 *_def.cpp):新增 AICore().AddConfig("ascend350", config),
    复用 ascend950 同配置对象(含 apply_adam_w_quant 回归框架默认 opFile 名,与 kernel
    入口 apply_adam_w_quant 一致)。
  2. 构建配置:各算子 op_host/op_kernel CMakeLists 的 SUPPORT_COMPUTE_UNIT /
    COMPUTE_UNIT(S) 增加 "ascend350",TILING_DIR 复用 arch35。
  3. 静态二进制:新增 19 个 op_host/config/ascend350/_binary.json(与 ascend950 版
    逐字段一致)及 2 个 ascend350/
    _simplified_key.ini(adam_apply_one_assign、
    fake_quant_with_min_max_args_gradient)。
  4. op_api 平台判断适配(8 个文件):将 GetSocVersion() 硬编码 switch/if 统一改为
    GetCurNpuArch() 判断,消除新增 SOC 的遗漏点:
    • foreach_abs/asin/neg/sign/tanh:DAV_2201 || IsRegbase(curArch)
    • softshrink_backward:DAV_1001 || DAV_2002 || DAV_3002 → 910 dtype 列表
    • ada_layer_norm_backward:DAV_2201 || IsRegbase(curArch) 选择 grad 计算路径
    • index_check:!= DAV_2201 && !IsRegbase(curArch) 决定是否跳过检查
  5. 全局 kernel 编译配置:ascendc_config.json 为 ForeachAsin/AddcdivList/SubScalarInplace/
    Tanh/Exp/Abs/Sign/Neg/MaximumScalar/LambUpdateWithLrV2/ScatterMin 11 个条目补充
    ascend350 compute_units 及对应 compile_options。

涉及算子(33):
FastGeluV2、HardSigmoid、SoftShrinkGrad、NPUClearFloatStatus、IndexCheck、ScatterMin、
ForeachAbs/AddcdivList/Asin/Exp/MaximumScalar/Neg/Sign/SubScalarInplace/Tanh(9)、
SigmoidCrossEntropyWithLogitsGrad、SigmoidFocalLoss、AdaLayerNormGrad、
BN3DTrainingReduceGrad、BNTrainingUpdateGrad、INTrainingUpdateV2、L2NormalizeGrad、
AdamApplyOneAssign、ApplyAdamV2、ApplyAdamWQuant、ApplyProximalGradientDescent、
FusedMulApplyKerasMomentum、InplaceApplyFtrl、LambUpdateWithLrV2、SGD、
SparseApplyAdagradV2、Dequantize、FakeQuantWithMinMaxArgsGradient

likedislike
oah_o
oah_o成员
4 天前 评论:

/assign

likedislike
CANN-robotCANN-robot成员
4 天前 将 oah28 设为负责人
oah_ooah_o成员
4 天前 关联了pull request:dvlite soc adaptive
CANN-robotCANN-robot成员
3 天前 关闭了 issue
CANN-robotCANN-robot成员
3 天前 添加了label:resolved