Closed
npu_swiglu_mx_quant 扩展 swiglu_mode 参数取值范围至 0-3 #452
caorenleiAdd on Aug 26Closed at Sep 29
caorenlei
Aug 26 Comments:
Aug 26 Comments:
/assign @caorenlei


Aug 26 Assign caorenlei as responsible person
Sep 15 Added label: bot-triaged
TorchNPU-Bot
Sep 15 Comments:
Sep 15 Comments:
检测到当前 issue 已关联 PR,自动添加标签:bot-triaged


chenrayray
Sep 29 Comments:
Sep 29 Comments:
该 issue 关联的 PR 均已合入或关闭:Ascend/op-plugin !5786(已合入)。因此本轮 issue 梳理先关闭此单。PR 已关闭不代表相关功能一定已实现;如问题仍存在或还有未完成事项,请重新打开,并补充当前版本、复现步骤及日志,或具体待办和后续 PR。


Sep 29 Close issue
Sep 29 changed custom state from TODO to DONE
Sep 29 Added label: resolved
一、背景信息
npu_swiglu_mx_quant 算子的 swiglu_mode 参数用于控制 SwiGLU 激活函数的变体类型。当前 op-plugin 前端接口中 TORCH_CHECK 仅允许 swiglu_mode 取值 0 和 1,限制了底层 aclnnSwigluMxQuant 算子已支持的 mode 2(ClippedSwiGLU)和 mode 3 变体的使用。
二、价值/作用
扩展 swiglu_mode 取值范围至 0-3,使用户能够使用 ClippedSwiGLU 变体(mode 2、3),满足大模型量化场景下更多激活函数变体的需求。
三、设计方案
修改
op_plugin/ops/opapi/SwigluMxQuantOpApi.cpp中npu_swiglu_mx_quant函数的 TORCH_CHECK 校验逻辑:swiglu_mode == 0 || swiglu_mode == 1扩展为swiglu_mode == 0 || swiglu_mode == 1 || swiglu_mode == 2 || swiglu_mode == 3关联 PR:https://gitcode.com/Ascend/op-plugin/pull/5786