Closed
[Requirement|需求建议]: GLU 算子支持 ascend960dt #6190
zhanw_codingAdd on Sep 24Closed at Sep 24
Sep 24 Added label: requirement
zhanw_coding
Sep 24 Comments:
Sep 24 Comments:
/assign


Sep 24 Assign zhanw_coding as responsible person
Sep 24 Close issue
Sep 24 Added label: resolved
Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.
Backgroud(背景信息)
GLU(Gated Linear Unit,门控线性单元)算子当前仅在 ascend950 等上提供支持。本需求为 GLU 算子新增 ascend960dt 平台支持,使其可在 ascend960dt 上完成算子注册、编译并运行。
Origin(信息来源)
自提
Benefit / Necessity (价值/作用)
扩展 GLU 算子的产品支持范围,使 ascend960dt 平台可使用 GLU 门控线性单元计算能力,满足相关网络结构在该平台上的算子需求。
Design(设计方案)
config 配置:新增
activation/glu/op_host/config/ascend960dt/glu_binary.json,登记 float32 / float16 / bfloat16 三种 dtype 的二进制配置(输入输出均为 ND、FormatAgnostic,dim 属性值为 0)。def 支持:在
activation/glu/op_host/glu_def.cpp中为 GLU 增加 ascend960dt 配置,复用 ascend950 的 config950:this->AICore().AddConfig("ascend960dt", config950);
编译选项配置:在
scripts/kernel/binary_config/ascendc_config.json中,GLU 的 compute_units 增加 ascend960dt,并为其配置编译选项 -mllvm -cce-aicore-dcci-before-kernel-end=false(与 ascend950 一致)。buffer size 硬编码消除:arch35 kernel 的 shape 实现不再使用硬编码常量 BUFFER_SIZE(glu_common.h 中 constexpr static int64_t BUFFER_SIZE = 10 * 1024;),改为按实际 tiling 参数与数据类型计算 UB buffer 大小:
使 buffer 大小随 dtype 与 splitSize / group_ub_num 自适应。