[upstream_ut] test_grad_scaling_state_dict_xpu: _scale is not torch.FloatTensor on XPU
Open
- Dominant language
- Python
- Stars
- 113
- Forks
- 128
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 112
Description
## Description
test_grad_scaling_state_dict_xpu in test/test_torch.py fails. The test asserts
that GradScaler._scale is a torch.FloatTensor, but on XPU the scale tensor is
not an instance of torch.FloatTensor (CPU float storage type).
## Error log
```
File "test/test_torch.py", line 5649, in test_grad_scaling_state_dict
self.assertTrue(isinstance(s1._scale, torch.FloatTensor))
AssertionError: False is not true
```
## Reproduce
```
python test/test_torch.py TestTorchDeviceTypeXPU.test_grad_scaling_state_dict_xpu
```
Contributor guide
Assessment
This issue has not been assessed yet.