Merged
fix(operation): Clamp GM accumulation K view shape to remaining K [9.2.0] #6447
li_qingyanAdd on Sep 17
fix(operation): Clamp GM accumulation K view shape to remaining K [9.2.0] #6447
Merged
Pull Request has been successfully merged by CANN-robot.
(Thank you for li_qingyan's contribution.)Sep 17 Created pull request, commit 9128ad2e
Sep 17 Associated issue: [Bug|缺陷]: GM累加路径K尾块View的shape未按剩余K裁剪,块尺寸超出实际数据范围
atomgit-bot
Sep 17 Comments:
Sep 17 Comments:
变更摘要
本 PR 针对 GM 累加(splitK)路径的 ComputeGmAccumulationKernel 函数,修复 K 不是 L1 tile 整数倍时尾块 A/B tensor 的 View shape 声明与实际剩余 K 数据不匹配的问题。改动引入 kViewShape,将尾块 View 的 K 维由整块 kL1Size 收敛为实际剩余 K,并同步调整 partialKValidShape 的裁剪上限,避免块尺寸超出真实数据范围。
主要改动
- 新增
kViewShape计算: 通过min(kSize2D - kL1Size * kIdx, kL1Size)得到每个 K 迭代块的实际有效 K 长度,使尾块不再声明整块kL1Size。 - A tensor View shape 调整:
transA与非transA两种布局下,View的 K 维由kL1Size改为kViewShape,与真实剩余 K 数据范围一致。 - B tensor View shape 调整:
transB与非transB两种布局下,View的 K 维由kL1Size改为kViewShape,与 A tensor 侧同步。 partialKValidShape裁剪上限同步: 由Min(SymbolicScalar(kL1Size))改为Min(SymbolicScalar(kViewShape)),使 validShape 裁剪上限与新的 View shape 保持一致。


Incorrect?
atomgit-bot
Sep 17 Comments:
Sep 17 Comments:
Sep 17 Added label: stat/needs-squash
Sep 17 Added label: cann-cla/yes
CANN-robot
Sep 17 Comments:
Sep 17 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 |
|---|---|---|
| framework/src/interface/operation | ✅ shi-dingkun, dai-zhentao (2/2) | ✅ dai-zhentao (1/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
li_qingyan, thanks for your pull request. All authors of the commits have signed the CLA. 👍


Sep 17 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
Sep 17 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
Sep 17 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
Sep 17 Set xinweiliu,cam_bxh,dai-zhentao,lululu40888,shi-dingkun,gguuaanngg,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,yinjie27_,congqiannan,zhangyuebing,tsungl4,gaoxingwang,zhiweiyuan,caodongdong,make_pto,zhoubotcam,linjiashu,wangbing110,WenboCodes as approver
Sep 17 Pre merge succeeded (commit_id: 29d349f6e84b6896b8d5a2044003ac4c9f92e5f8)
Sep 17 Pre merge succeeded (commit_id: f097912ff614a4298e7596fca15e61bb47c651ec)
Sep 17 Removed label: cann-cla/yes
Sep 17 Removed label: stat/needs-squash
CANN-robot
Sep 17 Comments:
Sep 17 Comments:
Sep 17 Added label: cann-cla/yes
Sep 17 Removed approver lululu40888,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,congqiannan,zhangyuebing,gaoxingwang,zhiweiyuan,caodongdong,zhoubotcam,wangbing110,WenboCodes
Sep 17 Removed approver lululu40888,codehjp423,gaoxiang618,wangzheng97,DCGDDD,syfeng,jason_yuan_ye,foundea,ym-HW,hw_zhangzhiqi,congqiannan,zhangyuebing,gaoxingwang,zhiweiyuan,caodongdong,zhoubotcam,wangbing110,WenboCodes
Sep 17 Modify description of pull request
li_qingyan
Sep 18 Comments:
Sep 18 Comments:
compile


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


Sep 18 Added label: ci-pipeline-running
Sep 18 Removed label: ci-pipeline-running
Sep 18 Added label: ci-pipeline-passed
shi-dingkun
Sep 18 Comments:
Sep 18 Comments:
/lgtm


Sep 18 Modify description of pull request
dai-zhentao
Sep 18 Comments:
Sep 18 Comments:
/approve


Sep 18 Added label: lgtmapproved
Sep 18 Merged pull request
问题
GM 累加(splitK)路径
ComputeGmAccumulationKernel中,当 K 不是 L1 tile 整数倍时,K 尾块 A/B tensor 的 View shape 仍声明整块kL1Size,超出实际剩余 K 数据(仅 validShape 裁剪),块尺寸与真实数据范围不匹配,存在越界读取/构图语义错误风险。方案
新增
kViewShape = min(kSize2D - kL1Size * kIdx, kL1Size),A/B tensor View shape 由kL1Size改为kViewShape(transA/transB 4 处布局同步);partialKValidShape裁剪上限同步改为kViewShape。总计 1 个文件,+6/-5。
校验
UT:
DynamicMatmulUTest.mm_A_B_ND_KSplit_bf16(GM 累加路径)单跑通过;Matmul 相关 UT 套件结果与未改动基线一致(既有用例间污染失败非本改动引入)。Related Issue: #3364