Pull Request has been successfully merged by CANN-robot.
(Thank you for llqx-1's contribution.)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
PR Approval Progress
✅ Congratulations! All modules have met the lgtm and approve requirements.
Module Approval Details
| module | lgtm status | approve status |
|---|---|---|
| matmul | ✅ 唐超, 唐玮玮 (2/2) | ✅ 唐超, 唐玮玮 (2/1) |
💡 Tip:
- Committer can comment
/approveor/lgtm- Commenting
/approveimplies both code review (lgtm) and intent to merge (approve)
CLA Signature Pass
llqx-1, thanks for your pull request. All authors of the commits have signed the CLA. 👍


compile


流水线任务触发成功
任务链接 [52947f07eb7c44abb6a9d718ff756b24][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_classify | ✅ SUCCESS | >>>>> | |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_harmony-infer-chs-nn | ✅ SUCCESS | ||
| UT_Test_report_lcov | ⚠️ WARNING | >>>>> |
[2026-07-15 11:36:58] CI执行结束


流水线任务触发成功
任务链接 [4370c125aba44ffc97f5dbc8d09782af][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ❌ FAILED | >>>>> | >>>>> |
| SCA | ✅ SUCCESS | >>>>> |


compile


流水线任务触发成功
任务链接 [c108b9a860f043f7895c600876a0d992][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| Compile_Ascend_X86_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Pre | ✅ SUCCESS | >>>>> | |
| pre_comment | ✅ SUCCESS | >>>>> | |
| Compile_Ascend_X86 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_mobile_station_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_X86_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_single_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_experimental_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_Ascend_ARM_950_ubuntu24 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910b | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_910c | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_X86_monitor_950 | ✅ SUCCESS | >>>>> | >>>>> |
| Compile_classify | ✅ SUCCESS | >>>>> | |
| UT_Test_ophost | ✅ SUCCESS | ||
| UT_Test_opapi | ✅ SUCCESS | ||
| UT_Test_kernel | ✅ SUCCESS | ||
| UT_Test_opgraph | ✅ SUCCESS | ||
| PreSmoke_A900 | ✅ SUCCESS | >>>>> | |
| API_Check | ✅ SUCCESS | >>>>> | |
| PreSmoke_ATK_Test_A2 | ✅ SUCCESS | >>>>> | |
| UT_Test_harmony-infer-chs-nn | ✅ SUCCESS | ||
| UT_Test_report_lcov | ⚠️ WARNING | >>>>> |
[2026-07-15 14:59:23] CI执行结束


流水线任务触发成功
任务链接 [7090e2df1b8c448fa2564588ea7c1c72][流水线指导]
| 任务名称 | 状态 | 日志 | 下载链接 |
|---|---|---|---|
| codecheck | ✅ SUCCESS | >>>>> | |
| antipoison | ✅ SUCCESS | >>>>> | |
| codecheck_checkpr | ✅ SUCCESS | ||
| StaticCheck_codespell | ✅ SUCCESS | ||
| StaticCheck_link_validity | ✅ SUCCESS | ||
| StaticCheck_resource_existence | ✅ SUCCESS | ||
| StaticCheck_tag_closed | ✅ SUCCESS | ||
| StaticCheck_markdownlint | ✅ SUCCESS | ||
| codecheck_style | ✅ SUCCESS | >>>>> | |
| codecheck_precommit | ✅ SUCCESS | >>>>> | |
| SCA | ✅ SUCCESS | >>>>> |
[2026-07-15 14:13:18] CI执行结束


/check-pr


The following labels are not ready.
lgtm: Please wait for reviewers to review the code.
approved: Please wait for committers to review the code.


/lgtm
/approve


/lgtm
/approve


描述
Summary
为本 PR 增加 MatMulV3 AL1 全载 + 单核切 K 模板(tilingKey 65569),面向 M 小、K/N 大 场景,通过核内 K 条带复用 L1 上的 A,降低左矩阵重复搬入量。同期包含 CopyInAL1 未初始化读修复,以及 block 参数结构体字段排布调整。
背景与收益
在
M较小、K/N较大时,基本块平铺会使左矩阵 A 随 N 的切分被反复从 GM 搬入。baseN总块数)均分给各 AIC;相对基本块平铺,数据搬入量(设计目标)对比:
左矩阵 A 的重复搬入从约
ceil(N/nTile)次降为至多numCore次量级,缓解带宽瓶颈。算法流程
1. 准入与分核(Host Tiling)
准入(摘要)(
IsSupportSingleCoreSplitKAL1FullLoad):M ≤ 256;分核:
nCnt = ceil(N / baseN),usedCoreNum = min(nCnt, aicNum);curCoreN。基本块与 L1:
baseM = CeilAlign(M, 16),baseN/baseK在 L0A/L0B/L0C 约束下搜索优选;stepKa * baseK为 AL1 满载 K 条带尺寸;stepN/depthA1/depthB1在 L1 容量内选择,溢出时回退调小stepKa/stepN。输出 tilingKey:
LOADMODE=AL1_FULLLOAD+SPLITCOREMODE=SINGLE_CORE_SPLIT_K→ 65569。2. 核内计算(Device Kernel)
伪代码(与详设一致,K 外、本核 N 内):
要点:
TSCM(A_TYPE_NEW),MatmulImpl从 L1 取 A;stepKa*baseK >= Ka)且输出非 fp32:可 直接写 C GM(directOutput),跳过 fp32 workspace + vector cast;Cast32to16到输出(fp16/bf16)。3. 算法实现模块
op_host/op_tiling/matmul_v3_sc_splitk_al1_fullload_tiling.{h,cpp}matmul_v3_base_tiling.cpp/.hDoSingleCoreSplitKAL1FullLoadTiling接入选型链op_kernel/mat_mul_sc_splitk_al1_fullload_block.hCalcGMOffsetop_kernel/mat_mul_sc_splitk_al1_fullload_kernel.hmat_mul_v3.cpp+mat_mul_v3_tiling_key.h后续两笔修复(纳入本 PR)
CopyInAL1 未初始化读
Nd2Nz的nValue/dValue若使用baseM,在M < baseM时会多读行 → 内存检测报 GM 未初始化读。修复:ND 路径按真实
matmulTiling.M设置nDim/dDim(与 AL1 全载模板CopyInA1一致);K 维仍用currentKBlockSize。BlockArgs 字段排布
将
isHf32、转置标志、atomicAddFlag、isSingleKStrip等较小字段移到结构体尾部,便于对齐与后续扩展(无改语义)。关联的Issue
测试
文档更新
类型标签
AI/Agent生成声明