Merged
修复不同M大小下,走A全载和单核切k不同模板影响一致性 #11060
修复不同M大小下,走A全载和单核切k不同模板影响一致性 #11060
Merged
林泽辉Add on Sep 22
林泽辉
林泽辉Collaborators
Sep 22

描述

修改一致性条件下走入单核切k的条件

关联的Issue

https://gitcode.com/cann/ops-nn/issues/6123

测试

验证single_shape_vs_batched_shape: exact=True, neq=0/37888, max_abs=0.0000000000e+00, mean_abs=0.0000000000e+00, rmse=0.0000000000e+00, max_index=0
一致性已保证达成

文档更新

类型标签

AI/Agent生成声明

likedislike
Pull Request has been successfully merged by CANN-robot.
(Thank you for 林泽辉's contribution.)
林泽辉林泽辉Collaborators
Sep 22 Created pull request, commit ed84d779
林泽辉林泽辉Collaborators
Sep 22 Associated issue: [Requirement|需求建议]: splitK添加一致性校验,保证二进制一致
atomgit-bot
atomgit-bot
Sep 22 Comments:

变更摘要

本 PR 修复在 matmul/mat_mul_v3/op_host/op_tiling/arch35 下,不同 M 大小场景走 A 全载与单核切 K 时因模板选择不一致导致的结果差异。核心改动是将 MatMulV3BasicAswtTiling::CheckFp32SplitK 由执行副作用(直接改写 model_)的 void 函数改为 const bool 判定函数,并在 DoOpTiling 中依据其返回值决定是否设置 model_ = MatMulV3Model::BASIC_SPLIT_K;同时在 CheckAL1FullLoad 与 CheckBL1FullLoad 中新增一致性条件下不支持核内切 K 的判定,使 A/B 全载路径与单核切 K 模板选择在确定性场景下保持一致。

主要改动

  • CheckFp32SplitK 改为纯判定接口: 函数签名由 void CheckFp32SplitK() 改为 bool CheckFp32SplitK() const,去掉原有对 model_ 的直接赋值,仅返回是否满足 FP32 切 K 条件。
  • 模型设置逻辑迁移到调用处: 在 DoOpTiling 中改为 if (CheckFp32SplitK()) { model_ = MatMulV3Model::BASIC_SPLIT_K; },由调用方统一决定模型,便于其他判定函数复用该结果。
  • CheckFp32SplitK 判定条件放宽: 移除 fullLoad_ == MatMulV3FullLoad::NONE_FULL_LOAD 限制,仅保留非 slice、FP32、非 HF32、ND 格式及 kValue 达阈值等条件。
  • A 全载新增一致性约束: CheckAL1FullLoad 开头新增判定,当 GetDeterministicLevel() > 1 且满足 CheckFp32SplitK() 时直接返回 false,即 batch 一致性下不支持 A 全载配合核内切 K。
  • B 全载新增一致性约束并修正日志: CheckBL1FullLoad 同样在一致性条件下禁用 B 全载;同时将原有 cubeBound 场景日志文案由 al1 full load 更正为 bl1 full load。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
Sep 22 Comments:

代码审查

✅ 未发现问题

likedislike
Incorrect?
CANN-robotCANN-robotCollaborators
Sep 22 Added label: stat/needs-squash
CANN-robotCANN-robotCollaborators
Sep 22 Added label: cann-cla/yes
CANN-robot
CANN-robotCollaborators
Sep 22 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
matmul ✅ 商晓波, 林鹏翔 (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

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

likedislike
CANN-robotCANN-robotCollaborators
Sep 22 Set zengjuan,oscillated,sxb154714,chaotang233,crystalhu,yangyang016,fanqirui,chenqi317,LinPX,liubo75,tangweiwei2,wangzitao_leo,xubinglin,zhaoyingchao2,rueenov11,pingchuantang,liuyang_806 as approver
CANN-robotCANN-robotCollaborators
Sep 22 Set oscillated,sxb154714,chaotang233,yangyang016,fanqirui,chenqi317,LinPX,tangweiwei2,wangzitao_leo,xubinglin,zhaoyingchao2,rueenov11,liuyang_806 as approver
林泽辉
林泽辉Collaborators
Sep 22 Comments:

compile

likedislike
林泽辉林泽辉Collaborators
Sep 22 Pre merge succeeded (commit_id: 0582ebd3097f7043b06ff0baceec461ae004d58b)
CANN-robot
CANN-robotCollaborators
Sep 22 Comments:
🚀 CI 流水线已启动
📋 执行详情: 点击查看流水线
likedislike
CANN-robotCANN-robotCollaborators
Sep 22 Added label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 22 Removed label: ci-pipeline-running
CANN-robotCANN-robotCollaborators
Sep 22 Added label: ci-pipeline-passed
yuning_chen
yuning_chenCollaborators
Sep 22 Comments:

您好,pr合入已准备就绪,请尽快联系committer进行检视,谢谢!

likedislike
sxb154714
sxb154714Collaborators
Sep 23 Comments:

/lgtm
/approve

likedislike
CANN-robotCANN-robotCollaborators
Sep 23 Added label: approved
林鹏翔
林鹏翔Collaborators
Sep 23 Comments:

/lgtm

likedislike
CANN-robotCANN-robotCollaborators
Sep 23 Added label: lgtm
CANN-robotCANN-robotCollaborators
Sep 23 Merged pull request
liuyang_806liuyang_806Collaborators
Oct 12 Deleted associated issue: [Requirement|需求建议]: splitK添加一致性校验,保证二进制一致
liuyang_806liuyang_806Collaborators
Oct 12 Associated issue: [Requirement|需求建议]: 算子新增支持 Batch 一致性