[release/2.14] [Bug Skip]: Skip failed test case torch-xpu-ops.test.xpu.test_cuda_multigpu_xpu.TestCudaMultiGPU.test_memory_stats
- Dominant language
- Python
- Stars
- 113
- Forks
- 128
- Avg merge
- 5d 9h
- Merged PRs (30d)
- 112
Description
### 🐛 Describe the bug with skip template
Get meory_stats return -1 on XPU.
## Affected Tests
Cases:
op_ut,third_party.torch-xpu-ops.test.xpu.test_cuda_multigpu_xpu.TestCudaMultiGPU,test_memory_stats
## Error Message
```
Traceback (most recent call last): File "/__w/torch-xpu-ops/torch-xpu-ops/pytorch/third_party/torch-xpu-ops/test/xpu/test_cuda_multigpu_xpu.py", line 327, in test_memory_stats for _ in self._test_memory_stats_generator(self): File "/__w/torch-xpu-ops/torch-xpu-ops/pytorch/third_party/torch-xpu-ops/test/xpu/test_cuda_multigpu_xpu.py", line 253, in _test_memory_stats_generator assert_change(0, empty_cache=True) File "/__w/torch-xpu-ops/torch-xpu-ops/pytorch/third_party/torch-xpu-ops/test/xpu/test_cuda_multigpu_xpu.py", line 185, in assert_change self.assertGreaterEqual(num_sync_1, 0) File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/unittest/case.py", line 1250, in assertGreaterEqual self.fail(self._formatMessage(msg, standardMsg)) File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/unittest/case.py", line 675, in fail raise self.failureException(msg) AssertionError: -1 not greater than or equal to 0 To execute this test, run the following from the base repo dir: PYTORCH_TEST_WITH_SLOW=1 python test/xpu/test_cuda_multigpu_xpu.py TestCudaMultiGPU.test_memory_stats This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```
## Test Code Snippet
```python
def test_memory_stats(self):
gc.collect()
torch.get_device_module(GPU_TYPE).empty_cache()
for _ in self._test_memory_stats_generator(self):
self._check_memory_stat_consistency()
```
### Test location
test\xpu\test_cuda_multigpu_xpu.py
```python
def test_external_streams(self):
device = torch.get_device_module(GPU_TYPE).device(0)
with self._get_external_stream(device) as stream_v:
```
test case failed at
```
if empty_cache:
num_sync_1 = (
torch.get_device_module(GPU_TYPE)
.memory_stats(device)
.get(stat_key_n_sync, -1)
)
self.assertGreaterEqual(num_sync_1, 0)
```
# TODO XPU PR
https://github.com/intel/torch-xpu-ops/pull/4294
### Versions
PyTorch: main 2.14.0a0
XPU Tests: torch-xpu-ops.test.xpu.test_cuda_multigpu_xpu.TestCudaMultiGPU.test_memory_stats
Contributor guide
Research direction
Start with test/xpu/test_cuda_multigpu_xpu.py and run PYTORCH_TEST_WITH_SLOW=1 python test/xpu/test_cuda_multigpu_xpu.py TestCudaMultiGPU.test_memory_stats to reproduce the failure. Review the related XPU PR #4294 and the memory_stats assertion; done means the reported test handling is resolved without this -1 failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100