Skip to content

[Testcase Refactoring] Move RoCm-scratch unit tests into a CUDA-classified class - #203550

Closed
gavinwang269 wants to merge 3 commits into
pytorch:mainfrom
gavinwang269:stl/p-unit-rocm3
Closed

gavinwang269 wants to merge 3 commits into
pytorch:mainfrom
gavinwang269:stl/p-unit-rocm3

Conversation

@gavinwang269

@gavinwang269 gavinwang269 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Slice 2 of 4 of the static-launcher re-cut (independent; any order; original monolith #198437).

Moves three scratch-space tests out of TestStaticTritonLauncherUnit into the existing CUDA-classified class TestStaticTritonLauncherUnitCuda, established by #203548: test_global_scratch_allocation, test_fast_launcher_rejects_global_scratch (both @skipIfRocm) and test_rocm_rejects_global_scratch (ROCm-only). No new class: the three bodies move verbatim, and the scratch-kernel factory is delegated by reference, never copied. The class docstring, inherited stale from main, is corrected in this PR: it claimed the class cannot run on RoCm and named a CUDAAutotuner that does not exist; it now describes the class as covering the CUDA/ROCm paths of CachingAutotuner and StaticallyLaunchedCudaKernel, noting that CachingAutotuner itself is device-generic.

(+50/-55, one file; relocation of the three test bodies plus the docstring fix)

What classifies TestStaticTritonLauncherUnit

This slice does not declare hw_classification on the source class. The unit class still holds the last two device-gated tests, test_static_launch_takes_cubin_from_metadata_group and test_static_launch_rejects_ambiguous_metadata_group (@skipIfRocm); slice 3 (#203551) moves those into TestStaticTritonLauncherUnitMetadataGroup (GENERIC). Once that lands no device-gated test remains in the unit class, and its GENERIC declaration is the final slice of this re-cut, which is not opened yet. REVIEW.md Scenario 1 permits the multi-PR split; this section is the split explanation the rule asks for.

Test Plan

  • cpu wheel venv (previous head): failure set identical to base; the two commits added after it each change only the class docstring (AST-verified), no behavioral diff
  • ROCm run: green. Run 46792320695 (https://github.com/pytorch/pytorch/actions/runs/46792320695), triggered by head f72c3ea88139: build plus all 8 default shards pass on linux-noble-rocm-py3.11-mi300; test_rocm_rejects_global_scratch ran on shard 1/8 and passed, per the shard's junit report (56 tests, 0 skipped, 0 failed). The current head daeb4dafbdf3 only rewords the class docstring, no behavioral change. The ciflow/rocm-mi300 label made test_rocm_rejects_global_scratch actually execute. It runs because rocm-mi300.yml runs the default config, which discovers this file (it is in neither the job's tests-to-exclude nor the ROCM_BLOCKLIST in test/run_test.py), and ROCm jobs exclude GENERIC classes only, so the CUDA-classified class runs. The earlier review round suggested ciflow/inductor-rocm-mi300 instead; that workflow runs the inductor config, whose test_inductor_shard in .ci/pytorch/test.sh never includes test_static_triton_launcher.
  • in-tree test linter: not a meaningful check for this file yet. It is listed in tools/linter/adapters/test_linter_allowlist.json, and check_file in tools/linter/adapters/test_linter.py returns early for allowlisted paths, so the regular lintrunner path verifies nothing here. The file leaves the allowlist when the family-wide classification completes.

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben

Linked issue or supporting maintainer

Part of #185590 (test case refactoring initiative) - hardware-decoupling slice.

@pytorch-bot

pytorch-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

PR Status: Approved 🚀

Please fix all CI failures and trigger merge by commenting "@pytorchbot merge".

✅ AUTOMATED REVIEW - OUTDATED (earlier commit) - Ready for human review:

The PR moves three global-scratch tests from TestStaticTritonLauncherUnit into
the existing CUDA-classified TestStaticTritonLauncherUnitCuda and rewrites that
class's docstring. The move keeps the code unchanged and coverage stays the
same. Recommendation: Approve. Only non-blocking points remain: inaccurate
wording in the PR conversation and in the docstring.

Findings (2):

[minor] test/inductor/test_static_triton_launcher.py:607
Non-blocking: the PR conversation still misdescribes what lands. (1) Issue
comment 7278330456 and the Dec 2 pings (7340847146, 7341676715, 7341721683) say
the class was "renamed" and has a "three-line docstring". At HEAD nothing is
renamed: the tests go into TestStaticTritonLauncherUnitCuda, which already
existed at the merge base, and the docstring is five lines (608-612). (2)
7341676715 and 7341721683 say the tests move "into a device-gated group so
out-of-tree backends can run them". That is false. The class is
HardwareClassification.CUDA and uses @​ instantiate_parametrized_tests, not
instantiate_device_type_tests. The test bodies hard-code
StaticallyLaunchedCudaKernel, device_props type="cuda" and
torch._C._FastCudaLauncher, so no out-of-tree backend runs them. (3) The Test
Plan's "ROCm run" box is still unchecked, though comments say rocm-mi300 is
green. If it passed, check the box and link the run. Correct these claims before
landing.

[minor] test/inductor/test_static_triton_launcher.py:608
Non-blocking: the new docstring presents CachingAutotuner as part of the
"CUDA-family (CUDA and ROCm) launcher runtime". CachingAutotuner is
device-generic (torch/_inductor/runtime/triton_heuristics.py:705), and
TestStaticTritonLauncherUnit also exercises it in device-independent tests, e.g.
test_build_fast_launcher_unsupported_device with "privateuseone". Suggested
wording: "the CUDA/ROCm paths of `CachingAutotuner` and
`StaticallyLaunchedCudaKernel`".

Reviewed commit: f72c3ea (NOT the current head 2498ab3)

Review run

🐛 Report a bad review

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/203550

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 2498ab3 with merge base 06a91f0 (image):

NEW FAILURES SUPPRESSED BY AI (non-blocking) - The following job failed, but the AI CI Advisor judged the failure not to be evidence against this change:

  • BC Lint / bc_linter (gh)
    ##[error]API rate limit exceeded for installation. If you reach out to GitHub Support for help, please include the request ID 4C10:3173F7:48606E:E16152:6B10D5BB and timestamp 2026-12-03 02:36:44 UTC. For more on scraping GitHub and how it may affect your rights, please review our Terms of Service (https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) - https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api#rate-limiting

    AI verdict: AI verdict: infra issue

    The BC Lint job failed during the checkout step. actions/checkout hit "API rate limit exceeded for installation" while retrieving the default branch name, so the BC-linter itself never ran. The suspect commit only changes a docstring in a test file and cannot affect GitHub API rate limits.

    Full reasoning on HUD →

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot

pytorch-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Workflows were awaiting approval. CI has now been triggered for the ciflow labels on this PR.

gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 5, 2026
…via instantiate_device_type_tests

Independent slice (launcher migration only; the three unit-class splits moved
out of this PR to their own dependency-free PRs pytorch#203548 pytorch#203550 pytorch#203551):
class-level @requires_gpu_and_triton replaced by per-test Triton gates and
instantiate_device_type_tests(..., except_for="cpu", allow_xpu=True); 12 of 14
tests gain the injected device argument; write_cubin_to_tmp picks the binary
key per device (npubin alongside zebin/cubin/hsaco); the JITFunction getitem
save becomes unconditional (module scope) and the patch install moves into
setUp/tearDown of every instantiated device variant.
@gavinwang269 gavinwang269 changed the title [Testcase Refactoring] Move RoCm-gated scratch unit tests into their own ACCELERATOR class [Testcase Refactoring] Move RoCm-scratch unit tests into a CUDA-classified class Nov 5, 2026
@gavinwang269

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "module: tests/graph"

@pytorch-bot pytorch-bot Bot added the module: tests/graph This label covers all test cases within the Graph sheet. label Nov 6, 2026
gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 6, 2026
…via instantiate_device_type_tests

Independent slice (launcher migration only; the three unit-class splits moved
out of this PR to their own dependency-free PRs pytorch#203548 pytorch#203550 pytorch#203551):
class-level @requires_gpu_and_triton replaced by per-test Triton gates and
instantiate_device_type_tests(..., except_for="cpu", allow_xpu=True); 12 of 14
tests gain the injected device argument; write_cubin_to_tmp picks the binary
key per device (npubin alongside zebin/cubin/hsaco); the JITFunction getitem
save becomes unconditional (module scope) and the patch install moves into
setUp/tearDown of every instantiated device variant.
gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 12, 2026
…via instantiate_device_type_tests

Independent slice (launcher migration only; the three unit-class splits moved
out of this PR to their own dependency-free PRs pytorch#203548 pytorch#203550 pytorch#203551):
class-level @requires_gpu_and_triton replaced by per-test Triton gates and
instantiate_device_type_tests(..., except_for="cpu", allow_xpu=True); 12 of 14
tests gain the injected device argument; write_cubin_to_tmp picks the binary
key per device (npubin alongside zebin/cubin/hsaco); the JITFunction getitem
save becomes unconditional (module scope) and the patch install moves into
setUp/tearDown of every instantiated device variant.
gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 12, 2026
…via instantiate_device_type_tests

Independent slice (launcher migration only; the three unit-class splits moved
out of this PR to their own dependency-free PRs pytorch#203548 pytorch#203550 pytorch#203551):
class-level @requires_gpu_and_triton replaced by per-test Triton gates and
instantiate_device_type_tests(..., except_for="cpu", allow_xpu=True); 12 of 14
tests gain the injected device argument; write_cubin_to_tmp picks the binary
key per device (npubin alongside zebin/cubin/hsaco); the JITFunction getitem
save becomes unconditional (module scope) and the patch install moves into
setUp/tearDown of every instantiated device variant.
gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 14, 2026
…via instantiate_device_type_tests

Independent slice (launcher migration only; the three unit-class splits moved
out of this PR to their own dependency-free PRs pytorch#203548 pytorch#203550 pytorch#203551):
class-level @requires_gpu_and_triton replaced by per-test Triton gates and
instantiate_device_type_tests(..., except_for="cpu", allow_xpu=True); 12 of 14
tests gain the injected device argument; write_cubin_to_tmp picks the binary
key per device (npubin alongside zebin/cubin/hsaco); the JITFunction getitem
save becomes unconditional (module scope) and the patch install moves into
setUp/tearDown of every instantiated device variant.

Rebase notes (onto main after pytorch#199309): main's two new oversized shared memory
tests (test_oversized_shared_mem, test_too_high_oversized_shared_mem) are kept
and converted to this PR's per-device form: injected device argument, per-test
Triton gate, and a CUDA-only SkipTest guard since the shared helper
_oversized_shared_mem_limits() reads torch.cuda device properties. The
from pathlib import Path import is restored because
test_make_launcher_reuses_loaded_kernel_after_cache_context still calls Path();
without it the PR head raises NameError (undefined-name check on the pre-rebase
head confirms this predates the rebase).
@gavinwang269
gavinwang269 marked this pull request as ready for review November 16, 2026 06:32
gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 16, 2026
…via instantiate_device_type_tests

Independent slice (launcher migration only; the three unit-class splits moved
out of this PR to their own dependency-free PRs pytorch#203548 pytorch#203550 pytorch#203551):
class-level @requires_gpu_and_triton replaced by per-test Triton gates and
instantiate_device_type_tests(..., except_for="cpu", allow_xpu=True); 12 of 14
tests gain the injected device argument; write_cubin_to_tmp picks the binary
key per device (npubin alongside zebin/cubin/hsaco); the JITFunction getitem
save becomes unconditional (module scope) and the patch install moves into
setUp/tearDown of every instantiated device variant.

Rebase notes (onto main after pytorch#199309): main's two new oversized shared memory
tests (test_oversized_shared_mem, test_too_high_oversized_shared_mem) are kept
and converted to this PR's per-device form: injected device argument, per-test
Triton gate, and a CUDA-only SkipTest guard since the shared helper
_oversized_shared_mem_limits() reads torch.cuda device properties. The
from pathlib import Path import is restored because
test_make_launcher_reuses_loaded_kernel_after_cache_context still calls Path();
without it the PR head raises NameError (undefined-name check on the pre-rebase
head confirms this predates the rebase).

Rebase notes (onto main after pytorch#198440): pytorch#198440 refactored the unrelated
TestFastLauncherCompileResult class and moved the file's
instantiate_device_type_tests calls into a single trailing group; this PR's
TestStaticTritonLauncher instantiation now joins that group. The import-block
and tail hunks merged accordingly; nothing inside the decoupled class changed.
gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 17, 2026
…via instantiate_device_type_tests

Independent slice (launcher migration only; the three unit-class splits moved
out of this PR to their own dependency-free PRs pytorch#203548 pytorch#203550 pytorch#203551):
class-level @requires_gpu_and_triton replaced by per-test Triton gates and
instantiate_device_type_tests(..., except_for="cpu", allow_xpu=True); 12 of 14
tests gain the injected device argument; write_cubin_to_tmp picks the binary
key per device (npubin alongside zebin/cubin/hsaco); the JITFunction getitem
save becomes unconditional (module scope) and the patch install moves into
setUp/tearDown of every instantiated device variant.
gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 17, 2026
…RIC hardware-classification class

Part of splitting pytorch#192893 (one class per PR, zero overlap).

Last PR of the static-launcher split series: as the final step it also
drops the file's entry from tools/linter/adapters/test_linter_allowlist.json,
so the in-tree test linter runs in enforcement mode on the whole file once
the sibling slices (pytorch#198437, pytorch#198438, pytorch#198439, pytorch#198440, pytorch#203548, pytorch#203550,
pytorch#203551, pytorch#205277) have landed - each of which owns its own class region.
This PR is meant to merge strictly last.

Test Plan

- the Unit class body contains no accelerator API usage, so the GENERIC
  declaration is clean under the linter's AcceleratorApiRule (verified
  with the allowlist entry removed);
- with all sibling PRs applied, TEST_LINTER reports zero errors for the
  file in enforcement mode.
gavinwang269 added a commit to gavinwang269/pytorch that referenced this pull request Nov 18, 2026
…RIC hardware-classification class

Part of splitting pytorch#192893 (one class per PR, zero overlap).

Last PR of the static-launcher split series: as the final step it also
drops the file's entry from tools/linter/adapters/test_linter_allowlist.json,
so the in-tree test linter runs in enforcement mode on the whole file once
the sibling slices (pytorch#198437, pytorch#198438, pytorch#198439, pytorch#198440, pytorch#203548, pytorch#203550,
pytorch#203551, pytorch#205277) have landed - each of which owns its own class region.
This PR is meant to merge strictly last.

Test Plan

- the Unit class body contains no accelerator API usage, so the GENERIC
  declaration is clean under the linter's AcceleratorApiRule (verified
  with the allowlist entry removed);
- with all sibling PRs applied, TEST_LINTER reports zero errors for the
  file in enforcement mode.
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-aarch64-cuda13.2-py3.12-gcc13-sm100 / test (smoke_b200, 1, 1, nv-l-arm64grace-16-200-gb300). Blocking jobs that the merge waited on for a Dr.CI or AI CI Advisor classification: 1.

Details for Dev Infra team

Raised by workflow job

@gavinwang269

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / linux-jammy-aarch64-cuda13.2-py3.12-gcc13-sm100 / test (smoke_b200, 1, 1, nv-l-arm64grace-16-200-gb300)

Details for Dev Infra team

Raised by workflow job

@gavinwang269

Copy link
Copy Markdown
Contributor Author

@pytorchbot rebase

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

…ssified unit class

The three global-scratch unit tests in TestStaticTritonLauncherUnit are
RoCm-incompatible (@skipIfRocm or hip-only) and keep the otherwise
device-independent unit class from being declared GENERIC. pytorch#203548
already established TestStaticTritonLauncherUnitCuda for exactly this
purpose and pre-delegated the _global_scratch_kernel helper, so the
tests move there verbatim instead of introducing a second class.

Test Plan:

    python -m pytest test/inductor/test_static_triton_launcher.py -q
…ncherUnitCuda

b334498 moved test_rocm_rejects_global_scratch into
TestStaticTritonLauncherUnitCuda, which made the class docstring wrong: it
claimed the class cannot run on RoCm, that TestStaticTritonLauncherUnit was
left with only device-independent tests (the two skipIfRocm metadata-group
tests stay there until pytorch#203551 moves them), and named a CUDAAutotuner that
exists nowhere; the code uses CachingAutotuner. The "not instantiated"
sentence also never held after the class landed with
instantiate_parametrized_tests and a parametrize-decorated test.

Shorten the docstring accordingly, keeping only statements that hold at this
commit: CUDA-family (CUDA and ROCm) launcher unit tests split out of the
unit class, shared helpers delegated by reference.

Test Plan:

    python3 -c "import ast; ast.parse(open('test/inductor/test_static_triton_launcher.py').read())"

Docstring-only diff; no behavior to exercise beyond the AST check.
…cstring

f72c3ea described the class as covering the CUDA-family launcher
runtime "(CachingAutotuner / StaticallyLaunchedCudaKernel)". CachingAutotuner
is not CUDA-family: it lives in the device-generic Triton runtime
(torch/_inductor/runtime/triton_heuristics.py) and the sibling
TestStaticTritonLauncherUnit exercises it device-independently, e.g.
test_build_fast_launcher_unsupported_device with "privateuseone".

What this class covers are the CUDA/ROCm paths of CachingAutotuner and
StaticallyLaunchedCudaKernel: the autotuner fast-launcher build with
device_props type "cuda", StaticallyLaunchedCudaKernel scratch rejection,
and the hip-only global-scratch test. Reword the docstring around that,
note once that CachingAutotuner itself is device-generic, and keep the
split-from-unit-class and by-reference helper delegation statements.

Test Plan:

    python3 -I -c "import ast; ast.parse(open('test/inductor/test_static_triton_launcher.py').read())"

Docstring-only diff (+5/-5); no behavior to exercise beyond the AST check.
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Successfully rebased stl/p-unit-rocm3 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout stl/p-unit-rocm3 && git pull --rebase)

@gavinwang269

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@gavinwang269

Copy link
Copy Markdown
Contributor Author

@pytorchbot drci

pytorchmergebot pushed a commit that referenced this pull request Dec 3, 2026
…via instantiate_device_type_tests (#198437)

## Current state (2026-12-02)

- Head `879a6d25a2f3`, rebased onto main on Dec 1. One file changed: `test/inductor/test_static_triton_launcher.py`.
- All 213 checks on the head are completed with nothing failing (208 success, 4 skipped, 1 neutral), and none waiting for approval.
- All 16 review threads are resolved. Each carries a reply, and the two that still cited a pre-rebase head were re-verified against this head today with line numbers.
- Labels: `topic: not user facing`, `ready for review`, `module: tests/graph`, `ciflow/inductor`, `ciflow/xpu`.
- Waiting on one approving review from a member of the merge-rules approver lists. The two content approvals so far (lizhihai137 on Nov 2, KarhouTam on Dec 1) are from contributors outside those lists, so the merge bot still reports the PR as needing additional approval.

## Summary

Launcher-migration slice of the static-launcher file (the original #192893 monolith has been re-cut into dependency-free, review-sized PRs per #198436's review request; this PR is +363/-324 in one file; the unit-class splits are in #203548 (Triton-gated autotuner), #203550 (RoCm scratch trio), #203551 (cubin metadata pair), each with its own correctly-scoped class; merge in any order).

## Changes (one file: test/inductor/test_static_triton_launcher.py)

`TestStaticTritonLauncher` on main is a `@requires_gpu_and_triton` class with 24 test methods bound to `GPU_TYPE`. It is made device-agnostic via `instantiate_device_type_tests(..., except_for="cpu", allow_xpu=True)` with `hw_classification = HardwareClassification.ACCELERATOR`. All 24 tests are kept; where each one lives:

- 13 general launcher tests stay in `TestStaticTritonLauncher` (ACCELERATOR). All 13 now take the injected `device` and pass it to `self._make_launcher(compiled_kernel, device)`, so the binary key (`cubin`/`zebin`/`npubin`/`hsaco`), the launcher class and the load interface resolve from the device under test instead of `GPU_TYPE`. `test_bfloat16_scalar` swaps its process-wide `@skipIfRocm` / `@unittest.skipIf(not HAS_XPU_AND_TRITON and not SM80OrLater, ...)` guards for the device-aware `@skipCUDAIfRocm` / `@skipCUDAIf(not SM80OrLater, ...)` from `common_device_type`.
- The removed class-level `@requires_gpu_and_triton` is replaced by a `setUp` gate that is per-device rather than process-wide: `has_triton_for_device(self.device_type)` so a backend without Triton skips even when another backend has it, and `is_registered_static_launch_device(self.device_type)` (only cuda, hip and xpu register a static launcher) so Triton-capable but launcher-less backends skip instead of raising.
- The 8 `test_xpu_*` tests move to a new `TestStaticTritonLauncherXpuOnly` (`hw_classification = XPU`, keeps the class-level `@requires_gpu_and_triton` and its per-test `@unittest.skipUnless(HAS_XPU_AND_TRITON, ...)` decorators), instantiated `only_for="xpu", allow_xpu=True`, mirroring `TestFastLauncherXpuOnly` from #198439.
- The two oversized-shared-memory tests (`test_oversized_shared_mem`, `test_too_high_oversized_shared_mem`, both on main via #199309; their helper reads `torch.cuda.get_device_properties`) move to a new `TestStaticTritonLauncherCudaOversized` (`hw_classification = CUDA`), instantiated `only_for=("cuda",)` with a `setUp` skip for `self.device_type != "cuda"` (plus a runtime `has_triton_for_device` skip), the way `TestCudaStaticTritonCompileResult` is scoped. Their `@skipIfRocm` is kept; `@skipIfXpu` and the body-level `SkipTest` guards are dropped because the class is CUDA-only.
- `test_launcher_keeps_module_owner_alive_until_release` moves into `TestStaticTritonLauncherUnit`, the host-side unit class, so the module-owner lifetime check runs once without a working Triton device.
- The `instantiate_device_type_tests` calls for the three launcher classes sit in the file's single trailing group, the shape #198440 established.

No helper or other class is touched: `StaticLauncherTestMixin` already takes optional `device` arguments on main (landed via #198439/#198440), and `TestFastLauncher` plus the compile-result classes keep their current scoping.

## Notes

- No dependency on the sibling split PRs; the overlapping import lines collapse to one copy at rebase.
- MTIA: the ACCELERATOR class is instantiated for accelerator device types with `except_for="cpu"`; no MTIA base is registered, so no MTIA variants are generated. This is a coverage note for #198436's open question, not a regression on currently-tested devices.

## Verification

- [x] CPU wheel env (torch 2.16.0.dev20261029+cpu): `TestStaticTritonLauncherUnit` failure set identical to the pre-change head (28 tests; the two failures are preexisting wheel-vs-trunk artifacts already present before this PR's edits, 3 skips)

```
python test/inductor/test_static_triton_launcher.py TestStaticTritonLauncherUnit
```

- [x] `ast.parse` clean; ruff 0.14.4 with the repo config: `check` and `format --check` clean on the file; in-tree `test_linter` run with this file's allowlist entry temporarily removed: no findings in this PR's three launcher classes (the remaining file-level findings belong to the unit-class and fast-launcher regions tracked in #198436 and the fast-launcher follow-up)
- [ ] `ciflow/xpu` label requested so this PR's CI actually exercises the XPU instantiations (the 13 ACCELERATOR tests on xpu and the 8-test XPU-only class); CUDA CI covers the cuda instantiations and the new CUDA-only class
- No XPU, CUDA or NPU device is available in this environment, so the device-generic skips above are static-reasoning plus CI, not test-run evidence.

## Linked issue or supporting maintainer

Part of #185590 (test case refactoring initiative), hardware-decoupling slice.
Pull Request resolved: #198437
Approved by: https://github.com/lizhihai137, https://github.com/KarhouTam, https://github.com/jansel
@gavinwang269

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command
For more information see pytorch-bot wiki.

@gavinwang269

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

@gavinwang269

Copy link
Copy Markdown
Contributor Author

Landed as 4d5a61dc18c9. That is the whole static-launcher testcase family home: #203548, #203551, #203550, plus the feature sibling #206703. Thank you @jansel for carrying all three of these in one pass - the out-of-tree backends now run the launcher coverage through common_utils instead of skipping it. Appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-retriage Re-run Auto PR Triage bot-triaged This is a label only to be used by the auto triage bot ciflow/inductor ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/trunk Trigger trunk jobs on your pull request in progress PR is being worked on by the author, until the automated review accepts it Merged module: inductor module: rocm AMD GPU support for Pytorch module: tests/graph This label covers all test cases within the Graph sheet. open source ready for review Automated review passed, ready for a final review by a maintainer. topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants