intel / intel/torch-xpu-ops

[upstream_ut] test_grad_scaling_state_dict_xpu: _scale is not torch.FloatTensor on XPU

Open
#5,375 0 comments 0 reactions 1 assignee Claimed by @pponikox View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.