已关闭
[Bug-Report|缺陷反馈]: 910B2 rms_norm算子精度问题 #4494
yangchao888创建于 8月3日关闭于 8月13日
yuning_chen
8月3日 评论:
8月3日 评论:
您好,感谢反馈,问题已收到,当前 @liujie12345678 正在跟踪处理。


yuning_chen
8月3日 评论:
8月3日 评论:
/assign @liujie12345678


8月3日 将 liujie12345678 设为负责人
8月8日 将 liuyun_nj 设为负责人
8月13日 关闭了 issue
8月13日 添加了label:resolved
Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
Describe the current behavior / 问题描述 (Mandatory / 必填)
910B2 rms_norm算子精度存在问题。
Environment / 环境信息 (Mandatory / 必填)
芯片型号:Ascend910B2
CANN 版本:9.0.0
CANN 版本详细信息:
从 /usr/local/Ascend/cann-9.0.0/opp/version.info 获取:
Version=9.0.0
version_dir=cann
required_package_runtime_version="9.0"
required_package_ge-executor_version="9.0"
required_package_metadef_version="9.0"
required_package_opbase_version="9.0"
required_package_bisheng-compiler_version="9.0"
required_package_tbe-tik_version="9.0"
timestamp=20260428_134817545
Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)
测试脚本:
m = 2**33 // 128
n = 128
x_shape = (m, n)
print("x_shape:", x_shape)
x = torch.randn(x_shape, dtype=torch.bfloat16).npu()
weight = torch.randn((n,), dtype=torch.bfloat16).npu()
y = torch_npu.npu_rms_norm(x, weight, 1e-5)
y = y[0]
pos = 4294969344
print("y[pos - 1]", y.reshape(-1)[pos - 1 :])
print("y[pos]", y.reshape(-1)[pos:])
x_shape: (67108864, 128)
y[pos - 1] tensor([-0.8242, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
device='npu:0', dtype=torch.bfloat16)
y[ps] tensor([0., 0., 0., ..., 0., 0., 0.], device='npu:0', dtype=torch.bfloat16)
测试结果:
从位置 4294969344 开始,输出为全0。
预期结果:
所有位置结果正确。
Describe the expected behavior / 预期结果 (Mandatory / 必填)
所有位置结果正确。
Related log / screenshot / 日志 / 截图 (Mandatory / 必填)
y[pos - 1] tensor([-0.8242, 0.0000, 0.0000, ..., 0.0000, 0.0000, 0.0000],
device='npu:0', dtype=torch.bfloat16)
y[pos] tensor([0., 0., 0., ..., 0., 0., 0.], device='npu:0', dtype=torch.bfloat16)
Special notes for this issue/备注 (Optional / 选填)