已合并
fix default value for smla torch interface #10191
wangzhe123456789创建于 4 天前
fix default value for smla torch interface #10191
已合并
wangzhe123456789创建于 4 天前
wangzhe123456789成员
4 天前

描述

fix default value for smla torch interface

关联的Issue

测试

文档更新

类型标签

likedislike
Pull Request已成功合入, 合并人@CANN-robot
(感谢 wangzhe123456789 的贡献)
Wwangzhe123456789成员
4 天前 创建了 pull request,commit cf028e31
atomgit-bot
atomgit-bot
4 天前 评论:

变更摘要

该 PR 修复 SMLA(稀疏 Flash MLA)Torch 接口的默认参数值。核心改动位于 torch_extension/cann_ops_transformer/ops/sparse_flash_mla.py:将 SparseFlashMlaOpBuilder 的 schema、构造函数以及 sparse_flash_mla 函数的 ori_mask_modecmp_mask_modeori_win_leftori_win_right 默认值统一调整,使其与算子实际支持的取值范围一致(-1 表示窗口不限);同时在 sparse_flash_mla_tiling.cpp 中放宽 A2/A3 平台下 cmpMaskMode 的校验条件,配合新默认值。

主要改动

  • Torch 接口默认值修复:在 sparse_flash_mla.py 中将 ori_mask_mode 默认值由 4 改为 0cmp_mask_mode3 改为 0ori_win_left127 改为 -1ori_win_right0 改为 -1,并同步更新 schema、构造方法与 sparse_flash_mla 函数签名三处默认值。
  • tiling 校验条件放宽SMLATilingCheck::CheckFeatureShape 中,A2/A3 平台下 cmpMaskMode 必须为 3 的校验改为仅当 smlaInfo_.perfModeCFA_TEMPLATE_MODESCFA_TEMPLATE_MODE 时才执行,允许 SWA 等模式使用 cmp_mask_mode=0
  • 行尾格式统一sparse_flash_mla_tiling.cpp 中其余大量改动为换行符格式统一(\r\n\n),不涉及逻辑变更。
likedislike
wangzhe123456789成员
4 天前 评论:

compile

likedislike
CANN-robotCANN-robot成员
4 天前 添加了label:cann-cla/yes
Wwangzhe123456789成员
4 天前 update merge request[project id: 7673863, iid: 10191, commit_id: d306e99f1e0fec7946d21484ea6aefc490767f49] virtual merging success
CANN-robot
CANN-robot成员
4 天前 评论:

CLA Signature Pass

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

likedislike
CANN-robot
CANN-robot成员
4 天前 评论:

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.
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
9.1.0 yang-binrong, Andy-lb (2/2) Andy-lb (1/1)

💡 Tip:

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

CLA Signature Pass

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

likedislike
CANN-robotCANN-robot成员
4 天前 将guijianwei,hz36amy_00,coder_linx,juyangokok,monologue815,xuanyuandy,crystalhu,yu-xinjie62,huangwei791,jiang-lirui,yang-binrong,Allan_Yu,TianXL,liudan12,shasha_an,jiangtao_rts,gitcode-chenjiao,cc-z,shen_weiling,hanxiaolong,gaoxiang618,songjionghui,wenxin_fight,miaofangzheng,mabing1118,tang-hao-hw-gitcode,haijie_699874,zzy__,gcw_kUomxQ2l,Andy-lb,yuhao_,L_Euler设为评审人
CANN-robotCANN-robot成员
4 天前 将TianXL,jiangtao_rts,gitcode-chenjiao,hanxiaolong,gcw_kUomxQ2l,Andy-lb设为审查人
Wwangzhe123456789成员
4 天前 关联了issue:[Bug-Report|缺陷反馈]: smla的torch默认参数与def不符
CANN-robotCANN-robot成员
4 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
4 天前 评论:

流水线任务触发成功
任务链接 [227c1897646745828cda18228db6f1b1][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-18 09:47:23]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
4 天前 评论:

流水线任务触发成功
任务链接 [1704103af06e4b59af3a423d75a3ab39][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ⚠️ WARNING >>>>> >>>>>

[2026-08-18 09:36:47]    CI执行结束

likedislike
CANN-robotCANN-robot成员
4 天前 删除了label:ci-pipeline-running
此处折叠了5条事件消息 查看更多
CANN-robotCANN-robot成员
4 天前 删除了label:ci-pipeline-passed
wangzhe123456789成员
4 天前 评论:

compile

likedislike
CANN-robot
CANN-robot成员
4 天前 评论:

Notification

This pull request has been changed(code update) or closed, so removes the following label(s): ci-pipeline-passed.

likedislike
Wwangzhe123456789成员
4 天前 update merge request[project id: 7673863, iid: 10191, commit_id: f2cbe460b3af5f20802fdbfbe1f7e631f4b78f4a] virtual merging success
CANN-robotCANN-robot成员
4 天前 添加了label:cann-cla/yes
CANN-robotCANN-robot成员
4 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
4 天前 评论:

流水线任务触发成功
任务链接 [80951c7a36964e74a139228a15893be0][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>

[2026-08-18 10:02:53]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
4 天前 评论:

流水线任务触发成功
任务链接 [a1bb5aaf2ae14416961003f7ea45c19f][流水线指导]

任务名称状态日志下载链接
codecheck ❌ FAILED None
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ⚠️ WARNING >>>>> >>>>>
likedislike
wangzhe123456789成员
4 天前 评论:

compile

likedislike
CANN-robotCANN-robot成员
4 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
4 天前 添加了label:ci-pipeline-failed
CANN-robotCANN-robot成员
4 天前 删除了label:ci-pipeline-failed
CANN-robotCANN-robot成员
4 天前 添加了label:ci-pipeline-running
CANN-robot
CANN-robot成员
4 天前 评论:

流水线任务触发成功
任务链接 [7bd16262b1294a309867ff67442a11e1][流水线指导]

任务名称状态日志下载链接
Compile_Ascend_X86 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental ✅ SUCCESS >>>>> >>>>>
Compile_Pre ✅ SUCCESS >>>>>
pre_comment ✅ SUCCESS >>>>>
Compile_X86_monitor_910b ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_910c ✅ SUCCESS >>>>> >>>>>
Compile_X86_monitor_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_ARM_experimental_950 ✅ SUCCESS >>>>> >>>>>
Compile_Ascend_X86_mobile_station ✅ SUCCESS >>>>> >>>>>
UT_Test ✅ SUCCESS
PreSmoke_A900 ✅ SUCCESS >>>>>
PreSmoke_ATK_Test_A2 ✅ SUCCESS >>>>>

[2026-08-18 10:17:07]    CI执行结束

likedislike
CANN-robot
CANN-robot成员
4 天前 评论:

流水线任务触发成功
任务链接 [8b4bd338615a423d98877d6514beb699][流水线指导]

任务名称状态日志下载链接
codecheck ✅ SUCCESS >>>>>
SCA ✅ SUCCESS >>>>>
antipoison ✅ SUCCESS >>>>>
codecheck_style ✅ SUCCESS >>>>>
StaticCheck_codespell_check ✅ SUCCESS
StaticCheck_link_validity_check ✅ SUCCESS
StaticCheck_resource_existence_check ✅ SUCCESS
StaticCheck_tag_closed_check ✅ SUCCESS
StaticCheck_markdownlint ✅ SUCCESS
codecheck_checkpr ✅ SUCCESS
codecheck_precommit ⚠️ WARNING >>>>> >>>>>

[2026-08-18 10:06:38]    CI执行结束

likedislike
CANN-robotCANN-robot成员
4 天前 删除了label:ci-pipeline-running
CANN-robotCANN-robot成员
4 天前 添加了label:ci-pipeline-passed
Andy-lb成员
4 天前 评论:

/approve

likedislike
CANN-robotCANN-robot成员
4 天前 添加了label:approved
yang-binrong成员
4 天前 评论:

/lgtm

likedislike
CANN-robotCANN-robot成员
4 天前 添加了label:lgtm
CANN-robotCANN-robot成员
4 天前 关闭了关联的issue
CANN-robotCANN-robot成员
4 天前 合入了pull request