Closed
[Bug-Report|缺陷反馈]: LpNormUpdateV2 Tiling/Golden 与文档一致性修复 #8409
吴成文Add on  13 days agoClosed at  13 days ago
吴成文
吴成文Collaborators
13 days ago Create

Describe the current behavior / 问题描述

LpNormUpdateV2 已修复以下问题:

  1. FP16 epsilon=0 被错误提升到 1e-7,与 TBE 的 epsilon=0 语义不一致。
  2. sqrt 分支 p 判定使用 numpy.isclose 默认阈值,导致 p=2.00001 等值走 sqrt,而 TBE 走 pow。
  3. dim0 * minDtypeBits 在大 shape 下存在 int64 溢出风险,可能得到错误的 coreNum。
  4. shape 负维和元素数溢出未显式拒绝,可能继续进入 Tiling。
  5. 两份 Golden 实现和精度标准不一致:一份使用 numpy、一份使用 torch,且存在 p=NaN、±2^31、epsilon 特殊值、tolerance 和 third_party 入口不一致。
  6. GEIR 示例存在临时缓冲泄漏、fopen/Session 空指针未检查、失败路径未 GEFinalize、输出不一致仍返回成功。
  7. README/op_list 对负值、p=NaN、epsilon、ACLNN 支持情况和英文版本描述不一致。

Environment Information / 环境信息

  • 昇腾硬件型号:Ascend 950PR
  • CANN 版本:9.3.0
  • Python 版本:3.12
  • TTK:5b90935e

Steps to reproduce the issue / 重现步骤

  1. 默认构建 Host UT(不带 --soc=ascend950)时,Tiling UT 出现 11 个 GRAPH_FAILED。
  2. 在 p=2.00001 场景比较 kernel 与 TBE 分支:kernel 走 sqrt,TBE 走 pow。
  3. 使用大 shape 检查 coreNum 计算路径。
  4. 分别加载两份 Golden 检查 p=NaN、±2^31、epsilon 特殊值和 tolerance 行为。
  5. 运行 GEIR 示例并检查内存释放、失败路径和返回值。

Describe the expected behavior / 预期结果

  1. FP16 epsilon=0 保持 0。
  2. sqrt 阈值与 TBE 的 Python math.isclose 默认参数一致。
  3. 大 shape 的 coreNum 计算不发生溢出。
  4. 负维和元素数溢出显式返回失败。
  5. 两份 Golden 逐字一致,统一使用 torch 和 TTK 默认精度标准。
  6. GEIR 示例正确处理资源释放、空指针、失败清理和输出校验。
  7. README 与算子实际契约一致,中英文同步。

修复和验证记录见 PR:https://gitcode.com/cann/ops-nn/merge_requests/13734

Special notes for this issue/备注

对应修复 PR:https://gitcode.com/cann/ops-nn/merge_requests/13734

likedislike
吴成文吴成文Collaborators
13 days ago Added label: bug-report
yuning_chenyuning_chenCollaborators
13 days ago Assign wuchengwen_oh as responsible person
CANN-robotCANN-robotCollaborators
13 days ago Close issue
CANN-robotCANN-robotCollaborators
13 days ago changed custom state from 待办的 to 已完成
CANN-robotCANN-robotCollaborators
11 days ago Added label: resolved