已关闭
[Requirement|需求建议]: 新增fusedmatmul可缩放的add场景kernel和后处理 #186
szhexin创建于  15 天前关闭于  13 天前
szhexin成员
15 天前 创建

Thanks for sending a requirement! Please fill in the following template to help quickly solve your problem.

一、背景信息 (必填)

在 FusedMatMul 的 Add 融合场景中,当前接口仅支持将矩阵乘结果与 Add 输入直接相加,无法对两路输入分别进行缩放。为满足 alpha、beta 系数参与计算的需求,需要增加 torch.ops.cann_ops_nn.fused_matmul 接口,新增可选的 alpha 和 beta Tensor 输入,新增add的epilogue模板和kernel模板。

二、价值/作用 (必填)

场景需要对matmul和x3进行缩放处理

三、设计方案 (必填)

通过读取alpha和beta的参数,在后处理中进行不同的vf模式累加
3.1 使能方式(涉及哪些框架:如Aclnn直调、Pytorch训练等)
3.2 总体设计
3.2.1 算子支持的数据类型

bf16/fp16

3.2.2 host侧设计

新增aclnnnfusedmatmulv2接口,加入可选alpha和beta参数进行传递,在后处理中进行缩放处理

3.2.3 kernel侧设计

新增一个kernel文件单独处理特定的epilogue

3.3 支持硬件

ascend950

3.4 算子约束限制

💡 备注(选填)

likedislike
Sszhexin成员
15 天前 添加了label:requirement
Sszhexin成员
15 天前 将 szhexin 设为负责人
CANN-robotCANN-robot成员
13 天前 关闭了 issue
CANN-robotCANN-robot成员
13 天前 添加了label:resolved