已关闭
[Bug-Report|缺陷反馈]: scatter_nd_add deterministic path maskLen consumed by UpdateMask causing incorrect results for multi-row cases #3662
陈展熹创建于  6月29日关闭于  6月30日
陈展熹成员
6月29日 创建

一、问题描述

scatter_nd_add 算子在确定性(deterministic)模式下,QuantizeForSumVf 和 InverseQuantizeVf 两个 SIMD VF 函数存在 mask 计算 bug。

AscendC::MicroAPI::UpdateMask 在每次调用时会消费(递减)maskLen 的值。原代码中 maskLen 作为函数参数传入,在内层循环中被 UpdateMask 消费后,外层行循环进入下一行时 maskLen 已变为 0 或残余值,导致后续所有行的 mask 设置错误。

当 rowLen > 1 时,只有第一行的量化/反量化结果正确,后续行全部因 mask 异常而产生错误结果。

二、环境信息

  • 硬件:Ascend 910B
  • 软件:CANN 9.1.0
  • 算子:scatter_nd_add(确定性模式)

三、重现步骤

  1. 使用确定性模式运行 scatter_nd_add 算子
  2. 构造 tiling data 使得 rowLen > 1
  3. 观察第二步量化和第三步反量化的输出,第二行及之后的行数据错误

四、预期结果

每行循环开始时 maskLen 应被重置为 afterAxis(或 colLen),确保所有行的 mask 设置正确,量化/反量化结果无误。

五、日志 / 截图

修复方案已提交,详见关联 PR:https://gitcode.com/cann/ops-nn/merge_requests/6712

六、备注

影响文件:index/scatter_nd_add/op_kernel/arch35/scatter_nd_add_determinstic.h

likedislike
陈展熹成员
6月29日 添加了label:bug-report
oscillatedoscillated成员
6月29日 将 yourealize 设为负责人
陈展熹成员
6月29日 关联了pull request:fix: reset maskLen per row in QuantizeForSumVf and InverseQuantizeVf
陈展熹成员
6月29日 评论:

已同步提交 9.1.0 分支修复 PR:https://gitcode.com/cann/ops-nn/merge_requests/6713

likedislike
Cchenqi317成员
6月29日 删除了关联的pull request:fix: reset maskLen per row in QuantizeForSumVf and InverseQuantizeVf
CANN-robotCANN-robot成员
6月30日 关闭了 issue
CANN-robotCANN-robot成员
6月30日 添加了label:resolved