Closed
[Bug-Report|缺陷反馈]: InplaceApplyCenteredRMSProp/PowerSign 合规质量整改(标量校验缺失、TQUE缓冲超限、golden精度、资源释放) #8583
tan_xinAdd on  11 days agoClosed at  10 days ago
tan_xin
tan_xinCollaborators
11 days ago Create

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

对 InplaceApplyCenteredRMSProp 与 InplaceApplyPowerSign 的合规质量检查发现以下问题:
InplaceApplyCenteredRMSProp:

  1. 标量输入 lr/rho/momentum/epsilon 无任何校验:多元素标量静默取首元素、混合 dtype 在 kernel GM 回退路径按 var dtype 误读,静默交付错误结果。
  2. VECIN 位置 5 个输入队列均为双缓冲,峰值 5×2=10 块,超过 A5 已知上限 8。
  3. golden 与 kernel 同精度镜像算术,|grad|>sqrt(FLT_MAX) 时 grad² 上溢与 kernel 同错被比较掩盖;缺少 spec 与三方交叉校验。

InplaceApplyPowerSign:
4. README 中 lr/logbase/sign_decay/beta 仅描述 [1] scalar,未覆盖 0-D([]);缺少动态 Shape/Rank 支持说明。
5. 示例 GenOnesDataFloat32/GenOnesData 未判空、未释放临时数据;Session::AddGraph 失败无错误处理且 session 未释放(内存泄漏)。

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

  • 昇腾硬件型号:ascend950 / ascend350(以两个算子 def.cpp 注册为准)
  • CANN 版本:CANN 社区版
  • Python 版本:golden.py 依赖 torch / tensorflow(lazy import)

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

  1. 传入 lr/rho/momentum/epsilon 为多元素张量或 dtype 与 var 不一致,tiling 不报错,结果错误。
  2. 在 ascend950/arch35 上编译运行 centered_rms_prop kernel,触发 VECIN 双缓冲块数超限告警/失败。
  3. 构造 |grad| 极大输入,kernel 与旧 golden 同精度上溢,比较仍 PASS,掩盖错误。
  4. 运行 inplace_apply_power_sign 示例,AddGraph 失败或数据分配后检查资源释放/泄漏。

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

  1. 标量输入 rank>1、元素数≠1 或 dtype 与 var 不一致时返回 GRAPH_FAILED。
  2. VECIN 同位置缓冲块数 ≤8。
  3. golden 在 float64 高精度域独立计算并 round,三方交叉校验(torch/TF)可判定,上溢错误能被检出。
  4. README 约束与实际支持(0-D/[1]、动态 Shape/Rank)一致;示例失败路径正确清理并释放资源。

静态检查/质量规则报告:CODE.04/GEIR.02/03/07/ROUTE.05(标量校验缺失)、TQUE.01(缓冲块数超限)、GOLDEN.01/05/07/13(golden 精度与三方校验)、示例内存泄漏与分配失败未处理。

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

关联 PR:https://gitcode.com/cann/ops-nn/pull/14077

likedislike
tan_xintan_xinCollaborators
11 days ago Added label: bug-report
tan_xin
tan_xinCollaborators
11 days ago Comments:

/assign @tan_xin

likedislike
yuning_chenyuning_chenCollaborators
11 days ago Assign tan_xin as responsible person
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