`TestRsampleDeviceXPU.test_dirichlet_tangent_field_xpu` fails on XPU
- Dominant language
- Python
- Stars
- 113
- Forks
- 128
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 112
Description
### 🐛 Describe the bug
The PR https://github.com/pytorch/pytorch/pull/195730 enables `distributions/test_distributions.py` tests on XPU. One of the tests (previously only executed on CPU), i.e., `TestRsampleDeviceXPU.test_dirichlet_tangent_field_xpu` fails with the following error:
```
Traceback (most recent call last):
File "/usr/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
yield
File "/usr/lib/python3.12/unittest/case.py", line 634, in run
self._callTestMethod(testMethod)
File "/usr/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
if method() is not None:
^^^^^^^^
File "/home/gta/pytorch/torch/testing/_internal/common_utils.py", line 3886, in wrapper
method(*args, **kwargs)
File "/home/gta/pytorch/torch/testing/_internal/common_device_type.py", line 672, in instantiated_test
result = test(self, **param_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/home/gta/pytorch/test/distributions/test_distributions.py", line 4992, in test_dirichlet_tangent_field
self.assertLess(
File "/usr/lib/python3.12/unittest/case.py", line 1257, in assertLess
self.fail(self._formatMessage(msg, standardMsg))
File "/usr/lib/python3.12/unittest/case.py", line 715, in fail
raise self.failureException(msg)
AssertionError: tensor(0.0056, device='xpu:0', grad_fn=) not less than 0.005 : Dirichlet([0.5, 2.0, 2.0]) gradient violates continuity equation:
error = tensor([2.1804e-05, 2.2123e-05, 1.7490e-05, 2.1824e-05, 1.3951e-05, 1.5987e-05,
2.0360e-05, 1.4174e-05, 2.2190e-05, 5.6184e-06, 2.1874e-05, 6.1390e-07,
2.1539e-05, 1.6676e-05, 2.0351e-05, 3.7053e-07, 1.1294e-05, 2.0427e-05,
5.5737e-03, 1.9104e-05], device='xpu:0', grad_fn=)
```
### Versions
Pytorch: changes from https://github.com/pytorch/pytorch/pull/195730
torch-xpu-ops: main
Contributor guide
Research direction
Read test/distributions/test_distributions.py around test_dirichlet_tangent_field and run TestRsampleDeviceXPU.test_dirichlet_tangent_field_xpu to reproduce the XPU failure. Compare the reported continuity-equation error with the CPU behavior and trace the XPU-specific path; done means the named test passes on XPU under the stated versions without relaxing its assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100