已关闭
reduction Group 模板空 R 分组导致静默数值错误(reduce_std_v2_update / data_compare) #2867
andong_hw创建于  25 天前关闭于  23 天前
andong_hw成员
25 天前 创建

问题

reduction Group 模板(reduce_std_v2_update、data_compare)Phase1 用 rPerCore = CeilDiv(rOuter, rGroupCnt); rStart = rChunkIdx * rPerCore 截断分配 R chunk。CeilDiv 量化会造出空组(rStart >= rOuter 的核早退、不写 workspace 对应行),而 Phase 2 以 blockCount=rGroupCnt 全行 Reduce,把未写入的脏 GM 数据当 partial sum 读入,产生静默数值错误(已在 euclidean_norm 同类模板上实测复现:shape (11396,150) fp32 axes=[0],修复前 FAIL 修复后 PASS)。

修复

将截断分配替换为大小核式均匀分配(tiling 保证 rGroupCnt <= rOuter,每组 >=1 chunk,无空组):

  • math/reduce_std_v2_update/op_kernel/arch35/reduce_std_v2_update.h:Phase1Process 均匀分配,删除重复 rCount 计算
  • math/data_compare/op_kernel/arch35/data_compare.h:ProcessGroup 均匀分配,删除重复 rCount 计算

两个算子 kernel 均已编译验证通过(ascend950)。

likedislike
Aandong_hw成员
25 天前 关联了pull request:fix: group R 分组均匀分配修复空分组导致的静默数值错误
陈思
陈思成员
24 天前 评论:

/assign @andong_hw

likedislike
CANN-robotCANN-robot成员
24 天前 将 andong_hw 设为负责人
CANN-robotCANN-robot成员
23 天前 关闭了 issue
CANN-robotCANN-robot成员
23 天前 添加了label:resolved