Closed
[Bug-Report|缺陷反馈]: aclnnForeachAddListInplace golden 整型 alpha 经 fp32 导致输出塌成 INT32_MIN #8501
严明奎Add on 12 days agoClosed at 12 days ago
12 days ago Added label: bug-report
12 days ago Close issue
12 days ago changed custom state from 待办的 to 已完成
12 days ago Added label: resolved
Describe the current behavior / 问题描述
foreach_add_list_inplace 的 aclnn 通路 golden(
tests/assets/golden.py)在 int32 输入下,_tp_num将 alpha 转为float,torch 把 int32 张量列表类型提升为 float32;alpha*x2丢低位/溢出,最终.to(int32)截断,输出整片变成INT32_MIN(-2147483648),与 NPU 实际输出和算子设计(int32 直接整数运算)均不符。Environment Information / 环境信息
Steps to reproduce the issue / 重现步骤
Describe the expected behavior / 预期结果
golden 应按 int32 的 2's-complement 回绕语义计算,与 NPU 和竞品 torch 整型结果逐位一致。
Related log / screenshot / 日志 / 截图
Special notes for this issue/备注
关联 PR:https://gitcode.com/cann/ops-nn/merge_requests/13963