intel / intel/torch-xpu-ops

[Bug Skip]: torch.OutOfMemoryError: XPU out of memory

Open
#2,392 0 comments 0 reactions 0 assignees View on GitHub
os: Windows skipped_windows
Dominant language
Python
Stars
113
Forks
128
Avg merge
5d 9h
Merged PRs (30d)
112

Description

### 🐛 Describe the bug with skip template

Cases:
test_xpu,test.test_xpu.TestXpu,test_set_per_process_memory_fraction

```
________________ TestXpu.test_set_per_process_memory_fraction _________________
Traceback (most recent call last):
File "C:\actions-runner\_work\torch-xpu-ops\pytorch\test\test_xpu.py", line 457, in test_set_per_process_memory_fraction
tensor = torch.empty(application_memory, dtype=torch.int8, device="xpu")
torch.OutOfMemoryError: XPU out of memory. Tried to allocate 8.11 GiB. GPU 0 has a total capacity of 16.54 GiB of which 16.54 GiB is free. 8.27 GiB allowed; Of the allocated memory 0 bytes is allocated by PyTorch, and 0 bytes is reserved by PyTorch but unallocated. Please use `empty_cache` to release all unoccupied cached memory.

To execute this test, run the following from the base repo dir:
python test\test_xpu.py TestXpu.test_set_per_process_memory_fraction

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
- generated xml file: C:\actions-runner\_work\torch-xpu-ops\pytorch\third_party\torch-xpu-ops\test\xpu\test_xpu.xml -
=========================== short test summary info ===========================
FAILED [0.0956s] test_xpu.py::TestXpu::test_set_per_process_memory_fraction - torch.OutOfMemoryError: XPU out of memory. Tried to allocate 8.11 GiB. GPU 0 has a total capacity of 16.54 GiB of which 16.54 GiB is free. 8.27 GiB allowed; Of the allocated memory 0 bytes is allocated by PyTorch, and 0 bytes is reserved by PyTorch but unallocated. Please use `empty_cache` to release all unoccupied cached memory.

To execute this test, run the following from the base repo dir:
python test\test_xpu.py TestXpu.test_set_per_process_memory_fraction

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```

### Versions

main branch

Contributor guide

Open the contributing guide

Research direction

Start with test/test_xpu.py, especially TestXpu.test_set_per_process_memory_fraction, and reproduce it using the command shown in the issue. Investigate why the allocation exceeds the configured XPU memory fraction; done means the test completes without the reported torch.OutOfMemoryError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.