intel / intel/torch-xpu-ops

[Bug Skip]: RuntimeError: _share_fd_: only available on CPU in test_dataloader_xpu.py

Open
#3,000 0 comments 0 reactions 1 assignee Claimed by @gplutop7 View on GitHub
skipped test: ut
Dominant language
Python
Stars
113
Forks
128
Avg merge
5d 13h
Merged PRs (30d)
107

Description

### 🐛 Describe the bug

Cases:
op_ut,third_party.torch-xpu-ops.test.xpu.test_dataloader_xpu.TestDataLoaderDeviceTypeXPU,test_nested_tensor_multiprocessing_context_forkserver_xpu
op_ut,third_party.torch-xpu-ops.test.xpu.test_dataloader_xpu.TestDataLoaderDeviceTypeXPU,test_nested_tensor_multiprocessing_context_spawn_xpu

```
pytest -v ‎test/xpu/test_dataloader_xpu.py::TestDataLoaderDeviceTypeXPU::test_nested_tensor_multiprocessing_context_forkserver_xpu
pytest -v ‎test/xpu/test_dataloader_xpu.py::TestDataLoaderDeviceTypeXPU::test_nested_tensor_multiprocessing_context_spawn_xpu
```
```
2026-03-06T06:38:01.6708229Z =================================== FAILURES ===================================
2026-03-06T06:38:01.6708732Z _ TestDataLoaderDeviceTypeXPU.test_nested_tensor_multiprocessing_context_forkserver_xpu _
2026-03-06T06:38:01.6709253Z [gw6] linux -- Python 3.10.20 /tmp/xpu-tool/Python/3.10.20/x64/bin/python
2026-03-06T06:38:01.6709611Z Traceback (most recent call last):
2026-03-06T06:38:01.6714037Z File "/__w/torch-xpu-ops/torch-xpu-ops/pytorch/third_party/torch-xpu-ops/test/xpu/test_dataloader_xpu.py", line 223, in nested_tensor_multiprocessing
2026-03-06T06:38:01.6714777Z for i, batch in enumerate(loader):
2026-03-06T06:38:01.6715316Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 500, in __iter__
2026-03-06T06:38:01.6715829Z return self._get_iterator()
2026-03-06T06:38:01.6716341Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 433, in _get_iterator
2026-03-06T06:38:01.6716888Z return _MultiProcessingDataLoaderIter(self)
2026-03-06T06:38:01.6717433Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1192, in __init__
2026-03-06T06:38:01.6717916Z w.start()
2026-03-06T06:38:01.6718294Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/multiprocessing/process.py", line 121, in start
2026-03-06T06:38:01.6718737Z self._popen = self._Popen(self)
2026-03-06T06:38:01.6719166Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/multiprocessing/context.py", line 300, in _Popen
2026-03-06T06:38:01.6719708Z return Popen(process_obj)
2026-03-06T06:38:01.6720107Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/multiprocessing/popen_forkserver.py", line 35, in __init__
2026-03-06T06:38:01.6720515Z super().__init__(process_obj)
2026-03-06T06:38:01.6720903Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
2026-03-06T06:38:01.6721298Z self._launch(process_obj)
2026-03-06T06:38:01.6721692Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/multiprocessing/popen_forkserver.py", line 47, in _launch
2026-03-06T06:38:01.6722098Z reduction.dump(process_obj, buf)
2026-03-06T06:38:01.6722483Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/multiprocessing/reduction.py", line 60, in dump
2026-03-06T06:38:01.6722895Z ForkingPickler(file, protocol).dump(obj)
2026-03-06T06:38:01.6723381Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/site-packages/torch/multiprocessing/reductions.py", line 615, in reduce_storage
2026-03-06T06:38:01.6723861Z fd, size = storage._share_fd_cpu_()
2026-03-06T06:38:01.6724258Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/site-packages/torch/storage.py", line 449, in wrapper
2026-03-06T06:38:01.6724647Z return fn(self, *args, **kwargs)
2026-03-06T06:38:01.6725058Z File "/tmp/xpu-tool/Python/3.10.20/x64/lib/python3.10/site-packages/torch/storage.py", line 527, in _share_fd_cpu_
2026-03-06T06:38:01.6725568Z return super()._share_fd_cpu_(*args, **kwargs)
2026-03-06T06:38:01.6725858Z RuntimeError: _share_fd_: only available on CPU
```

### Versions

https://github.com/intel/torch-xpu-ops/pull/2989

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.