Repository navigation
[Testcase Refactoring] Make test_smoke device-agnostic via instantiate_device_type_tests - #192434
gavinwang269 wants to merge 1 commit into
Conversation
✅ AUTOMATED REVIEW - Ready for human review:
Findings (2): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/192434
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit fa5b276 with merge base 113a303 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@pytorchbot label "module: tests/inductor" |
|
Didn't find following labels among repository labels: module: tests/inductor |
fe3adfd to
365950f
Compare
|
@claude review these changes |
|
Claude finished @jansel's task in 11m 7s —— View job ReviewThe refactor direction is reasonable, but as committed it does not actually accomplish the stated goal — the Detailed review of test/inductor/test_smoke.py1. Blocker: the
|
365950f to
cc16faa
Compare
|
"Thanks for the review! All points addressed in the latest push:\n\n1. main guard: Removed. Replaced with plain |
|
|
||
| instantiate_device_type_tests( | ||
| SmokeTestDevice, globals(), except_for="cpu", allow_xpu=True | ||
| ) |
There was a problem hiding this comment.
The class SmokeTest is missed in this Test case, which should be added.
There was a problem hiding this comment.
Thanks for the review! Added SmokeTest to instantiate_device_type_tests in the latest push (2ddc877).
Per the pattern established in #190173, GENERIC test classes are included in instantiate_device_type_tests alongside ACCELERATOR classes so that hw_classification filtering (--hw-classification GENERIC ACCELERATOR) works uniformly across all classes in the file. This is consistent with the existing usage in test_cpu_select_algorithm.py where GENERIC classes are also passed to instantiate_device_type_tests.
There was a problem hiding this comment.
My earlier reply pointed at 2ddc877, but that state passed two classes to instantiate_device_type_tests, which accepts one class plus the module scope, so the head keeps the call on SmokeTestDevice only (head db41907, lines 69-71). Upstream convention is that GENERIC classes stay out of device instantiation (test_debug_utils.py and test_foreach.py leave their generic classes plain), and the call also deletes the generic class from module scope, so wrapping SmokeTest would duplicate a device-free check on every accelerator base instead of adding coverage. SmokeTest itself carries hw_classification = HardwareClassification.GENERIC (head lines 30-31), which is what the runner-side classification consumes.
JiasenTian
left a comment
There was a problem hiding this comment.
Add Genertic and Accelerator classification for SmokeTest
f217e12 to
2ddc877
Compare
## Summary `test/inductor/test_smoke.py` gates its accelerator tests with `@unittest.skipIf(not HAS_GPU, ...)` and builds their tensors on the `GPU_TYPE` constant imported from `torch.testing/_internal/inductor_utils`. Both are resolved once, at import, from whichever device the process happened to initialise, so the file cannot say which device a test is about to exercise, and every host inherits the same answer. This change moves that decision into the framework's own mechanism. It touches two files: the test file, and its now-unneeded exemption in `tools/linter/adapters/test_linter_allowlist.json`. ## Changes - `SmokeTest` is split. The generic half keeps `test_compile_invalid_options`, which touches no device and stays a plain `TestCase`. The accelerator half becomes `SmokeTestDevice`, declared `HardwareClassification.ACCELERATOR` and instantiated with `instantiate_device_type_tests(..., globals(), except_for="cpu", allow_xpu=True)`, the form `test/inductor/test_selective_lowering.py:56` and `test/inductor/test_symm_mem_registry.py:440` already use. `only_for` is deliberately not used: `test/REVIEW.md` Rule 4 says "`only_for` must not be used" for ACCELERATOR classes, and it would also drop the PrivateUse1, HPU and `TORCH_TEST_DEVICES` bases that this PR's own motivation is about keeping. - Test bodies take `device` and construct their tensors there, inside the test methods; the `GPU_TYPE` import is gone, and no `if device == ...` branch appears. `test_mlp` registers `self.addCleanup(torch._logging.set_logs)` before enabling DEBUG logging, so a failure no longer leaks the log level into later tests in the same process. - The two accelerator tests are gated with `@requires_triton()`, as can-gaa-hou asked in pytorch#192434 (comment). Stated plainly: `requires_triton` is `functools.partial(unittest.skipIf, not HAS_TRITON, ...)` (`inductor_utils.py:202`), so like the `HAS_GPU` it replaces it is a process-wide boolean. This PR makes the instantiation per-device, not the gate. - The `test/inductor/test_smoke.py` row is deleted from `tools/linter/adapters/test_linter_allowlist.json` (Rule 7). That row was why `TEST_LINTER` stayed silent: with the row removed, the file is checked, and the check is demonstrably live -- see the negative control in the Test Plan. - The `__main__` block is left byte-identical to the base commit, including the `IS_LINUX and HAS_GPU` and `major <= 5` conditions. `run_test.py` invokes this file as a script, so that block decides which tests CI executes, and changing it is not this PR's to make. ## What CI executes Because `run_test.py` runs the file as `python test_smoke.py` (`test/run_test.py:687`), the unchanged `__main__` guard decides what each shard runs; the pytest invocations below are local measurements, not a CI path. Reading the guard against the sources, before and after this PR alike: - CUDA and ROCm shards: `HAS_CUDA_AND_TRITON` is true and the `major <= 5` disjunct is false on any Triton-capable GPU (`is_triton_capable` requires HIP or compute capability 7 or later, `torch/_dynamo/device_interface.py:433-441`), so `run_tests()` is never called: the instantiated CUDA classes are generated but not executed by CI. - CPU-only shards: `HAS_GPU` is false (`inductor_utils.py:82`), the script path runs nothing from this file. - Out-of-tree backends: upstream CI installs none, so no PrivateUse1 class is generated there at all; the NPU numbers below come from a local wheel on an Ascend 910B4 host. - XPU is the one accelerator whose shards would execute these bodies (`allow_xpu=True` plus `PYTORCH_TESTING_DEVICE_ONLY_FOR=xpu`, and the default shard suite keeps this file), but the xpu workflow only reacts to the `ciflow/xpu` label, `viable/strict`, its schedule, or manual dispatch (`.github/workflows/xpu.yml:4-14`). This PR does not carry that label, so no XPU test job has run on any of its heads (two older heads show an XPU build job only). A green `test_mlp_xpu` / `test_compile_decorator_xpu` result can therefore only come from a run triggered after adding `ciflow/xpu` (and approving the workflows, as for the other ciflow families of this fork PR). - fbcode/sandcastle hosts (an internal-build code read, not verifiable from OSS): `get_device_type_test_bases()` yields only the CPU base unless `IS_REMOTE_GPU` is set, and then the CUDA base only when ASAN, TSAN, UBSAN and MTIA are all off (`common_device_type.py:1028-1038`); with `except_for="cpu"` those hosts generate no device class at all. ## Known coverage change: MTIA `get_device_type_test_bases()` (`common_device_type.py:1023-1052`) has no MTIA base, so on an MTIA host `SmokeTestDevice` is not generated and `test_mlp` / `test_compile_decorator` stop running there, whereas base did run them (`HAS_GPU` includes `HAS_MTIA_AND_TRITON`, and `GPU_TYPE` resolved to `mtia`). That is a reading of the base sources, not a measurement: no MTIA hardware is available here. Keeping the coverage inside this file would break the rules it is being migrated under: `hw_classification` has exactly six members (`GENERIC`, `ACCELERATOR`, `CPU`, `CUDA`, `MPS`, `XPU`; `tools/linter/adapters/test_linter.py:105-111`), so Rule 2 cannot describe an MTIA class, and Rule 4 requires ACCELERATOR classes to be instantiated, which offers no MTIA base. The structural fix, an MTIA device test base, is a separate change. **This documented drop still needs the MTIA owners' explicit acceptance**: the question is open in the thread at pytorch#192434 (comment) (comment pytorch#192434 (comment)), unanswered since 2026-11-02, and nothing here assumes an answer. ## Out-of-tree results With `except_for="cpu"` the framework generates a PrivateUse1 class on a host that has an out-of-tree backend registered, and on this host two of its tests fail for reasons inside that backend: ``` test_compile_decorator_npu: TypeError: WrappedFunction.__init__() missing 2 required positional arguments: 'cudagraph_managed_input_rerecord_limit' and 'cudagraph_managed_input_rerecord_action' (raised at torch_npu/npu/_graph_tree.py:2527, from parameters the wheel's own torch/_inductor/cudagraph_trees.py:576-577 defines) test_mlp_npu: torch._inductor.exc.InductorError: TypeError: NPUPythonWrapperCodeGen._generate_extern_kernel_out_helper() got an unexpected keyword argument 'tunable_dyn_dims_mask' ``` Both are raised inside the out-of-tree backend's own wrapper codegen: its hooks predate the inductor APIs it now runs against. Upstream CI has no out-of-tree backend, so these do not gate this PR; they belong to the backend's own test configuration, whose documented mechanism is `PrivateUse1TestBase.set_test_configs(test_exclusions=...)` (`docs/source/accelerator/testing.md:74`). Adding an upstream per-device skip was rejected: the allowed device-specific skip decorators (`test/REVIEW.md:154-160`) are `@skipCPUIf`, `@skipCUDAIf`, `@skipXPUIf`, `@skipMPSIf` and the accelerator-aware `@skipIf` -- there is no out-of-tree entry -- and a bare `expectedFailure` would swallow any exception, not just these. ## Test Plan Two prebuilt wheel venvs, no source file overlaid onto site-packages, every run started from `/tmp` (from the repository root `python -m pytest` puts the source tree on `sys.path` and imports a `torch` with no built `version.py`, which fails for unrelated reasons). ```bash W=<worktree>/test/inductor/test_smoke.py # cpu wheel, out-of-tree backend autoloaded: 3 tests collected, 1 passed, 2 skipped # (the skips are SmokeTestDevicePRIVATEUSE1, reason "requires triton") env -u PYTHONPATH <cpu-python> -m pytest $W -q # cpu wheel, true CPU-only (TORCH_DEVICE_BACKEND_AUTOLOAD=0): 1 test collected, 1 passed # npu wheel, Ascend 910B4 (no CUDA/XPU present): 2 failed, 1 passed # (the two failures are the out-of-tree cases described above) lintrunner $W <worktree>/tools/linter/adapters/test_linter_allowlist.json # ok No lint issues. ``` Negative control, to show the linter claim is not vacuous. With the allowlist row deleted: ```bash <cpu-python> tools/linter/adapters/test_linter.py test/inductor/test_smoke.py # no findings # re-insert `only_for=("cuda", "xpu")` in the same file, same command: # {"name":"[only_for]","severity":"error","line":73,"description":"Test class # 'SmokeTestDevice' (ACCELERATOR): must not use only_for in # instantiate_device_type_tests; use except_for instead."} ``` ## Verification Report | State | Host | Collected | Passed | Failed | Skipped | |-------|------|-----------|--------|--------|---------| | this PR | CPU wheel, torch_npu autoloaded | 3 | 1 | 0 | 2 (`requires triton`) | | this PR | CPU wheel, `TORCH_DEVICE_BACKEND_AUTOLOAD=0` | 1 | 1 | 0 | 0 (no device class generated) | | this PR | NPU (Ascend 910B4, triton-ascend present) | 3 | 1 | 2 | 0 (backend-side failures above) | | Item | Version | |------|---------| | PyTorch (cpu and npu venvs) | 2.16.0.dev20261029+cpu | | torch_npu | 2.16.0.dev20261029+git737bb43 | | CANN | 9.2.0 | | Python | 3.12 | ## XPU execution The review asked for evidence that the converted device tests pass on Linux XPU. There is no such evidence available from this PR: `gh pr checks 192434` currently lists no job whose name contains `xpu` or `intel` (0 of 4 executed checks), even though the PR carries `ciflow/trunk` and `ciflow/inductor`. The CUDA and XPU variants are therefore asserted here to be *created and gated*, not executed; whether they pass belongs to a shard that has to be run by someone able to schedule it, and no change to this file can produce that evidence. | Hardware | Ascend 910B4 (no CUDA/XPU present) |
7339b74 to
b1944bb
Compare
## Summary `test/inductor/test_smoke.py` gates its accelerator tests with `@unittest.skipIf(not HAS_GPU, ...)` and builds their tensors on the `GPU_TYPE` constant imported from `torch.testing/_internal/inductor_utils`. Both are resolved once, at import, from whichever device the process happened to initialise, so the file cannot say which device a test is about to exercise, and every host inherits the same answer. This change moves that decision into the framework's own mechanism. It touches two files: the test file, and its now-unneeded exemption in `tools/linter/adapters/test_linter_allowlist.json`. ## Changes - `SmokeTest` is split. The generic half keeps `test_compile_invalid_options`, which touches no device and stays a plain `TestCase`. The accelerator half becomes `SmokeTestDevice`, declared `HardwareClassification.ACCELERATOR` and instantiated with `instantiate_device_type_tests(..., globals(), except_for="cpu", allow_xpu=True)`, the form `test/inductor/test_selective_lowering.py:56` and `test/inductor/test_symm_mem_registry.py:440` already use. `only_for` is deliberately not used: `test/REVIEW.md` Rule 4 says "`only_for` must not be used" for ACCELERATOR classes, and it would also drop the PrivateUse1, HPU and `TORCH_TEST_DEVICES` bases that this PR's own motivation is about keeping. - Test bodies take `device` and construct their tensors there, inside the test methods; the `GPU_TYPE` import is gone, and no `if device == ...` branch appears. `test_mlp` registers `self.addCleanup(torch._logging.set_logs)` before enabling DEBUG logging, so a failure no longer leaks the log level into later tests in the same process. - The two accelerator tests are gated with `@requires_triton()`, as can-gaa-hou asked in pytorch#192434 (comment). Stated plainly: `requires_triton` is `functools.partial(unittest.skipIf, not HAS_TRITON, ...)` (`inductor_utils.py:202`), so like the `HAS_GPU` it replaces it is a process-wide boolean. This PR makes the instantiation per-device, not the gate. - The `test/inductor/test_smoke.py` row is deleted from `tools/linter/adapters/test_linter_allowlist.json` (Rule 7). That row was why `TEST_LINTER` stayed silent: with the row removed, the file is checked, and the check is demonstrably live -- see the negative control in the Test Plan. - The `__main__` block is left byte-identical to the base commit, including the `IS_LINUX and HAS_GPU` and `major <= 5` conditions. `run_test.py` invokes this file as a script, so that block decides which tests CI executes, and changing it is not this PR's to make. ## What CI executes Because `run_test.py` runs the file as `python test_smoke.py` (`test/run_test.py:687`), the unchanged `__main__` guard decides what each shard runs; the pytest invocations below are local measurements, not a CI path. Reading the guard against the sources, before and after this PR alike: - CUDA and ROCm shards: `HAS_CUDA_AND_TRITON` is true and the `major <= 5` disjunct is false on any Triton-capable GPU (`is_triton_capable` requires HIP or compute capability 7 or later, `torch/_dynamo/device_interface.py:433-441`), so `run_tests()` is never called: the instantiated CUDA classes are generated but not executed by CI. - CPU-only shards: `HAS_GPU` is false (`inductor_utils.py:82`), the script path runs nothing from this file. - Out-of-tree backends: upstream CI installs none, so no PrivateUse1 class is generated there at all; the NPU numbers below come from a local wheel on an Ascend 910B4 host. - XPU is the one accelerator whose shards would execute these bodies (`allow_xpu=True` plus `PYTORCH_TESTING_DEVICE_ONLY_FOR=xpu`, and the default shard suite keeps this file), but the xpu workflow only reacts to the `ciflow/xpu` label, `viable/strict`, its schedule, or manual dispatch (`.github/workflows/xpu.yml:4-14`). This PR does not carry that label, so no XPU test job has run on any of its heads (two older heads show an XPU build job only). A green `test_mlp_xpu` / `test_compile_decorator_xpu` result can therefore only come from a run triggered after adding `ciflow/xpu` (and approving the workflows, as for the other ciflow families of this fork PR). - fbcode/sandcastle hosts (an internal-build code read, not verifiable from OSS): `get_device_type_test_bases()` yields only the CPU base unless `IS_REMOTE_GPU` is set, and then the CUDA base only when ASAN, TSAN, UBSAN and MTIA are all off (`common_device_type.py:1028-1038`); with `except_for="cpu"` those hosts generate no device class at all. ## Known coverage change: MTIA `get_device_type_test_bases()` (`common_device_type.py:1023-1052`) has no MTIA base, so on an MTIA host `SmokeTestDevice` is not generated and `test_mlp` / `test_compile_decorator` stop running there, whereas base did run them (`HAS_GPU` includes `HAS_MTIA_AND_TRITON`, and `GPU_TYPE` resolved to `mtia`). That is a reading of the base sources, not a measurement: no MTIA hardware is available here. Keeping the coverage inside this file would break the rules it is being migrated under: `hw_classification` has exactly six members (`GENERIC`, `ACCELERATOR`, `CPU`, `CUDA`, `MPS`, `XPU`; `tools/linter/adapters/test_linter.py:105-111`), so Rule 2 cannot describe an MTIA class, and Rule 4 requires ACCELERATOR classes to be instantiated, which offers no MTIA base. The structural fix, an MTIA device test base, is a separate change. **This documented drop still needs the MTIA owners' explicit acceptance**: the question is open in the thread at pytorch#192434 (comment) (comment pytorch#192434 (comment)), unanswered since 2026-11-02, and nothing here assumes an answer. ## Out-of-tree results With `except_for="cpu"` the framework generates a PrivateUse1 class on a host that has an out-of-tree backend registered, and on this host two of its tests fail for reasons inside that backend: ``` test_compile_decorator_npu: TypeError: WrappedFunction.__init__() missing 2 required positional arguments: 'cudagraph_managed_input_rerecord_limit' and 'cudagraph_managed_input_rerecord_action' (raised at torch_npu/npu/_graph_tree.py:2527, from parameters the wheel's own torch/_inductor/cudagraph_trees.py:576-577 defines) test_mlp_npu: torch._inductor.exc.InductorError: TypeError: NPUPythonWrapperCodeGen._generate_extern_kernel_out_helper() got an unexpected keyword argument 'tunable_dyn_dims_mask' ``` Both are raised inside the out-of-tree backend's own wrapper codegen: its hooks predate the inductor APIs it now runs against. Upstream CI has no out-of-tree backend, so these do not gate this PR; they belong to the backend's own test configuration, whose documented mechanism is `PrivateUse1TestBase.set_test_configs(test_exclusions=...)` (`docs/source/accelerator/testing.md:74`). Adding an upstream per-device skip was rejected: the allowed device-specific skip decorators (`test/REVIEW.md:154-160`) are `@skipCPUIf`, `@skipCUDAIf`, `@skipXPUIf`, `@skipMPSIf` and the accelerator-aware `@skipIf` -- there is no out-of-tree entry -- and a bare `expectedFailure` would swallow any exception, not just these. ## Test Plan Two prebuilt wheel venvs, no source file overlaid onto site-packages, every run started from `/tmp` (from the repository root `python -m pytest` puts the source tree on `sys.path` and imports a `torch` with no built `version.py`, which fails for unrelated reasons). ```bash W=<worktree>/test/inductor/test_smoke.py # cpu wheel, out-of-tree backend autoloaded: 3 tests collected, 1 passed, 2 skipped # (the skips are SmokeTestDevicePRIVATEUSE1, reason "requires triton") env -u PYTHONPATH <cpu-python> -m pytest $W -q # cpu wheel, true CPU-only (TORCH_DEVICE_BACKEND_AUTOLOAD=0): 1 test collected, 1 passed # npu wheel, Ascend 910B4 (no CUDA/XPU present): 2 failed, 1 passed # (the two failures are the out-of-tree cases described above) lintrunner $W <worktree>/tools/linter/adapters/test_linter_allowlist.json # ok No lint issues. ``` Negative control, to show the linter claim is not vacuous. With the allowlist row deleted: ```bash <cpu-python> tools/linter/adapters/test_linter.py test/inductor/test_smoke.py # no findings # re-insert `only_for=("cuda", "xpu")` in the same file, same command: # {"name":"[only_for]","severity":"error","line":73,"description":"Test class # 'SmokeTestDevice' (ACCELERATOR): must not use only_for in # instantiate_device_type_tests; use except_for instead."} ``` ## Verification Report | State | Host | Collected | Passed | Failed | Skipped | |-------|------|-----------|--------|--------|---------| | this PR | CPU wheel, torch_npu autoloaded | 3 | 1 | 0 | 2 (`requires triton`) | | this PR | CPU wheel, `TORCH_DEVICE_BACKEND_AUTOLOAD=0` | 1 | 1 | 0 | 0 (no device class generated) | | this PR | NPU (Ascend 910B4, triton-ascend present) | 3 | 1 | 2 | 0 (backend-side failures above) | | Item | Version | |------|---------| | PyTorch (cpu and npu venvs) | 2.16.0.dev20261029+cpu | | torch_npu | 2.16.0.dev20261029+git737bb43 | | CANN | 9.2.0 | | Python | 3.12 | ## XPU execution The review asked for evidence that the converted device tests pass on Linux XPU. There is no such evidence available from this PR: `gh pr checks 192434` currently lists no job whose name contains `xpu` or `intel` (0 of 4 executed checks), even though the PR carries `ciflow/trunk` and `ciflow/inductor`. The CUDA and XPU variants are therefore asserted here to be *created and gated*, not executed; whether they pass belongs to a shard that has to be run by someone able to schedule it, and no change to this file can produce that evidence. | Hardware | Ascend 910B4 (no CUDA/XPU present) |
b1944bb to
70cd75a
Compare
## Summary `test/inductor/test_smoke.py` gates its accelerator tests with `@unittest.skipIf(not HAS_GPU, ...)` and builds their tensors on the `GPU_TYPE` constant imported from `torch.testing/_internal/inductor_utils`. Both are resolved once, at import, from whichever device the process happened to initialise, so the file cannot say which device a test is about to exercise, and every host inherits the same answer. This change moves that decision into the framework's own mechanism. It touches two files: the test file, and its now-unneeded exemption in `tools/linter/adapters/test_linter_allowlist.json`. ## Changes - `SmokeTest` is split. The generic half keeps `test_compile_invalid_options`, which touches no device and stays a plain `TestCase`. The accelerator half becomes `SmokeTestDevice`, declared `HardwareClassification.ACCELERATOR` and instantiated with `instantiate_device_type_tests(..., globals(), except_for="cpu", allow_xpu=True)`, the form `test/inductor/test_selective_lowering.py:56` and `test/inductor/test_symm_mem_registry.py:440` already use. `only_for` is deliberately not used: `test/REVIEW.md` Rule 4 says "`only_for` must not be used" for ACCELERATOR classes, and it would also drop the PrivateUse1, HPU and `TORCH_TEST_DEVICES` bases that this PR's own motivation is about keeping. - Test bodies take `device` and construct their tensors there, inside the test methods; the `GPU_TYPE` import is gone, and no `if device == ...` branch appears. `test_mlp` registers `self.addCleanup(torch._logging.set_logs)` before enabling DEBUG logging, so a failure no longer leaks the log level into later tests in the same process. - The two accelerator tests are gated with `@requires_triton()`, as can-gaa-hou asked in pytorch#192434 (comment). Stated plainly: `requires_triton` is `functools.partial(unittest.skipIf, not HAS_TRITON, ...)` (`inductor_utils.py:202`), so like the `HAS_GPU` it replaces it is a process-wide boolean. This PR makes the instantiation per-device, not the gate. - The `test/inductor/test_smoke.py` row is deleted from `tools/linter/adapters/test_linter_allowlist.json` (Rule 7). That row was why `TEST_LINTER` stayed silent: with the row removed, the file is checked, and the check is demonstrably live -- see the negative control in the Test Plan. - The `__main__` block is left byte-identical to the base commit, including the `IS_LINUX and HAS_GPU` and `major <= 5` conditions. `run_test.py` invokes this file as a script, so that block decides which tests CI executes, and changing it is not this PR's to make. ## What CI executes Because `run_test.py` runs the file as `python test_smoke.py` (`test/run_test.py:687`), the unchanged `__main__` guard decides what each shard runs; the pytest invocations below are local measurements, not a CI path. Reading the guard against the sources, before and after this PR alike: - CUDA and ROCm shards: `HAS_CUDA_AND_TRITON` is true and the `major <= 5` disjunct is false on any Triton-capable GPU (`is_triton_capable` requires HIP or compute capability 7 or later, `torch/_dynamo/device_interface.py:433-441`), so `run_tests()` is never called: the instantiated CUDA classes are generated but not executed by CI. - CPU-only shards: `HAS_GPU` is false (`inductor_utils.py:82`), the script path runs nothing from this file. - Out-of-tree backends: upstream CI installs none, so no PrivateUse1 class is generated there at all; the NPU numbers below come from a local wheel on an Ascend 910B4 host. - XPU is the one accelerator whose shards would execute these bodies (`allow_xpu=True` plus `PYTORCH_TESTING_DEVICE_ONLY_FOR=xpu`, and the default shard suite keeps this file), but the xpu workflow only reacts to the `ciflow/xpu` label, `viable/strict`, its schedule, or manual dispatch (`.github/workflows/xpu.yml:4-14`). This PR does not carry that label, so no XPU test job has run on any of its heads (two older heads show an XPU build job only). A green `test_mlp_xpu` / `test_compile_decorator_xpu` result can therefore only come from a run triggered after adding `ciflow/xpu` (and approving the workflows, as for the other ciflow families of this fork PR). - fbcode/sandcastle hosts (an internal-build code read, not verifiable from OSS): `get_device_type_test_bases()` yields only the CPU base unless `IS_REMOTE_GPU` is set, and then the CUDA base only when ASAN, TSAN, UBSAN and MTIA are all off (`common_device_type.py:1028-1038`); with `except_for="cpu"` those hosts generate no device class at all. ## Known coverage change: MTIA `get_device_type_test_bases()` (`common_device_type.py:1023-1052`) has no MTIA base, so on an MTIA host `SmokeTestDevice` is not generated and `test_mlp` / `test_compile_decorator` stop running there, whereas base did run them (`HAS_GPU` includes `HAS_MTIA_AND_TRITON`, and `GPU_TYPE` resolved to `mtia`). That is a reading of the base sources, not a measurement: no MTIA hardware is available here. Keeping the coverage inside this file would break the rules it is being migrated under: `hw_classification` has exactly six members (`GENERIC`, `ACCELERATOR`, `CPU`, `CUDA`, `MPS`, `XPU`; `tools/linter/adapters/test_linter.py:105-111`), so Rule 2 cannot describe an MTIA class, and Rule 4 requires ACCELERATOR classes to be instantiated, which offers no MTIA base. The structural fix, an MTIA device test base, is a separate change. **This documented drop still needs the MTIA owners' explicit acceptance**: the question is open in the thread at pytorch#192434 (comment) (comment pytorch#192434 (comment)), unanswered since 2026-11-02, and nothing here assumes an answer. ## Out-of-tree results With `except_for="cpu"` the framework generates a PrivateUse1 class on a host that has an out-of-tree backend registered, and on this host two of its tests fail for reasons inside that backend: ``` test_compile_decorator_npu: TypeError: WrappedFunction.__init__() missing 2 required positional arguments: 'cudagraph_managed_input_rerecord_limit' and 'cudagraph_managed_input_rerecord_action' (raised at torch_npu/npu/_graph_tree.py:2527, from parameters the wheel's own torch/_inductor/cudagraph_trees.py:576-577 defines) test_mlp_npu: torch._inductor.exc.InductorError: TypeError: NPUPythonWrapperCodeGen._generate_extern_kernel_out_helper() got an unexpected keyword argument 'tunable_dyn_dims_mask' ``` Both are raised inside the out-of-tree backend's own wrapper codegen: its hooks predate the inductor APIs it now runs against. Upstream CI has no out-of-tree backend, so these do not gate this PR; they belong to the backend's own test configuration, whose documented mechanism is `PrivateUse1TestBase.set_test_configs(test_exclusions=...)` (`docs/source/accelerator/testing.md:74`). Adding an upstream per-device skip was rejected: the allowed device-specific skip decorators (`test/REVIEW.md:154-160`) are `@skipCPUIf`, `@skipCUDAIf`, `@skipXPUIf`, `@skipMPSIf` and the accelerator-aware `@skipIf` -- there is no out-of-tree entry -- and a bare `expectedFailure` would swallow any exception, not just these. ## Test Plan Two prebuilt wheel venvs, no source file overlaid onto site-packages, every run started from `/tmp` (from the repository root `python -m pytest` puts the source tree on `sys.path` and imports a `torch` with no built `version.py`, which fails for unrelated reasons). ```bash W=<worktree>/test/inductor/test_smoke.py # cpu wheel, out-of-tree backend autoloaded: 3 tests collected, 1 passed, 2 skipped # (the skips are SmokeTestDevicePRIVATEUSE1, reason "requires triton") env -u PYTHONPATH <cpu-python> -m pytest $W -q # cpu wheel, true CPU-only (TORCH_DEVICE_BACKEND_AUTOLOAD=0): 1 test collected, 1 passed # npu wheel, Ascend 910B4 (no CUDA/XPU present): 2 failed, 1 passed # (the two failures are the out-of-tree cases described above) lintrunner $W <worktree>/tools/linter/adapters/test_linter_allowlist.json # ok No lint issues. ``` Negative control, to show the linter claim is not vacuous. With the allowlist row deleted: ```bash <cpu-python> tools/linter/adapters/test_linter.py test/inductor/test_smoke.py # no findings # re-insert `only_for=("cuda", "xpu")` in the same file, same command: # {"name":"[only_for]","severity":"error","line":73,"description":"Test class # 'SmokeTestDevice' (ACCELERATOR): must not use only_for in # instantiate_device_type_tests; use except_for instead."} ``` ## Verification Report | State | Host | Collected | Passed | Failed | Skipped | |-------|------|-----------|--------|--------|---------| | this PR | CPU wheel, torch_npu autoloaded | 3 | 1 | 0 | 2 (`requires triton`) | | this PR | CPU wheel, `TORCH_DEVICE_BACKEND_AUTOLOAD=0` | 1 | 1 | 0 | 0 (no device class generated) | | this PR | NPU (Ascend 910B4, triton-ascend present) | 3 | 1 | 2 | 0 (backend-side failures above) | | Item | Version | |------|---------| | PyTorch (cpu and npu venvs) | 2.16.0.dev20261029+cpu | | torch_npu | 2.16.0.dev20261029+git737bb43 | | CANN | 9.2.0 | | Python | 3.12 | ## XPU execution The review asked for evidence that the converted device tests pass on Linux XPU. There is no such evidence available from this PR: `gh pr checks 192434` currently lists no job whose name contains `xpu` or `intel` (0 of 4 executed checks), even though the PR carries `ciflow/trunk` and `ciflow/inductor`. The CUDA and XPU variants are therefore asserted here to be *created and gated*, not executed; whether they pass belongs to a shard that has to be run by someone able to schedule it, and no change to this file can produce that evidence. | Hardware | Ascend 910B4 (no CUDA/XPU present) |
70cd75a to
87652f9
Compare
## Summary `test/inductor/test_smoke.py` gates its accelerator tests with `@unittest.skipIf(not HAS_GPU, ...)` and builds their tensors on the `GPU_TYPE` constant imported from `torch.testing/_internal/inductor_utils`. Both are resolved once, at import, from whichever device the process happened to initialise, so the file cannot say which device a test is about to exercise, and every host inherits the same answer. This change moves that decision into the framework's own mechanism. It touches two files: the test file, and its now-unneeded exemption in `tools/linter/adapters/test_linter_allowlist.json`. ## Changes - `SmokeTest` is split. The generic half keeps `test_compile_invalid_options`, which touches no device and stays a plain `TestCase`. The accelerator half becomes `SmokeTestDevice`, declared `HardwareClassification.ACCELERATOR` and instantiated with `instantiate_device_type_tests(..., globals(), except_for="cpu", allow_xpu=True)`, the form `test/inductor/test_selective_lowering.py:56` and `test/inductor/test_symm_mem_registry.py:440` already use. `only_for` is deliberately not used: `test/REVIEW.md` Rule 4 says "`only_for` must not be used" for ACCELERATOR classes, and it would also drop the PrivateUse1, HPU and `TORCH_TEST_DEVICES` bases that this PR's own motivation is about keeping. - Test bodies take `device` and construct their tensors there, inside the test methods; the `GPU_TYPE` import is gone, and no `if device == ...` branch appears. `test_mlp` registers `self.addCleanup(torch._logging.set_logs)` before enabling DEBUG logging, so a failure no longer leaks the log level into later tests in the same process. - The two accelerator tests are gated with `@requires_triton()`, as can-gaa-hou asked in pytorch#192434 (comment). Stated plainly: `requires_triton` is `functools.partial(unittest.skipIf, not HAS_TRITON, ...)` (`inductor_utils.py:202`), so like the `HAS_GPU` it replaces it is a process-wide boolean. This PR makes the instantiation per-device, not the gate. - The `test/inductor/test_smoke.py` row is deleted from `tools/linter/adapters/test_linter_allowlist.json` (Rule 7). That row was why `TEST_LINTER` stayed silent: with the row removed, the file is checked, and the check is demonstrably live -- see the negative control in the Test Plan. - The `__main__` block is left byte-identical to the base commit, including the `IS_LINUX and HAS_GPU` and `major <= 5` conditions. `run_test.py` invokes this file as a script, so that block decides which tests CI executes, and changing it is not this PR's to make. ## What CI executes Because `run_test.py` runs the file as `python test_smoke.py` (`test/run_test.py:687`), the unchanged `__main__` guard decides what each shard runs; the pytest invocations below are local measurements, not a CI path. Reading the guard against the sources, before and after this PR alike: - CUDA and ROCm shards: `HAS_CUDA_AND_TRITON` is true and the `major <= 5` disjunct is false on any Triton-capable GPU (`is_triton_capable` requires HIP or compute capability 7 or later, `torch/_dynamo/device_interface.py:433-441`), so `run_tests()` is never called: the instantiated CUDA classes are generated but not executed by CI. - CPU-only shards: `HAS_GPU` is false (`inductor_utils.py:82`), the script path runs nothing from this file. - Out-of-tree backends: upstream CI installs none, so no PrivateUse1 class is generated there at all; the NPU numbers below come from a local wheel on an Ascend 910B4 host. - XPU is the one accelerator whose shards would execute these bodies (`allow_xpu=True` plus `PYTORCH_TESTING_DEVICE_ONLY_FOR=xpu`, and the default shard suite keeps this file), but the xpu workflow only reacts to the `ciflow/xpu` label, `viable/strict`, its schedule, or manual dispatch (`.github/workflows/xpu.yml:4-14`). This PR does not carry that label, so no XPU test job has run on any of its heads (two older heads show an XPU build job only). A green `test_mlp_xpu` / `test_compile_decorator_xpu` result can therefore only come from a run triggered after adding `ciflow/xpu` (and approving the workflows, as for the other ciflow families of this fork PR). - fbcode/sandcastle hosts (an internal-build code read, not verifiable from OSS): `get_device_type_test_bases()` yields only the CPU base unless `IS_REMOTE_GPU` is set, and then the CUDA base only when ASAN, TSAN, UBSAN and MTIA are all off (`common_device_type.py:1028-1038`); with `except_for="cpu"` those hosts generate no device class at all. ## Known coverage change: MTIA `get_device_type_test_bases()` (`common_device_type.py:1023-1052`) has no MTIA base, so on an MTIA host `SmokeTestDevice` is not generated and `test_mlp` / `test_compile_decorator` stop running there, whereas base did run them (`HAS_GPU` includes `HAS_MTIA_AND_TRITON`, and `GPU_TYPE` resolved to `mtia`). That is a reading of the base sources, not a measurement: no MTIA hardware is available here. Keeping the coverage inside this file would break the rules it is being migrated under: `hw_classification` has exactly six members (`GENERIC`, `ACCELERATOR`, `CPU`, `CUDA`, `MPS`, `XPU`; `tools/linter/adapters/test_linter.py:105-111`), so Rule 2 cannot describe an MTIA class, and Rule 4 requires ACCELERATOR classes to be instantiated, which offers no MTIA base. The structural fix, an MTIA device test base, is a separate change. **This documented drop still needs the MTIA owners' explicit acceptance**: the question is open in the thread at pytorch#192434 (comment) (comment pytorch#192434 (comment)), unanswered since 2026-11-02, and nothing here assumes an answer. ## Out-of-tree results With `except_for="cpu"` the framework generates a PrivateUse1 class on a host that has an out-of-tree backend registered, and on this host two of its tests fail for reasons inside that backend: ``` test_compile_decorator_npu: TypeError: WrappedFunction.__init__() missing 2 required positional arguments: 'cudagraph_managed_input_rerecord_limit' and 'cudagraph_managed_input_rerecord_action' (raised at torch_npu/npu/_graph_tree.py:2527, from parameters the wheel's own torch/_inductor/cudagraph_trees.py:576-577 defines) test_mlp_npu: torch._inductor.exc.InductorError: TypeError: NPUPythonWrapperCodeGen._generate_extern_kernel_out_helper() got an unexpected keyword argument 'tunable_dyn_dims_mask' ``` Both are raised inside the out-of-tree backend's own wrapper codegen: its hooks predate the inductor APIs it now runs against. Upstream CI has no out-of-tree backend, so these do not gate this PR; they belong to the backend's own test configuration, whose documented mechanism is `PrivateUse1TestBase.set_test_configs(test_exclusions=...)` (`docs/source/accelerator/testing.md:74`). Adding an upstream per-device skip was rejected: the allowed device-specific skip decorators (`test/REVIEW.md:154-160`) are `@skipCPUIf`, `@skipCUDAIf`, `@skipXPUIf`, `@skipMPSIf` and the accelerator-aware `@skipIf` -- there is no out-of-tree entry -- and a bare `expectedFailure` would swallow any exception, not just these. ## Test Plan Two prebuilt wheel venvs, no source file overlaid onto site-packages, every run started from `/tmp` (from the repository root `python -m pytest` puts the source tree on `sys.path` and imports a `torch` with no built `version.py`, which fails for unrelated reasons). ```bash W=<worktree>/test/inductor/test_smoke.py # cpu wheel, out-of-tree backend autoloaded: 3 tests collected, 1 passed, 2 skipped # (the skips are SmokeTestDevicePRIVATEUSE1, reason "requires triton") env -u PYTHONPATH <cpu-python> -m pytest $W -q # cpu wheel, true CPU-only (TORCH_DEVICE_BACKEND_AUTOLOAD=0): 1 test collected, 1 passed # npu wheel, Ascend 910B4 (no CUDA/XPU present): 2 failed, 1 passed # (the two failures are the out-of-tree cases described above) lintrunner $W <worktree>/tools/linter/adapters/test_linter_allowlist.json # ok No lint issues. ``` Negative control, to show the linter claim is not vacuous. With the allowlist row deleted: ```bash <cpu-python> tools/linter/adapters/test_linter.py test/inductor/test_smoke.py # no findings # re-insert `only_for=("cuda", "xpu")` in the same file, same command: # {"name":"[only_for]","severity":"error","line":73,"description":"Test class # 'SmokeTestDevice' (ACCELERATOR): must not use only_for in # instantiate_device_type_tests; use except_for instead."} ``` ## Verification Report | State | Host | Collected | Passed | Failed | Skipped | |-------|------|-----------|--------|--------|---------| | this PR | CPU wheel, torch_npu autoloaded | 3 | 1 | 0 | 2 (`requires triton`) | | this PR | CPU wheel, `TORCH_DEVICE_BACKEND_AUTOLOAD=0` | 1 | 1 | 0 | 0 (no device class generated) | | this PR | NPU (Ascend 910B4, triton-ascend present) | 3 | 1 | 2 | 0 (backend-side failures above) | | Item | Version | |------|---------| | PyTorch (cpu and npu venvs) | 2.16.0.dev20261029+cpu | | torch_npu | 2.16.0.dev20261029+git737bb43 | | CANN | 9.2.0 | | Python | 3.12 | ## XPU execution The review asked for evidence that the converted device tests pass on Linux XPU. There is no such evidence available from this PR: `gh pr checks 192434` currently lists no job whose name contains `xpu` or `intel` (0 of 4 executed checks), even though the PR carries `ciflow/trunk` and `ciflow/inductor`. The CUDA and XPU variants are therefore asserted here to be *created and gated*, not executed; whether they pass belongs to a shard that has to be run by someone able to schedule it, and no change to this file can produce that evidence. | Hardware | Ascend 910B4 (no CUDA/XPU present) |
87652f9 to
fa5b276
Compare
There was a problem hiding this comment.
Automated review of fa5b276: nothing blocking; ready for human review.
The PR splits test/inductor/test_smoke.py into a GENERIC SmokeTest and an ACCELERATOR SmokeTestDevice instantiated with instantiate_device_type_tests(except_for="cpu", allow_xpu=True) and gated by @ requires_triton(), and removes its linter allowlist row. Recommendation: Needs Discussion. The review finds no code defect, but asks for a green ciflow/xpu run and explicit maintainer acceptance (or a fallback) for the lost MTIA/fbcode coverage before merge.
⚪ 2 non-blocking findings
pytorch/test/inductor/test_smoke.py
Line 69 in fa5b276
No CI job has run the new device tests. run_test.py runs this file as a script, so the unchanged main guard decides what CI executes. On CUDA/ROCm, HAS_CUDA_AND_TRITON implies HIP or major >= 7, so major <= 5 is false and run_tests() is never reached: SmokeTestDeviceCUDA is generated but never executed. On CPU-only and PrivateUse1-only shards HAS_GPU is false. That leaves Linux XPU as the only upstream path that runs test_mlp_xpu / test_compile_decorator_xpu, the bodies this PR rewrote (device instead of GPU_TYPE, plus the new addCleanup). xpu.yml fires only on ciflow/xpu, viable/strict, a schedule or manual dispatch, and the XPU job in pull.yml only builds, so the green checks say nothing about these tests. Fix: add ciflow/xpu and get a green XPU test run before merging. (The inverted <= 5 check predates this PR and is left alone, as can-gaa-hou asked.)
An earlier comment near this line has replies: #192434 (comment)
pytorch/test/inductor/test_smoke.py
Line 70 in fa5b276
MTIA and some internal GPU hosts lose test_mlp and test_compile_decorator entirely. On MTIA, base ran both tests (HAS_GPU includes HAS_MTIA_AND_TRITON and GPU_TYPE can resolve to mtia), but get_device_type_test_bases() has no MTIA base and there is no MTIATestBase in the tree. Under IS_FBCODE/IS_SANDCASTLE without IS_REMOTE_GPU it adds only CPUTestBase, and even with IS_REMOTE_GPU the CUDA base is dropped under ASAN/TSAN/UBSAN or TEST_WITH_MTIA. With except_for="cpu" those hosts get no device class, so the tests vanish rather than skip. The description documents this but says it "still needs the MTIA owners' explicit acceptance"; can-gaa-hou raised it and has not replied since 2026-11-02, and the author's 2026-11-03 reply says the file "now carries SmokeTestMTIA", but that class is no longer at HEAD. Fix: before landing, get an explicit decision from can-gaa-hou or the MTIA owners: accept the drop, or keep a fallback until an MTIA device test base exists.
An earlier comment near this line has replies: #192434 (comment)
This review is AI-generated and advisory. Each new automated review replaces the previous one.
Withdrawn: the automated review of fa5b276 found nothing blocking.
|
Ready for human review. On head Two steps remain that only maintainers can take:
@eellison @jansel if either of you has bandwidth: this is one of a series migrating |
|
@pytorchbot merge -i |
|
|
|
@pytorchbot 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 |
Summary
test/inductor/test_smoke.pygates its accelerator tests with@unittest.skipIf(not HAS_GPU, ...)and builds their tensors on theGPU_TYPEconstantimported from
torch.testing/_internal/inductor_utils. Both are resolved once, at import,from whichever device the process happened to initialise, so the file cannot say which
device a test is about to exercise, and every host inherits the same answer.
This change moves that decision into the framework's own mechanism. It touches two files:
the test file, and its now-unneeded exemption in
tools/linter/adapters/test_linter_allowlist.json.Changes
SmokeTestis split. The generic half keepstest_compile_invalid_options, whichtouches no device and stays a plain
TestCase. The accelerator half becomesSmokeTestDevice, declaredHardwareClassification.ACCELERATORand instantiated withinstantiate_device_type_tests(..., globals(), except_for="cpu", allow_xpu=True), theform
test/inductor/test_selective_lowering.py:56andtest/inductor/test_symm_mem_registry.py:440already use.only_foris deliberately notused:
test/REVIEW.mdRule 4 says "only_formust not be used" for ACCELERATOR classes,and it would also drop the PrivateUse1, HPU and
TORCH_TEST_DEVICESbases that this PR'sown motivation is about keeping.
test_compile_invalid_optionskeeps base behavior with a tightened assertion:self.assertRaisesRegex(RuntimeError, "Unrecognized mode=ha")pins the messagetorch/_inductor/__init__.py:408raises, instead of the bareassertRaises(RuntimeError)inherited from base that accepted any compilation error.
deviceand construct their tensors there, inside the test methods;the
GPU_TYPEimport is gone, and noif device == ...branch appears.test_mlpregisters
self.addCleanup(torch._logging.set_logs)before enabling DEBUG logging, so afailure no longer leaks the log level into later tests in the same process.
@requires_triton(), as can-gaa-hou asked in[Testcase Refactoring] Make test_smoke device-agnostic via instantiate_device_type_tests #192434 (comment). Stated plainly:
requires_tritonisfunctools.partial(unittest.skipIf, not HAS_TRITON, ...)(
inductor_utils.py:202), so like theHAS_GPUit replaces it is a process-wide boolean.This PR makes the instantiation per-device, not the gate.
test/inductor/test_smoke.pyrow is deleted fromtools/linter/adapters/test_linter_allowlist.json(Rule 7). That row was whyTEST_LINTERstayed silent: with the row removed, the file is checked, and the check is demonstrably
live -- see the negative control in the Test Plan.
__main__block is left byte-identical to the base commit, including theIS_LINUX and HAS_GPUandmajor <= 5conditions.run_test.pyinvokes this file as ascript, so that block decides which tests CI executes, and changing it is not this PR's to
make.
What CI executes
Because
run_test.pyruns the file aspython test_smoke.py(test/run_test.py:687), theunchanged
__main__guard decides what each shard runs; the pytest invocations below arelocal measurements, not a CI path. Reading the guard against the sources, before and after
this PR alike:
HAS_CUDA_AND_TRITONis true and themajor <= 5disjunct is falseon any Triton-capable GPU (
is_triton_capablerequires HIP or compute capability 7 orlater,
torch/_dynamo/device_interface.py:433-441), sorun_tests()is never called:the instantiated CUDA classes are generated but not executed by CI.
HAS_GPUis false (inductor_utils.py:82), the script path runsnothing from this file.
there at all; the NPU numbers below come from a local wheel on an Ascend 910B4 host.
allow_xpu=Trueplus
PYTORCH_TESTING_DEVICE_ONLY_FOR=xpu, and the default shard suite keeps this file),but the xpu workflow only reacts to the
ciflow/xpulabel,viable/strict, itsschedule, or manual dispatch (
.github/workflows/xpu.yml:4-14). This PR does not carrythat label (it carries
ciflow/trunkandciflow/inductor, neither of which reachesxpu.yml), sono XPU test job has run on any of its heads (two older heads show an XPU
build job only). A green
test_mlp_xpu/test_compile_decorator_xpuresult cantherefore only come from a run triggered after adding
ciflow/xpu(and approving theworkflows, as for the other ciflow families of this fork PR).
Known coverage changes: MTIA and fbcode/sandcastle
get_device_type_test_bases()(common_device_type.py:1023-1052) has no MTIA base, so onan MTIA host
SmokeTestDeviceis not generated andtest_mlp/test_compile_decoratorstop running there, whereas base did run them (
HAS_GPUincludesHAS_MTIA_AND_TRITON,and
GPU_TYPEresolved tomtia). That is a reading of the base sources, not ameasurement: no MTIA hardware is available here. Keeping the coverage inside this file
would break the rules it is being migrated under:
hw_classificationhas exactly sixmembers (
GENERIC,ACCELERATOR,CPU,CUDA,MPS,XPU;tools/linter/adapters/test_linter.py:105-111), so Rule 2 cannot describe an MTIA class,and Rule 4 requires ACCELERATOR classes to be instantiated, which offers no MTIA base. The
structural fix, an MTIA device test base, is a separate change. This documented drop
still needs the MTIA owners' explicit acceptance: the question is open in the thread at
#192434 (comment) (comment
#192434 (comment)), unanswered since
2026-11-02, and nothing here assumes an answer.
The second drop is on fbcode/sandcastle hosts (an internal-build code read, not verifiable
from OSS):
get_device_type_test_bases()yields only the CPU base unlessIS_REMOTE_GPU(
PYTORCH_TEST_REMOTE_GPU,common_utils.py:421-424) is set, and even then the CUDA base isdropped when ASAN, TSAN, UBSAN or
TEST_WITH_MTIAis on (common_device_type.py:1028-1038).Base ran these tests wherever
HAS_GPUheld, such hosts included; withexcept_for="cpu"those hosts now generate no device class at all. Whether internal GPU targets set
PYTORCH_TEST_REMOTE_GPUcannot be confirmed from this repository, so the loss is filed hereas a known coverage change rather than assumed away.
Out-of-tree results
With
except_for="cpu"the framework generates a PrivateUse1 class on a host that has anout-of-tree backend registered, and on this host two of its tests fail for reasons inside
that backend:
Both are raised inside the out-of-tree backend's own wrapper codegen: its hooks predate the
inductor APIs it now runs against. Upstream CI has no out-of-tree backend, so these do not
gate this PR; they belong to the backend's own test configuration, whose documented
mechanism is
PrivateUse1TestBase.set_test_configs(test_exclusions=...)(
docs/source/accelerator/testing.md:56). Adding an upstream per-device skip was rejected:the allowed device-specific skip decorators (
test/REVIEW.md:154-160) are@skipCPUIf,@skipCUDAIf,@skipXPUIf,@skipMPSIfand the accelerator-aware@skipIf-- there isno out-of-tree entry -- and a bare
expectedFailurewould swallow any exception, not justthese.
Test Plan
Two prebuilt wheel venvs, no source file overlaid onto site-packages, every run started
from
/tmp(from the repository rootpython -m pytestputs the source tree onsys.pathand imports a
torchwith no builtversion.py, which fails for unrelated reasons).Negative control, to show the linter claim is not vacuous. With the allowlist row deleted:
Verification Report
requires triton)TORCH_DEVICE_BACKEND_AUTOLOAD=0cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo