Merged
fix(swiglu_mx_quant): 修正资料与实现不一致,对齐golden参考实现及binary.json属性顺序 #10341
chenfengAdd on Sep 12
fix(swiglu_mx_quant): 修正资料与实现不一致,对齐golden参考实现及binary.json属性顺序 #10341
Merged
Merged fromchenfeng61/ops-nnswiglu_mx_quant_allintocann/ops-nnmaster
Pull Request has been successfully merged by CANN-robot.
(Thank you for chenfeng's contribution.)Sep 12 Added label: cann-cla/yes
CANN-robot
Sep 12 Comments:
Sep 12 Comments:
Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.
For more, you also can visit HICANN.
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| */*/README.md | ✅ 陈娇, 钱泽洪, 杨阳, 王星 (4/2) | ✅ 陈娇 (1/1) |
| */*/docs/acl*.md | ✅ 陈娇, 钱泽洪, 杨阳, 王星 (4/2) | ✅ 陈娇 (1/1) |
| */*/op_graph/*_proto.h | ✅ 汤磊, 钱泽洪, 杨阳, 王星 (4/2) | ✅ 汤磊 (1/1) |
| quant | ✅ 王星, 钱泽洪, 杨阳 (3/2) | ✅ 王星, 钱泽洪 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
chenfeng61, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Sep 12 Set zengjuan,u010470851,sxb154714,chaotang233,crystalhu,yangyang016,fanqirui,gitee-duhuiping,su-yueming,zhajianqing123,tang-lei01,yourealize,chenqi317,LinPX,wang-xing001,liubo75,tangweiwei2,wangzitao_leo,xubinglin,gitcode-chenjiao,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,wangyongguang,fengying555682,liuyang_806,caiwenwen,yanglu-1 as approver
Sep 12 Set zengjuan,u010470851,sxb154714,chaotang233,crystalhu,yangyang016,fanqirui,gitee-duhuiping,su-yueming,zhajianqing123,tang-lei01,yourealize,chenqi317,LinPX,wang-xing001,liubo75,tangweiwei2,wangzitao_leo,xubinglin,gitcode-chenjiao,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,wangyongguang,fengying555682,liuyang_806,caiwenwen,yanglu-1 as approver
Sep 12 Set u010470851,sxb154714,gitee-duhuiping,su-yueming,zhajianqing123,tang-lei01,yourealize,LinPX,wang-xing001,wangzitao_leo,xubinglin,gitcode-chenjiao,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,wangyongguang,fengying555682,liuyang_806,caiwenwen,yanglu-1 as approver
Sep 12 Set u010470851,sxb154714,gitee-duhuiping,su-yueming,zhajianqing123,tang-lei01,yourealize,LinPX,wang-xing001,wangzitao_leo,xubinglin,gitcode-chenjiao,liujie12345678,pingchuantang,Chen_HaoWen,qianzehong,wangyongguang,fengying555682,liuyang_806,caiwenwen,yanglu-1 as approver
Sep 12 Change title to "fix(swiglu_mx_quant): 修正资料与实现不一致,对齐golden参考实现及binary.json属性顺序", originally titled "fix(swiglu_mx_quant): 修正资料与实现不一致及binary.json属性顺序".
Sep 12 Change title to "fix(swiglu_mx_quant): 修正资料与实现不一致,对齐golden参考实现及binary.json属性顺序", originally titled "fix(swiglu_mx_quant): 修正资料与实现不一致及binary.json属性顺序".
Sep 12 Modify description of pull request
chenfeng
Sep 12 Comments:
Sep 12 Comments:
compile


Sep 12 Pre merge succeeded (commit_id: f4c3864540dc16aaa52ff5517f822fb5eccdf57e)
CANN-robot
Sep 12 Comments:
Sep 12 Comments:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


Sep 12 Added label: ci-pipeline-running
Sep 12 Removed label: ci-pipeline-running
Sep 12 Added label: ci-pipeline-passed
yuning_chen
Sep 12 Comments:
Sep 12 Comments:
您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!


Sep 14 Pre merge succeeded (commit_id: c19b2fc310625c62345bca842c448b83065be616)
5 event messages are collapsed here。 See more
Sep 14 Removed label: ci-pipeline-passed
CANN-robot
Sep 14 Comments:
Sep 14 Comments:
Sep 14 Modify description of pull request
chenfeng
Sep 14 Comments:
Sep 14 Comments:
compile


Sep 14 Pre merge succeeded (commit_id: e2ef56556a8b2dd3dc9b85204dda31d2fc6c82ef)
CANN-robot
Sep 14 Comments:
Sep 14 Comments:
| 🚀 CI 流水线已启动 |
|---|
| 📋 执行详情: 点击查看流水线 |


Sep 14 Added label: ci-pipeline-running
Sep 14 Removed label: ci-pipeline-running
Sep 14 Added label: ci-pipeline-passed
yuning_chen
Sep 14 Comments:
Sep 14 Comments:
您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!


qianzehong
Sep 15 Comments:
Sep 15 Comments:
/lgtm
/approve


yangyang016
Sep 15 Comments:
Sep 15 Comments:
/lgtm
/approve


Sep 15 Added label: lgtm
wang-xing001
Sep 15 Comments:
Sep 15 Comments:
/lgtm
/approve


tang-lei01
Sep 15 Comments:
Sep 15 Comments:
/approve


CANN-robot
Sep 15 Comments:
Sep 15 Comments:
The following users do not have permission to comment /lgtm or /approve on any module in this PR:
/approve: 杨阳


Sep 15 Added label: approved
Sep 15 Closed associated issue
Sep 15 Merged pull request
描述
本 PR 修正
swiglu_mx_quant算子资料与实际实现不一致的问题,并对齐 golden 参考实现与 binary.json 属性顺序。改动一:修正算子描述与实现不一致(README.md / docs/aclnnSwigluMxQuant.md / op_graph/swiglu_mx_quant_proto.h)
属性描述由"预留参数"修正为真实语义:
activate_left:表示对输入的前半部分或后半部分做 SwiGLU 激活,false 时激活后半部分;swiglu_mode=1 时该参数不生效swiglu_mode:计算模式 0=传统 SwiGLU、1=奇偶交错变体、2=前后分半 clamp 变体、3=前后分半 sigmoid-clamp 变体,取值范围 [0, 3]clamp_limit:变体 SwiGLU(swiglu_mode=1/2/3)的 clamp 门限,需大于 0glu_alpha/glu_bias:变体 SwiGLU(swiglu_mode=1/2)的 sigmoid 缩放系数 / 线性部分偏置group_mode:0=count 模式、1=cumsum 模式,当前仅支持 0scale_alg:0=OCP、1=cuBLAS、2=RNE(预留),当前仅支持 0 和 1max_dtype_value:预留参数,当前版本未生效输入/输出描述修正:
x:在 activate_dim 指定维度上的尺寸必须是 2 的倍数(原文误写为 dim 维度)group_index:shape[0] 大于 0 且小于等于 256;aclnn 文档数据类型由仅 INT64 修正为 INT32、INT64;补充 data 取值约束——每个值必须为大于等于 0 的整数,且所有值的和必须小于等于需要量化的 x 的总行数y:形状与 x 相同,activate_dim 维度为 x 的一半mxscale:每个量化块(32 个元素一组)的缩放因子;scale 成对存放——axis 轴为 y 对应轴除以 32 向上取整后按偶数对齐,最后一维固定为 2 存放相邻两个量化块的 scale;当 axis=-2 且 group_index 存在时,axis 轴 shape 为 y 对应轴值整除 64 再加 group_num约束修正与补充:
改动二:golden 参考实现修正(tests/assets/golden.py)
改动三:binary.json 属性顺序对齐(op_host/config/ascend950/swiglu_mx_quant_binary.json)
关联的Issue
测试
文档更新
quant/swiglu_mx_quant/README.md:属性语义、输入输出描述及约束修正quant/swiglu_mx_quant/docs/aclnnSwigluMxQuant.md:group_index 数据类型、mxscaleOut shape 规则、约束修正quant/swiglu_mx_quant/op_graph/swiglu_mx_quant_proto.h:属性语义与 mxscale 推导公式注释同步类型标签
AI/Agent生成声明