已关闭
fix: reduction Group 模板空 R 分组导致静默数值错误 #5162
andong_hw创建于  14 天前关闭于  13 天前
andong_hw成员
14 天前 创建

问题

reduction Group 模板(A×R 2D 分核 Phase 1 → SyncAll → Phase 2 RA mini-kernel)Phase 1 用 rPerCore = CeilDiv(rOuter, rGroupCnt); rStart = rChunkIdx * rPerCore 截断分配 R chunk。当 tiling 算出的 rGroupCnt > rOuter 时产生空分组:rStart >= rOuter 的核早退、不写 workspace 对应行;而 Phase 2 以 blockCount = rGroupCnt 全行 Reduce,把未写入的脏 GM 数据当 partial sum 读入,导致静默数值错误。

已在 euclidean_norm 实测复现(shape (11396,150) fp32 axes=[0]):修复前 FAIL,修复后 PASS。

受影响算子(已确认)

  1. norm/euclidean_norm
  2. norm/bn_training_reduce(deterministic group 分支)
  3. quant/act_ulq_clamp_max_grad
  4. quant/act_ulq_clamp_min_grad

(norm/mvn_v2 的 rGroupCnt 仅作 2D 网格标记、无 workspace 行分组语义,不涉及本 bug。)

修复方案

Phase 1 的 R chunk 分配改为大小核式均匀分配(tiling 保证 rGroupCnt ≤ rOuter 恒成立,每组 ≥1 chunk,无空组),并保留防御性早退。修复见 PR #9221。

likedislike
Aandong_hw成员
14 天前 修改了issue 的描述
yuning_chenyuning_chen成员
14 天前 将 andong_hw 设为负责人
CANN-robotCANN-robot成员
13 天前 关闭了 issue
CANN-robotCANN-robot成员
13 天前 添加了label:resolved