已合并
feat(dequant_swiglu_quant): swiglu_mode参数校验扩展支持3 #5811
caorenlei创建于 19 天前
feat(dequant_swiglu_quant): swiglu_mode参数校验扩展支持3 #5811
已合并
caorenlei创建于 19 天前
caorenlei
19 天前

【合入来源】

关联 issue:#476

【修改方案】

npu_dequant_swiglu_quant 的 swiglu_mode 入参校验与算子仓能力对齐:

  1. op_plugin/ops/opapi/DequantSwigluQuantOpApi.cpp 中 swiglu_mode 的 TORCH_CHECK 合法取值从 {0, 1, 2} 扩展为 {0, 1, 2, 3},报错文案由 "swiglu_mode only support 0, 1 or 2" 同步更新为 "swiglu_mode only support 0, 1, 2 or 3";
  2. 配套 ops-nn 算子仓 dequant_swiglu_quant 的 swiglu_mode=3 支持(模型变体 SwiGLU:gate=SiLU(x_glu) 后 clamp(max=clampLimit)、up=clamp(x_linear, ±clampLimit)、不使用 gluAlpha/gluBias、前后半切分;Atlas A2/A3 与 Ascend950 侧均已支持),打通 PyTorch → op-plugin → ops-nn 的 mode 3 端到端调用链路;
  3. 仅入参校验条件放宽(+2/-2),无计算逻辑变更,对原有 swiglu_mode=0/1/2 调用完全向后兼容。

【资料变更】

不涉及

【接口变更】

涉及:torch_npu.npu_dequant_swiglu_quant 的 swiglu_mode 参数合法取值范围由 {0, 1, 2} 扩展为 {0, 1, 2, 3},属客户面可见的参数约束放宽(向后兼容,原有合法值行为不变)。

【功能验证】

  1. 改动仅为 TORCH_CHECK 入参校验条件与报错文案扩展,无计算逻辑变更,代码走查确认;
  2. swiglu_mode=3 的算子行为由 ops-nn 仓 dequant_swiglu_quant 侧 UT/ST 覆盖(mode 0-3 全场景 golden 已入库);
  3. CI 以平台流水线执行结果为准。

【CheckList】

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 caorenlei 的贡献)
Ccaorenlei
19 天前 创建了 pull request,commit 7d8c17c6
atomgit-bot
atomgit-bot
19 天前 评论:

变更摘要

本 PR 主要扩展 npu_dequant_swiglu_quant 接口(位于 DequantSwigluQuantOpApi.cpp)对 swiglu_mode 参数的合法性校验范围,由原先仅支持 012 扩展为同时支持 3,并同步更新了对应的错误提示信息,使该参数校验与新支持的取值保持一致。

主要改动

  • 扩展 swiglu_mode 合法取值: 在 npu_dequant_swiglu_quantTORCH_CHECK 校验中新增 swiglu_mode == 3 条件,使 swiglu_mode 支持 0123 四种取值。
  • 更新参数校验错误提示: 将报错文案由 "swiglu_mode only support 0, 1 or 2, but got " 更新为 "swiglu_mode only support 0, 1 , 2 or 3, but got ",确保非法参数时的提示信息与扩展后的校验范围一致。
likedislike
不准确?
atomgit-bot
atomgit-bot
19 天前 评论:

代码审查

✅ 未发现问题

likedislike
不准确?
ascend-robotascend-robot成员
19 天前 添加了label:ascend-cla/yes
ascend-robot
ascend-robot成员
19 天前 评论:

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.


PR Approval Progress

Congratulations! All modules have met the lgtm and approve requirements.

Module Approval Details

module lgtm status approve status
repo-Ascend/op-plugin 褚博宁, liangsongwei (2/2) 褚博宁 (1/1)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

caorenlei, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
ascend-robotascend-robot成员
19 天前 添加了label:needs-issue
ascend-robot
ascend-robot成员
19 天前 评论:

Linking Issue Notice

@caorenlei , the pull request must be linked to at least one issue.
If an issue has already been linked, but the needs-issue label remains, you can remove the label by commenting /check-issue .

likedislike
ascend-robot
ascend-robot成员
19 天前 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
19 天前 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
19 天前 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
19 天前 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
19 天前 添加了label:docs-ci-pipeline-success
Ccaorenlei
19 天前 修改标题为 “feat(dequant_swiglu_quant): swiglu_mode参数校验扩展支持3”,原标题为“feat(dequant_swiglu_quant): swiglu_mode校验扩展支持3”
Ccaorenlei
19 天前 修改了pull request 的描述
ascend-robotascend-robot成员
19 天前 删除了label:needs-issue
caorenlei
19 天前 评论:

compile

likedislike
Ccaorenlei
19 天前 预合并成功(commit_id: 07a3396744b9538cd8170598b8d1b80b62882023)
AtlasAccountAtlasAccount成员
19 天前 添加了label:ci-pipeline-running
ascend-robot
ascend-robot成员
19 天前 评论:

ascend docs pipeline is running...

likedislike
ascend-robotascend-robot成员
19 天前 删除了label:docs-ci-pipeline-success
ascend-robotascend-robot成员
19 天前 添加了label:docs-ci-pipeline-running
ascend-robot
ascend-robot成员
19 天前 评论:

✅ 跳过 docs ci 检查,没有需要检查的文档文件

likedislike
ascend-robotascend-robot成员
19 天前 删除了label:docs-ci-pipeline-running
ascend-robotascend-robot成员
19 天前 添加了label:docs-ci-pipeline-success
AtlasAccountAtlasAccount成员
19 天前 删除了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
19 天前 添加了label:ci-pipeline-failed
AtlasAccount
AtlasAccount成员
19 天前 评论:
流水线 PR-pipeline_op-plugin#3422 [ commitID:eba2dec6 ] 运行失败
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_master_ARM ✅ COMPLETED >>>
Build_v2_7_1_ARM ✅ COMPLETED >>>
Build_v2_9_0_ARM ✅ COMPLETED >>>
Build_v2_10_0_ARM ✅ COMPLETED >>>
Build_v2_11_0_ARM ✅ COMPLETED >>>
Build_v2_12_0_ARM ✅ COMPLETED >>>
Build_master_x86 ✅ COMPLETED >>>
Build_v2_7_1_x86 ✅ COMPLETED >>>
Build_v2_9_0_x86 ✅ COMPLETED >>>
Build_v2_10_0_x86 ✅ COMPLETED >>>
Build_v2_11_0_x86 ✅ COMPLETED >>>
Build_v2_12_0_x86 ✅ COMPLETED >>>
恶意代码检查 Antipoison ✅ COMPLETED >>>
编码安全与规范检查 codecheck_pre-commit ✅ COMPLETED >>>
pre-commit ✅ COMPLETED >>>
开源片段检查 SCA ✅ COMPLETED >>>
开发者测试 UT_master_ARM_01 ❌ FAILED >>>
UT_v2_7_1_ARM ❌ FAILED >>>
UT_v2_9_0_ARM ❌ FAILED >>>
UT_v2_10_0_ARM ❌ FAILED >>>
UT_v2_11_0_ARM ❌ FAILED >>>
UT_v2_12_0_ARM ❌ FAILED >>>
UT_212_ARM_cpp ❌ FAILED >>>
流水线 PR-pipeline_op-plugin ❌ FAILED >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员[wujinyuan1, Hhuangjingwei, Lliangsongwei, Yyashi999, Cculechan, DDring, Wwuyouqi1, LL1919_snow, Qqq_52711437, WW, wss_321]评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
AtlasAccountAtlasAccount成员
19 天前 删除了label:ci-pipeline-failed
AtlasAccountAtlasAccount成员
19 天前 添加了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
19 天前 删除了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
19 天前 添加了label:ci-pipeline-failed
AtlasAccount
AtlasAccount成员
19 天前 评论:
流水线 PR-pipeline_op-plugin#3422 (重试第1次) [ commitID:eba2dec6 ] 运行失败
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_master_ARM ✅ COMPLETED >>>
Build_v2_7_1_ARM ✅ COMPLETED >>>
Build_v2_9_0_ARM ✅ COMPLETED >>>
Build_v2_10_0_ARM ✅ COMPLETED >>>
Build_v2_11_0_ARM ✅ COMPLETED >>>
Build_v2_12_0_ARM ✅ COMPLETED >>>
Build_master_x86 ✅ COMPLETED >>>
Build_v2_7_1_x86 ✅ COMPLETED >>>
Build_v2_9_0_x86 ✅ COMPLETED >>>
Build_v2_10_0_x86 ✅ COMPLETED >>>
Build_v2_11_0_x86 ✅ COMPLETED >>>
Build_v2_12_0_x86 ✅ COMPLETED >>>
恶意代码检查 Antipoison ✅ COMPLETED >>>
编码安全与规范检查 codecheck_pre-commit ✅ COMPLETED >>>
pre-commit ✅ COMPLETED >>>
开源片段检查 SCA ✅ COMPLETED >>>
开发者测试 UT_master_ARM_01 ❌ FAILED >>>
UT_v2_7_1_ARM ❌ FAILED >>>
UT_v2_9_0_ARM ❌ FAILED >>>
UT_v2_10_0_ARM ❌ FAILED >>>
UT_v2_11_0_ARM ❌ FAILED >>>
UT_v2_12_0_ARM ❌ FAILED >>>
UT_212_ARM_cpp ❌ FAILED >>>
流水线 PR-pipeline_op-plugin ❌ FAILED >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员[wujinyuan1, Hhuangjingwei, Lliangsongwei, Yyashi999, Cculechan, DDring, Wwuyouqi1, LL1919_snow, Qqq_52711437, WW, wss_321]评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
AtlasAccountAtlasAccount成员
19 天前 删除了label:ci-pipeline-failed
AtlasAccountAtlasAccount成员
19 天前 添加了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
19 天前 删除了label:ci-pipeline-running
AtlasAccountAtlasAccount成员
19 天前 添加了label:ci-pipeline-passed
AtlasAccount
AtlasAccount成员
19 天前 评论:
流水线 PR-pipeline_op-plugin#3422 (重试第2次) [ commitID:eba2dec6 ] 已完成
>>>代码风格自动修复执行成功(无修复内容)
阶段 任务名 状态 详情
编译构建 Build_master_ARM ✅ COMPLETED >>>
Build_v2_7_1_ARM ✅ COMPLETED >>>
Build_v2_9_0_ARM ✅ COMPLETED >>>
Build_v2_10_0_ARM ✅ COMPLETED >>>
Build_v2_11_0_ARM ✅ COMPLETED >>>
Build_v2_12_0_ARM ✅ COMPLETED >>>
Build_master_x86 ✅ COMPLETED >>>
Build_v2_7_1_x86 ✅ COMPLETED >>>
Build_v2_9_0_x86 ✅ COMPLETED >>>
Build_v2_10_0_x86 ✅ COMPLETED >>>
Build_v2_11_0_x86 ✅ COMPLETED >>>
Build_v2_12_0_x86 ✅ COMPLETED >>>
恶意代码检查 Antipoison ✅ COMPLETED >>>
编码安全与规范检查 codecheck_pre-commit ✅ COMPLETED >>>
pre-commit ✅ COMPLETED >>>
开源片段检查 SCA ✅ COMPLETED >>>
开发者测试 UT_master_ARM_01 ✅ COMPLETED >>>
UT_v2_7_1_ARM ✅ COMPLETED >>>
UT_v2_9_0_ARM ✅ COMPLETED >>>
UT_v2_10_0_ARM ✅ COMPLETED >>>
UT_v2_11_0_ARM ✅ COMPLETED >>>
UT_v2_12_0_ARM ✅ COMPLETED >>>
UT_212_ARM_cpp ✅ COMPLETED >>>
流水线 PR-pipeline_op-plugin ✅ COMPLETED >>>
此流水线已支持下列评论快捷指令,仅PR创建者和白名单成员[wujinyuan1, Hhuangjingwei, Lliangsongwei, Yyashi999, Cculechan, DDring, Wwuyouqi1, LL1919_snow, Qqq_52711437, WW, wss_321]评论有效
  • compile : 运行流水线
  • retry : 重试流水线所有失败子任务
  • retry <任务名> : 仅重试指定失败子任务
  • stop : 停止流水线
likedislike
Ccaorenlei
19 天前 修改了pull request 的描述
梁松伟
梁松伟成员
18 天前 评论:

/lgtm

likedislike
chuboning成员
18 天前 评论:

算子内部有校验的话可以删掉,避免每次同步修改

likedislike
chuboning成员
18 天前 评论:

/approve

likedislike
ascend-robotascend-robot成员
18 天前 添加了label:approvedlgtm
ascend-robotascend-robot成员
18 天前 合入了pull request