Repository navigation
[XPU] Run the remaining move_to_device_pass tests on all accelerators - #204608
tszulist-hbn wants to merge 2 commits into
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Findings (1): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/204608
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit cb7da33 with merge base a8ff086 ( FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following job failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchmergebot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
24c2d7f to
6501c2f
Compare
|
|
|
@pytorchmergebot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
|
Successfully rebased |
6501c2f to
f5d23d8
Compare
|
@etaf, when you have a chance, could you please take a look at this. Thanks! |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
…NERIC test_move_to_device_pass_interpreter_only_graph moves an exported program to the meta device and needs no accelerator, but it sits in TestMoveToDevicePassCuda (hw_classification = CUDA) next to the CUDA-gated move_to_device_pass tests. Move it to TestPasses (GENERIC). The body is unchanged. Its method-level skipIf(IS_MACOS, ...) is dropped because TestPasses carries the same skip at class level. CUDA/ROCm jobs exclude GENERIC classes (.ci/pytorch/test.sh), so the test now runs on CPU and XPU jobs and no longer on CUDA ones. Test Plan: An AST comparison of every test-class method, decorators included, between the parent and this commit reports one move (TestMoveToDevicePassCuda -> TestPasses, IS_MACOS skip dropped) and 43 methods unchanged. On an Intel Data Center GPU Max 1550: ``` python test/export/test_passes.py -v --hw-classification GENERIC -k interpreter_only_graph python test/export/test_passes.py ``` The first run selects and passes the moved test (total=1, passed=1, unclassified=0). The whole file reports the same 39 tests and OK (skipped=4, expected failures=2) before and after. Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rators Four move_to_device_pass tests sat in TestMoveToDevicePassCuda behind skipIf(not TEST_CUDA) with "cuda:0" hard-coded, so XPU and other accelerators skipped them. Nothing in them is CUDA-specific. They check that the moved GraphModule and its nested torch.cond submodules are recompiled, that the source module's parameters and buffers are not mutated, and that wrapper-subclass parameters move with their inner tensors. Root cause: pytorch#185105 added the tests behind a TEST_CUDA gate. pytorch#196974 moved the four older move_to_device_pass tests into the device-generic TestMoveToDevicePassDevice but left these behind, and pytorch#191079 then tagged their class CUDA to match its gate. Move them into TestMoveToDevicePassDevice with a device parameter, drop the gates and replace each "cuda:0" with device. The instantiated primary device always carries an index (cuda:N, xpu:N, <privateuse1>:N), so the code and device-equality assertions behave as before on CUDA. After the previous commit the CUDA class is empty, so delete it and the now-unused TEST_CUDA import. XPU, PrivateUse1 and HPU gain the four tests. CUDA keeps them as TestMoveToDevicePassDeviceCUDA::<name>_cuda. On a machine without an accelerator they are no longer collected instead of being reported as skipped, the same trade-off pytorch#196974 made. Widening the gate to TEST_CUDA or TEST_XPU was the alternative; it keeps the hard-coded device and leaves PrivateUse1 out. See intel/torch-xpu-ops#5994. Test Plan: The same AST comparison as the previous commit: the four methods match the originals once device maps back to 'cuda:0' and the device parameter and TEST_CUDA skip are dropped. The other 40 methods are unchanged. On an Intel Data Center GPU Max 1550: ``` python test/export/test_passes.py -v -k move_device -k move_to_device python test/export/test_passes.py ``` All 8 TestMoveToDevicePassDeviceXPU tests pass, 4 of them new. The whole file goes from OK (skipped=4, expected failures=2) to OK (expected failures=2) with the same 39 tests. The only ID changes are TestMoveToDevicePassCuda::<name> -> TestMoveToDevicePassDeviceXPU::<name>_xpu. CUDA was not run locally. Authored with an AI assistant (Claude Code). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Successfully rebased |
f5d23d8 to
cb7da33
Compare
There was a problem hiding this comment.
Automated review of cb7da33: nothing blocking; ready for human review.
The PR deletes TestMoveToDevicePassCuda, moving four tests into the ACCELERATOR class TestMoveToDevicePassDevice (using device) and the meta-only interpreter-only test into the GENERIC class TestPasses. Recommendation: Approve, with only one non-blocking point (a redundant setup call).
⚪ 1 non-blocking finding
pytorch/test/export/test_passes.py
Line 1588 in cb7da33
Redundant setup call (non-blocking): the moved test_move_to_device_pass_interpreter_only_graph still calls init_torchbind_implementations(). That call was needed in the old TestMoveToDevicePassCuda, which had no setUp. In TestPasses, setUp already makes the call (line 393), and the function returns early once initialized (torch/testing/_internal/torchbind_impls.py:13-23). It is now the only inline call in TestPasses, so the line can be dropped.
This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review
…tests on all accelerators) Authored with AI assistant (opencode).
|
@pytorchmergebot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Linked issue or supporting maintainer
Fixes intel/torch-xpu-ops#5994
BC-breaking?
No
Summary
move_to_device_passtests that were CUDA-only by decorator. CUDA keeps them under device-suffixed IDs. Test bodies are unchanged apart from"cuda:0"->device.test_move_to_device_pass_interpreter_only_graphuses onlymeta, so it is now a GENERIC test: it runs on CPU and XPU jobs, no longer on CUDA ones. Its macOS skip is covered by the identical class-level skip onTestPasses.🤖 Generated with Claude Code