Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/186793
Note: Links to docs will display an error until the docs builds have been completed. ❌ 7 New Failures, 2 Unrelated Failures, 8 Unclassified FailuresAs of commit 07900bf with merge base e9ff322 ( NEW FAILURES - The following jobs have failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@claude please review this PR. |
|
Claude finished @xuhancn's task in 7m 28s —— View job Review: XPU tensor multiprocessing support via CPU copy fallbackI read 🔴 1. Empty tensors crash — this is the failing
|
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
1cb2081 to
f76801f
Compare
|
@claude please review this PR. |
|
Claude finished @xuhancn's task in 2m 27s —— View job Re-review: XPU tensor multiprocessing (after the two fixes)I re-read ✅ Resolved from last review
🔴 Critical: shared-memory mutation tests will fail for XPU
This isn't hypothetical — these are device-generic and run on the XPU CI image. Before this PR they errored (no XPU sharing at all); after it they'll assert-fail instead. The copy semantics you correctly documented in the Recommendation: explicitly skip the shared-mutation tests for XPU (e.g. a # value survives the round-trip (copy semantics: no shared mutation)
t = torch.arange(25., device="xpu").view(5, 5)
q = ctx.Queue(); q.put(t)
self.assertEqual(q.get().cpu(), t.cpu())Add an empty-tensor and a bf16 case there too, so bugs #1/#2 stay regression-covered. Add XPU skips + copy-semantics tests → 🟡 Minor
CI status
Summary: the serialization mechanics are now correct (empty + bf16 fixed). The remaining blocker is test-semantics: the inherited shared-memory tests can't pass under a copy fallback, so they need XPU skips plus value-round-trip coverage. Happy to implement the test changes if you'd like — just say the word. |
|
@claude please review this issue. |
|
Claude finished @xuhancn's task in 1m 17s —— View job Review: XPU tensor multiprocessing via CPU copy fallback
No new commits since my last pass (HEAD is still ✅ Serialization mechanics are correct
🔴 Still the blocker: inherited shared-memory tests can't pass under a copy
Before this PR these errored (no XPU sharing at all); after it they'll assert-fail instead. This directly contradicts the copy semantics correctly documented in the Recommendation: guard the shared-mutation tests for XPU ( # copy semantics: value survives the round-trip, no shared mutation
for t in (
torch.arange(25., device="xpu").view(5, 5),
torch.tensor([], device="xpu"),
torch.randn(4, device="xpu", dtype=torch.bfloat16),
):
q = ctx.Queue(); q.put(t)
self.assertEqual(q.get().cpu(), t.cpu())Add XPU skips + copy-semantics tests → 🟡 Minor
CI
Summary: serialization is correct (empty + bf16 fixed). The one remaining blocker is test semantics — the inherited shared-memory tests can't pass under a copy fallback, so they need XPU skips plus value-round-trip coverage. Happy to implement the test changes if you'd like — just say the word. |
|
@claude please review latest code. |
|
Claude finished @xuhancn's task in 1m 13s —— View job Review: XPU tensor multiprocessing via CPU copy fallback
HEAD is still ✅ Serialization mechanics are correct
The core send/rebuild logic is sound and the docstring correctly documents the copy-vs-shared semantics. 🔴 Still the blocker: inherited shared-memory tests can't pass under a copy
These are device-generic and run on the XPU CI image. Before this PR they errored (no XPU sharing); after it they'll assert-fail. Tests that only check Recommendation: guard the shared-mutation tests for XPU and add value-round-trip coverage instead — including empty and bf16 cases so bugs #1/#2 stay regression-covered: def test_simple_sharing(self, device):
if torch.device(device).type == "xpu":
self.skipTest("XPU uses a copy fallback; cross-process mutation is not visible")
...# copy semantics: value survives the round-trip, no shared mutation
for t in (
torch.arange(25., device="xpu").view(5, 5),
torch.tensor([], device="xpu"),
torch.randn(4, device="xpu", dtype=torch.bfloat16),
):
q = ctx.Queue(); q.put(t)
self.assertEqual(q.get().cpu(), t.cpu())Add XPU skips + copy-semantics tests → 🟡 Minor
CI
Summary: serialization is correct (empty + bf16 fixed). The one remaining blocker is unchanged — the inherited shared-memory tests can't pass under a copy fallback, so they need XPU skips plus value-round-trip coverage. Happy to implement the test changes if you'd like — just say the word. |
…orch#186793) - Add @skipIfXpu to test_simple_sharing, test_variable_sharing, test_parameter_sharing — these require GPU IPC for cross-process mutation visibility, which XPU currently lacks - Use bytearray() in torch.frombuffer to silence UserWarning - Specific # noqa: PYREFLY[102] instead of bare PYREFLY Root cause: XPU has no cudaIpcMemHandle equivalent. The PR's CPU copy fallback correctly preserves values but cannot share GPU memory between processes. Tracking: intel/torch-xpu-ops#4000
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
10fd849 to
6b511a2
Compare
…orch#186793) - Add @skipIfXpu to test_simple_sharing, test_variable_sharing, test_parameter_sharing — these require GPU IPC for cross-process mutation visibility, which XPU currently lacks - Use bytearray() in torch.frombuffer to silence UserWarning - Specific # noqa: PYREFLY[102] instead of bare PYREFLY Root cause: XPU has no cudaIpcMemHandle equivalent. The PR's CPU copy fallback correctly preserves values but cannot share GPU memory between processes. Tracking: intel/torch-xpu-ops#4000
|
@claude review it again. |
|
Claude finished @xuhancn's task in 47s —— View job Review: XPU tensor multiprocessing via CPU copy fallback
New commit ✅ Everything from prior reviews is addressed
🟢 Optional nits (non-blocking)
CIThe XPU shard is the signal that matters here; with the three mutation tests skipped, the previously-expected assert-failures should no longer appear. Any Summary: LGTM. Serialization mechanics are correct (empty + all dtypes), and the inherited shared-memory tests that can't pass under a copy fallback are now properly skipped with clear, tracked rationale. No remaining blockers from my side. |
guangyey
left a comment
There was a problem hiding this comment.
Let's disable the test suite here first and remove the CPU-copy fallback. The fallback silently breaks shared-tensor semantics — updates from another process won't be reflected in the parent, because each side ends up with its own CPU copy rather than aliasing the same XPU memory.
6b511a2 to
cf19845
Compare
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
…h#186585) XPU lacks IPC support (no cudaIpcMemHandle equivalent), so tensors cannot be shared across processes using CUDA-style IPC mechanisms. Previously, XPU tensors fell through to the generic reduce_tensor path which tries to pickle the storage using CPU shared memory methods (_share_fd_cpu_), which are hard-gated to CPU only. Fix: add an XPU branch in reduce_tensor that copies the tensor to CPU before serialization and adds rebuild_xpu_tensor to copy it back to XPU on the receiving end. This uses the same D2H/H2D copy approach that CUDA uses as a fallback when IPC is not available. Co-authored-by: Copilot <[email protected]>
…f fd-sharing The XPU tensor serialization path previously copied the tensor to CPU and passed the CPU storage object through pickle. Pickle would then trigger the standard CPU storage fd-sharing path (DupFd / SCM_RIGHTS / MapAllocator), which crashes in spawn child processes when ftruncate() returns EINVAL on the dup'd shm fd. Fix: Serialize the tensor data as raw bytes (via memoryview of the CPU storage) instead of passing a storage object. The receiving end reconstructs from the raw bytes using torch.frombuffer + view + reshape, then copies back to XPU. This completely avoids the fd-sharing path and the associated MapAllocator crash. Fixes the test_multiprocessing.py::TestMultiprocessingDeviceTypeXPU:: test_integer_parameter_serialization_xpu failure. Co-authored-by: Copilot <[email protected]>
…typedStorage The pyrefly type checker does not recognize UntypedStorage as a Buffer, causing a bad-argument-type error on memoryview(untyped_storage). Switch to cpu_tensor.numpy().tobytes() which avoids the type issue entirely while producing the same serialized bytes. Co-authored-by: Copilot <[email protected]>
Two blocking bugs from review: 1. rebuild_xpu_tensor crashed on empty tensors because torch.frombuffer rejects zero-length buffers. Special-case len(raw_bytes)==0 by constructing torch.empty() directly. 2. reduce_tensor used numpy().tobytes() which fails for bfloat16, float8, and complex32 (not supported by numpy). Use bytes(untyped_storage()) instead, which works for all dtypes. Also eliminates the dtype string round-trip by pickling torch.dtype directly, and trims the docstring to note the copy (not shared) semantics. Fixes test_empty_tensor_sharing_xpu_float32. Co-authored-by: Copilot <[email protected]>
…orch#186793) - Add @skipIfXpu to test_simple_sharing, test_variable_sharing, test_parameter_sharing — these require GPU IPC for cross-process mutation visibility, which XPU currently lacks - Use bytearray() in torch.frombuffer to silence UserWarning - Specific # noqa: PYREFLY[102] instead of bare PYREFLY Root cause: XPU has no cudaIpcMemHandle equivalent. The PR's CPU copy fallback correctly preserves values but cannot share GPU memory between processes. Tracking: intel/torch-xpu-ops#4000
Per code review: CPU-copy fallback silently breaks shared-tensor semantics — child-process mutations are not visible to the parent. Remove the XPU reduce/rebuild path and keep only the test-skip decorators until proper GPU IPC support exists. This reverts all XPU-specific code from reductions.py while retaining the @skipIfXpu decorators on the three cross-process mutation tests in test_multiprocessing.py.
|
Successfully rebased |
cf19845 to
07900bf
Compare
guangyey
left a comment
There was a problem hiding this comment.
According to @chuanqi129's comments, we should disable the test case suite. I added this fix in #187314, which could help validate it easily.
…187314) # Motivation When #184737 generalize `test_multiprocess.py`, it helps enable `TestMultiprocessingDeviceType` test on XPU. However, XPU doesn't support this test suite because lack of IPC support currently. So we would like to skip this test case and restore XPU CI to green. Fixes #186585 Code originates from #186793 Co-authored-by: @xuhancn Pull Request resolved: #187314 Approved by: https://github.com/EikanWang, https://github.com/atalman ghstack dependencies: #181233, #187137, #187232, #187306
|
Close as #187314 already handled it. |
…187416) Skip TestMultiprocessingDeviceType on XPU due to lack of IPC support (#187314) # Motivation When #184737 generalize `test_multiprocess.py`, it helps enable `TestMultiprocessingDeviceType` test on XPU. However, XPU doesn't support this test suite because lack of IPC support currently. So we would like to skip this test case and restore XPU CI to green. Fixes #186585 Code originates from #186793 Co-authored-by: @xuhancn Pull Request resolved: #187314 Approved by: https://github.com/EikanWang, https://github.com/atalman ghstack dependencies: #181233, #187137, #187232, #187306 (cherry picked from commit 4f26a57) Co-authored-by: Yu, Guangye <[email protected]>
…ytorch#187314) # Motivation When pytorch#184737 generalize `test_multiprocess.py`, it helps enable `TestMultiprocessingDeviceType` test on XPU. However, XPU doesn't support this test suite because lack of IPC support currently. So we would like to skip this test case and restore XPU CI to green. Fixes pytorch#186585 Code originates from pytorch#186793 Co-authored-by: @xuhancn Pull Request resolved: pytorch#187314 Approved by: https://github.com/EikanWang, https://github.com/atalman ghstack dependencies: pytorch#181233, pytorch#187137, pytorch#187232, pytorch#187306
…ytorch#187314) # Motivation When pytorch#184737 generalize `test_multiprocess.py`, it helps enable `TestMultiprocessingDeviceType` test on XPU. However, XPU doesn't support this test suite because lack of IPC support currently. So we would like to skip this test case and restore XPU CI to green. Fixes pytorch#186585 Code originates from pytorch#186793 Co-authored-by: @xuhancn Pull Request resolved: pytorch#187314 Approved by: https://github.com/EikanWang, https://github.com/atalman ghstack dependencies: pytorch#181233, pytorch#187137, pytorch#187232, pytorch#187306
Fixes #186585
Summary
Disable multiprocessing tests that require XPU GPU IPC (not yet available).
XPU lacks a cudaIpcMemHandle equivalent, so tensor serialization across
processes is unimplemented.
A CPU-copy fallback was explored but rejected — it silently breaks
shared-tensor semantics since child-process mutations are not visible
to the parent.
Tests skipped
These tests also skip on ROCm for the same reason.
Tracker: intel/torch-xpu-ops#4000