Closed
[Bug-Report|缺陷反馈]: CMCT block_mmad_mx GM2L1搬运未按平台宏隔离预分配参数 #8041
wangzitaoAdd on  18 days agoClosed at  10 days ago
wangzitao
wangzitaoCollaborators
18 days ago Create

Describe the current behavior / 问题描述 (Mandatory / 必填)

matmul/common/cmct/block/block_mmad_mx.h 中 GM2L1 的 AscendC::DataCopy / AscendC::DataCopyPad 直接传入预分配参数 enablePreReadIgnoreSync=true,未像 matmul/common/cmct/block/block_mmad_pertile.h 那样按平台宏隔离。

现状与风险:

  • asc-devkit 中该 4/5 参重载仅在 __NPU_ARCH__ == 9201/9202 上真正生效,其他架构(如 3510/5102/5162)虽声明但实现体为空;
  • 未隔离的调用依赖 asc-devkit 版本:若构建所用 asc-devkit 未在对应架构声明该重载,会导致编译失败;
  • 在非 9201/9202 架构上语义不明确,易被误认为已开启 MTE2 PreAllocation。

Environment Information / 环境信息 (Mandatory / 必填)

  • 昇腾硬件型号:Ascend 950/960 系列(DAV_3510/5102/5162/9201/9202)
  • CANN 版本:9.1.0
  • Python 版本:3.12

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. 打开 matmul/common/cmct/block/block_mmad_mx.h;
  2. 检索 AscendC::DataCopy(..., true) 与 AscendC::DataCopyPad(..., true);
  3. 对比 block_mmad_pertile.h 中 #if defined(__NPU_ARCH__) && (__NPU_ARCH__ == 9201 || __NPU_ARCH__ == 9202) 的隔离写法。

Describe the expected behavior / 预期结果 (Mandatory / 必填)

所有 GM2L1 预分配参数调用与 pertile 保持一致:9201/9202 传 true,其他架构使用无预分配参数的重载,保证跨平台编译与语义一致。

无(代码一致性/健壮性问题,非运行时故障)。

Special notes for this issue/备注 (Optional / 选填)

涉及 10 处调用:A/B、A/B Dn2Nz、WeightNz、Bias、ScaleA/ScaleB。

补充(同一 MR 一并修复):同文件中 HIF4/FP4 MTE1 补搬路径在 transA(或 !transB)且 ceil(curM/16) % B4_MIN_STEP != 0 时,会把 LoadData2DMxParams 的 step 字段清零后仍走带 scale 的 LoadData 重载,9202 上报 MTE1 m_step=0;现统一改为无 scale 的 LoadData 重载,scale 由首条指令按整个 curKL0 窗口搬运。

likedislike
wangzitaowangzitaoCollaborators
18 days ago Added label: bug-report
wangzitaowangzitaoCollaborators
18 days ago Associated pull request
wangzitao
wangzitaoCollaborators
18 days ago Comments:
yuning_chenyuning_chenCollaborators
18 days ago Assign wangzitao_leo as responsible person
wangzitaowangzitaoCollaborators
12 days ago Modify description of issue
CANN-robotCANN-robotCollaborators
10 days ago Close issue
CANN-robotCANN-robotCollaborators
10 days ago changed custom state from 进行中 to 已完成
CANN-robotCANN-robotCollaborators
9 days ago Added label: resolved