Ascend/pytorch

[BUG] test/network_ops/test_apply_adam.py has nans in var_o for test_apply_adam_out_fp32

nrmer opened this issue · 1 comments

nrmer commented

For me the test case test_apply_adam_out_fp32 fails.
I'm using python 3.9.18 and torch / torch_npu 2.1.0.

The output for var_o is

tensor([[[[-0.1842, nan],
[ 0.4803, -0.3156]],
[[ 0.9466, nan],
[-0.1592, -0.1908]]],
[[[-0.9448, 0.6290],
[ 0.0694, 0.3411]],
[[-0.0987, 0.5370],
[-0.5744, 0.3317]]]], device='npu:0')

instead of

tensor([[[[-0.1842, 0.6028],
[0.4803, -0.3156]],
[[0.9466, -0.9984],
[-0.1592, -0.1908]]],
[[[-0.9448, 0.6290],
[0.0694, 0.3411]],
[[-0.0987, 0.5370],
[-0.5744, 0.3317]]]])

Note that all values apart from the nans are correct. If I disable the assert for the var_o the test passes.

The test cases can be passed on 910A. 910B supports IEEE754 standard, so Inf/NaN can be output correctly.We are fixing this test case.