Repository navigation
[Testcase Refactoring] Make TestStaticTritonCompileResult device-agnostic via instantiate_device_type_tests - #198438
gavinwang269 wants to merge 1 commit into
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - OUTDATED (earlier commit) - Ready for human review:
Findings (1): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/198438
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit eac52d7 with merge base d29e9dd ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@pytorchbot label "module: tests/graph" |
7d05f17 to
8b1e6ff
Compare
8b1e6ff to
941aea4
Compare
941aea4 to
5ad9c39
Compare
|
Rebased onto current main after #198440 landed (5ad9c39, one commit). The only conflict was the trailing All CI workflows on the new head (Lint, BC Lint, docs-build, pull) are sitting at |
|
cc @jansel Two asks below: (1) a favor on CI, (2) a skim if you have a few minutes. What this is One review-sized slice of the Shape and size
The CI favor Right now 0 of the CI checks have actually run. The four checks on the fork The skim If you have a few minutes, I would value a quick read of this one class. It is Thanks! |
…mpileResult Responds to the automated CHANGES_REQUESTED review on pytorch#198438. Blocking (test/REVIEW.md Rules 1/2): test_oversized_shared_mem_mm_template and test_basic_compile_pdl are CUDA-only (the former reads CUDA device properties and builds a CUDAMMTemplateConfigHeuristic; the latter gates on SM90OrLater and PDL, supported only by StaticallyLaunchedCudaKernel), so they move to a new TestCudaStaticTritonCompileResult (hw_classification CUDA, instantiated only_for=("cuda",)), following the merged pytorch#198440 split of TestFastLauncherCompileResult in this file. The rebase-introduced "!= cuda" body guard and skipIfXpu are superseded by the CUDA-only instantiation: filter_desired_device_types normalizes out-of-tree backend names to "privateuse1", which only_for drops, so the class is never instantiated for PrivateUse1 and the torch.cuda reads happen only on cuda. That also resolves the crash the guard was introduced for in the sibling pytorch#198437 rebase (a PrivateUse1 variant raising in torch.cuda.current_device() instead of skipping): with the tests out of the except_for="cpu" class no other accelerator instantiates them, and the shared per-device setUp gates skip before the body runs even if PYTORCH_TESTING_DEVICE_FOR_CUSTOM opts a PrivateUse1 base into the CUDA class. Non-blocking: the eight host-wide unittest.skipIf(not has_triton()) decorators and the missing gate on test_basic_compile_pdl are replaced by one has_triton_for_device check plus an is_registered_static_launch_device check in the shared _StaticTritonCompileResultMixin setUp, placed before the config patch is entered (tearDown does not run when setUp raises), following pytorch#198359; test_disable_static_triton_launcher is exempt from the registration gate because it runs with the launcher off, where strict mode raising CannotStaticallyLaunchKernel was the other failure mode. test_custom_op_bad_fake_dtype_fails_fast stays in the ACCELERATOR class; its host-wide skipIfXpu becomes skipXPUIf from common_device_type (Rule 4), which no longer skips the CUDA variant on TEST_XPU hosts, with a reason that no longer claims the dtype check is CUDA launcher-specific (it comes from the generic assert_tensor_metadata wrapper codegen); the XPU exclusion is kept because the fail-fast path has never been verified there (Rule 6). skipIfRocm moves with the two tests into the CUDA class, where Rule 5 adds no requirements, and SM90OrLater keeps its decorator for the same reason. Stale "static cuda launcher" wording in the class docstring and the disable-test comment is corrected. Test Plan: no working torch environment on the machine that prepared this commit, so verification was static: ``` python -c "import ast; ast.parse(open('test/inductor/test_static_triton_launcher.py').read())" ``` plus AST checks of final class membership (ACCELERATOR keeps the seven device-agnostic tests; the CUDA class holds only the two moved tests), line-length and ASCII checks on changed lines, and grep of the instantiate wiring. CI exercises the CUDA variants of both classes. Authored with AI assistance and reviewed by the PR owner before submission. Co-Authored-By: gavinwang269 <[email protected]>
|
@pytorchbot review |
1ff6807 to
a5e8b69
Compare
…stic via instantiate_device_type_tests [Testcase Refactoring] make TestStaticTritonCompileResult device-agnostic via instantiate_device_type_tests Part of splitting pytorch#192893 (one class per PR, zero overlap). Rebase notes (onto current main): main added test_oversized_shared_mem_mm_template to this class after the branch was cut. It is 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 helper _oversized_shared_mem_limits() reads torch.cuda device properties. The instantiate call joins the trailing instantiate_device_type_tests group introduced by pytorch#198440.
a5e8b69 to
eac52d7
Compare
…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.
|
cc @jansel - the CompileResult companion of the classes you approved in #198439/#198440: TestStaticTritonCompileResult becomes ACCELERATOR-classified and instantiated (except_for cpu, allow_xpu), all nine tests already take the injected device, Triton gating moved to per-device skipIf. +128/-77, one file, rebased onto current main. Ready for your review and merge. |
…t in static launcher tests Summary Follow-up fixups on the rebased head of this PR; restores content this PR's own description says is present but the current pushed head lacks: - the rebase conflict resolution dropped the module-level `from pathlib import Path` import while `Path(compile_path)` is still used in test_make_launcher_reuses_loaded_kernel_after_cache_context (latent NameError); - the two oversized-shared-memory tests lost their per-device conversion (injected device argument, CUDA-only SkipTest guard ahead of the shared helper's torch.cuda.current_device(), per-test Triton gate); - TestStaticTritonLauncherXpuOnly did not inherit StaticLauncherTestMixin although its tests call self._make_launcher and self.write_cubin_to_tmp (AttributeError on the XPU shard); - two XPU-specific tests, test_xpu_non_default_warp_size and test_xpu_launch_rejects_non_kernel_capsule, were deleted instead of moved when the XPU-only tests split into that class; they are restored verbatim, so the class holds all eight XPU-specific tests of the old launcher class. Test Plan - python -m py_compile on the patched file; - in-tree test linter (tools/linter/adapters/test_linter.py) with the file's allowlist entry removed: zero errors in this PR's class regions; the remaining 12 file errors belong to pytorch#198436 (Unit declaration), pytorch#198438 (CompileResult) and pytorch#205277 (fast launcher), identical to the pre-fixup attribution; - cpu wheel (torch-2.16.0.dev20261102+cpu) venv run of the patched file: failure set byte-identical to the unpatched pushed head (10 known wheel-vs-trunk drift artifacts), i.e. no regression; - the eight XpuOnly tests execute on the CI XPU shards only (only_for="xpu"); no local XPU hardware here.
|
@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 |
…t in static launcher tests Summary Follow-up fixups on the rebased head of this PR; restores content this PR's own description says is present but the current pushed head lacks: - the rebase conflict resolution dropped the module-level `from pathlib import Path` import while `Path(compile_path)` is still used in test_make_launcher_reuses_loaded_kernel_after_cache_context (latent NameError); - the two oversized-shared-memory tests lost their per-device conversion (injected device argument, CUDA-only SkipTest guard ahead of the shared helper's torch.cuda.current_device(), per-test Triton gate); - TestStaticTritonLauncherXpuOnly did not inherit StaticLauncherTestMixin although its tests call self._make_launcher and self.write_cubin_to_tmp (AttributeError on the XPU shard); - two XPU-specific tests, test_xpu_non_default_warp_size and test_xpu_launch_rejects_non_kernel_capsule, were deleted instead of moved when the XPU-only tests split into that class; they are restored verbatim, so the class holds all eight XPU-specific tests of the old launcher class. Test Plan - python -m py_compile on the patched file; - in-tree test linter (tools/linter/adapters/test_linter.py) with the file's allowlist entry removed: zero errors in this PR's class regions; the remaining 12 file errors belong to pytorch#198436 (Unit declaration), pytorch#198438 (CompileResult) and pytorch#205277 (fast launcher), identical to the pre-fixup attribution; - cpu wheel (torch-2.16.0.dev20261102+cpu) venv run of the patched file: failure set byte-identical to the unpatched pushed head (10 known wheel-vs-trunk drift artifacts), i.e. no regression; - the eight XpuOnly tests execute on the CI XPU shards only (only_for="xpu"); no local XPU hardware here.
…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.
… Triton device Summary Review feedback: test_launcher_keeps_module_owner_alive_until_release builds fake kernel-owner and launcher objects, never touches the device argument it receives, and only checks weakref/gc lifetime behavior, yet it lived in TestStaticTritonLauncher, whose except_for="cpu" instantiation and per-test Triton skip mean the ownership check cannot run on a CPU-only shard. Upstream has no host launcher test file yet, so move the test as-is into TestStaticTritonLauncherUnit in the same file, the device-agnostic unit class that already hosts the adjacent fake-owner lifetime checks, and drop the unused device parameter and the Triton gate. The test body is otherwise byte-identical. Test Plan - python -m py_compile on the patched file; - in-tree test linter (tools/linter/adapters/test_linter.py) with the file's allowlist entry removed: 11 findings on the patched file, identical to the previous head (all pre-existing, attributed to pytorch#198436 Unit hw_classification declaration, pytorch#198438 and pytorch#205277), i.e. zero new violations from this move; - AST scan: single definition of the moved test, no undefined names, no doubled decorators; gc/weakref/has_triton imports remain referenced elsewhere in the file; - no built torch in this environment, so the moved test was not executed locally; as a device-less unit test it now runs in CI on CPU shards.
… XPU-only launcher class Summary Two inline review items at bef2f7b: TestStaticTritonLauncher gates its compile-on-device launcher cases with a process-wide has_triton() skipIf, but the class is instantiated for multiple backends, so a backend without Triton would still run these cases whenever any other accelerator has Triton. Replace the thirteen per-test decorators with one per-device gate in setUp using has_triton_for_device, the same convention _StaticTritonCompileResultMixin already uses in this file; the two compiling cases that carried no Triton gate (test_float_scalars, test_bfloat16_scalar) are covered as a side effect, and skipping ahead of super() keeps the mixin's XPU JITFunction patch from being applied. The instantiate_device_type_tests call for TestStaticTritonLauncherXpuOnly passed only_for="xpu" without allow_xpu, so no XPU class was ever emitted: XPUTestBase joins the candidate bases only under allow_xpu=True, and the filter then removed everything else. Pass allow_xpu=True, matching the file's five other instantiations, so the restored XPU-only launcher tests collect on XPU shards. Test Plan - python -m py_compile and ast.parse on the patched file. - CPU wheel venv (torch 2.16.0.dev20261029+cpu, torch_npu installed so PrivateUse1=npu instantiates): module collection is 50 tests with no loader errors, unchanged from the pre-change head; the instantiated TestStaticTritonLauncherNPU test now skips via the new gate ("requires Triton on npu"); the device-free TestStaticTritonLauncherUnit result set is identical to the pre-change head (28 run, 23 pass, 3 skip, 2 known wheel-vs-trunk drift failures). - allow_xpu verified against the helper with XPU availability simulated: get_desired_device_type_test_bases(only_for="xpu") returns no bases without allow_xpu and the xpu base with it; instantiating a dummy template with the new kwargs emits its XPU class while the old kwargs emit none. This host has no XPU hardware, so real XPU collection runs on the CI XPU shards. - in-tree test linter (tools/linter/adapters/test_linter.py) with the file's allowlist entry removed: 11 findings on the patched file, identical to the previous head (all pre-existing, attributed to pytorch#198436 Unit hw_classification declaration, pytorch#198438 and pytorch#205277), i.e. zero new violations from these fixes. Authored with the assistance of an AI coding assistant.
…align hw classifications Summary Follow-up to pytorch#198439/pytorch#198440 for the fast-launcher classes, in preparation for removing the file's test-linter allowlist entry: - the eight tests in TestFastLauncher that still picked their device from the GPU_TYPE global (float/scalar/ABI families) now take the injected device parameter used by their siblings; - TestFastLauncher and TestFastLauncherFallbackCompileResult are reclassified ACCELERATOR -> CUDA. Both classes only generate cuda and xpu variants (their instantiate calls, kept untouched, use only_for=("cuda","xpu")), and their extension selection requires _FastCudaLauncher/_FastXpuLauncher - a promise no PrivateUse1 backend has signed. The ACCELERATOR label overpromised, and the test linter accordingly forbids only_for on ACCELERATOR classes. Once pytorch#204896 lands the tuple labels, the honest end state is (CUDA, XPU) and this classification follows suit; - TestFastLauncherXpuOnly, the mixins and the CUDA-only compile class are unchanged. Test Plan - TEST_LINTER simulated with the file's allowlist entry removed: all ten errors owned by these two classes (eight device_param plus two only_for) clear; the remaining file errors belong to sibling PRs pytorch#198437/pytorch#198438/pytorch#198436; - cpu-wheel venv: skip/pass profile consistent with the pristine base (wheel-vs-trunk drift artifacts reproduce identically); CUDA/XPU legs run on the respective CI shards.
…t in static launcher tests Summary Follow-up fixups on the rebased head of this PR; restores content this PR's own description says is present but the current pushed head lacks: - the rebase conflict resolution dropped the module-level `from pathlib import Path` import while `Path(compile_path)` is still used in test_make_launcher_reuses_loaded_kernel_after_cache_context (latent NameError); - the two oversized-shared-memory tests lost their per-device conversion (injected device argument, CUDA-only SkipTest guard ahead of the shared helper's torch.cuda.current_device(), per-test Triton gate); - TestStaticTritonLauncherXpuOnly did not inherit StaticLauncherTestMixin although its tests call self._make_launcher and self.write_cubin_to_tmp (AttributeError on the XPU shard); - two XPU-specific tests, test_xpu_non_default_warp_size and test_xpu_launch_rejects_non_kernel_capsule, were deleted instead of moved when the XPU-only tests split into that class; they are restored verbatim, so the class holds all eight XPU-specific tests of the old launcher class. Test Plan - python -m py_compile on the patched file; - in-tree test linter (tools/linter/adapters/test_linter.py) with the file's allowlist entry removed: zero errors in this PR's class regions; the remaining 12 file errors belong to pytorch#198436 (Unit declaration), pytorch#198438 (CompileResult) and pytorch#205277 (fast launcher), identical to the pre-fixup attribution; - cpu wheel (torch-2.16.0.dev20261102+cpu) venv run of the patched file: failure set byte-identical to the unpatched pushed head (10 known wheel-vs-trunk drift artifacts), i.e. no regression; - the eight XpuOnly tests execute on the CI XPU shards only (only_for="xpu"); no local XPU hardware here.
… Triton device Summary Review feedback: test_launcher_keeps_module_owner_alive_until_release builds fake kernel-owner and launcher objects, never touches the device argument it receives, and only checks weakref/gc lifetime behavior, yet it lived in TestStaticTritonLauncher, whose except_for="cpu" instantiation and per-test Triton skip mean the ownership check cannot run on a CPU-only shard. Upstream has no host launcher test file yet, so move the test as-is into TestStaticTritonLauncherUnit in the same file, the device-agnostic unit class that already hosts the adjacent fake-owner lifetime checks, and drop the unused device parameter and the Triton gate. The test body is otherwise byte-identical. Test Plan - python -m py_compile on the patched file; - in-tree test linter (tools/linter/adapters/test_linter.py) with the file's allowlist entry removed: 11 findings on the patched file, identical to the previous head (all pre-existing, attributed to pytorch#198436 Unit hw_classification declaration, pytorch#198438 and pytorch#205277), i.e. zero new violations from this move; - AST scan: single definition of the moved test, no undefined names, no doubled decorators; gc/weakref/has_triton imports remain referenced elsewhere in the file; - no built torch in this environment, so the moved test was not executed locally; as a device-less unit test it now runs in CI on CPU shards.
… XPU-only launcher class Summary Two inline review items at bef2f7b: TestStaticTritonLauncher gates its compile-on-device launcher cases with a process-wide has_triton() skipIf, but the class is instantiated for multiple backends, so a backend without Triton would still run these cases whenever any other accelerator has Triton. Replace the thirteen per-test decorators with one per-device gate in setUp using has_triton_for_device, the same convention _StaticTritonCompileResultMixin already uses in this file; the two compiling cases that carried no Triton gate (test_float_scalars, test_bfloat16_scalar) are covered as a side effect, and skipping ahead of super() keeps the mixin's XPU JITFunction patch from being applied. The instantiate_device_type_tests call for TestStaticTritonLauncherXpuOnly passed only_for="xpu" without allow_xpu, so no XPU class was ever emitted: XPUTestBase joins the candidate bases only under allow_xpu=True, and the filter then removed everything else. Pass allow_xpu=True, matching the file's five other instantiations, so the restored XPU-only launcher tests collect on XPU shards. Test Plan - python -m py_compile and ast.parse on the patched file. - CPU wheel venv (torch 2.16.0.dev20261029+cpu, torch_npu installed so PrivateUse1=npu instantiates): module collection is 50 tests with no loader errors, unchanged from the pre-change head; the instantiated TestStaticTritonLauncherNPU test now skips via the new gate ("requires Triton on npu"); the device-free TestStaticTritonLauncherUnit result set is identical to the pre-change head (28 run, 23 pass, 3 skip, 2 known wheel-vs-trunk drift failures). - allow_xpu verified against the helper with XPU availability simulated: get_desired_device_type_test_bases(only_for="xpu") returns no bases without allow_xpu and the xpu base with it; instantiating a dummy template with the new kwargs emits its XPU class while the old kwargs emit none. This host has no XPU hardware, so real XPU collection runs on the CI XPU shards. - in-tree test linter (tools/linter/adapters/test_linter.py) with the file's allowlist entry removed: 11 findings on the patched file, identical to the previous head (all pre-existing, attributed to pytorch#198436 Unit hw_classification declaration, pytorch#198438 and pytorch#205277), i.e. zero new violations from these fixes. Authored with the assistance of an AI coding assistant.
Summary
Make
TestStaticTritonCompileResultdevice-agnostic viainstantiate_device_type_tests,and move its CUDA-only tests to a new
TestCudaStaticTritonCompileResult.Split from #192893 (refactoring
test/inductor/test_static_triton_launcher.pyforout-of-tree accelerator support), one test class per PR so each piece is independent.
Changes
test/inductor/test_static_triton_launcher.py:TestStaticTritonCompileResult(hw_classification = ACCELERATOR, :1410) keeps the sevendevice-agnostic tests and is instantiated
except_for="cpu", allow_xpu=True(:2179-2181).The class-level
@requires_gpu_and_tritondecorator is gone: Triton availability is nowchecked per device in the shared setUp.
test_oversized_shared_mem_mm_templateandtest_basic_compile_pdlare CUDA launcherfeatures (silent recompile with
num_stages=1on oversized shared memory; PDL viaStaticallyLaunchedCudaKernel), so they move toTestCudaStaticTritonCompileResult(
hw_classification = CUDA, :1548), instantiatedonly_for=("cuda",)(:2182-2184) —following the merged [Testcase Refactoring] Split TestFastLauncherCompileResult into mixin, accelerator and CUDA-only classes #198440 split of
TestFastLauncherCompileResultin this same file,including the shared-mixin shape (
_StaticTritonCompileResultMixin:1384 mirrors_FastLauncherCompileMixin).super().setUp()— a testskipped in setUp never reaches tearDown, so the base classes' setUp state must not be
reached first (pattern per [Testcase Refactoring] Make test_bisect_pre_grad_graph device-agnostic via instantiate_device_type_tests #198359,
test/dynamo/test_compiler_bisector.py:145-148):has_triton_for_device(self.device_type)(:1394), andis_registered_static_launch_device(self.device_type)(:1401), which exempts
test_disable_static_triton_launcherby name prefix (:1398,instantiate_device_type_testsregisters device-suffixed names such astest_disable_static_triton_launcher_cuda) because that test runs with the launcher offand would otherwise hit
strict_static_triton_launcherraising instead of skipping onunregistered devices. The config patch
{"use_static_triton_launcher": True, "strict_static_triton_launcher": True}moves fromthe class decorator into setUp via
self.enterContext(...)(:1404-1407), whose cleanupruns even when setUp raises.
TestCudaStaticTritonCompileResult.setUpadditionally skips non-cudadevice types(:1555-1561):
PYTORCH_TESTING_DEVICE_FOR_CUSTOMre-adds matching device bases afteronly_foris applied (common_device_type.py:1251-1253, 1284-1287), so without this theoversized-shared-memory test could get a PrivateUse1 variant reading
torch.cudadeviceproperties.
test_custom_op_bad_fake_dtype_fails_faststays in the ACCELERATOR class; its host-wide@skipIfXpubecomes@skipXPUIf(True, ...)(:1471), which targets the XPU instantiationinstead of any TEST_XPU host (Rule 4), with a corrected reason: the fail-fast dtype check
comes from the generic
assert_tensor_metadatawrapper codegen, not a CUDA launcher path.The exclusion stands because the path has never run on XPU (Rule 6); happy to un-skip in a
follow-up once verified there.
Notes
skipXPUIf,has_triton_for_device,is_registered_static_launch_device); theinstantiate_device_type_tests/HardwareClassificationscaffold already lands with[Testcase Refactoring] Split TestFastLauncherCompileResult into mixin, accelerator and CUDA-only classes #198440 in the same file. Sibling pieces of this split touch only their own classes; where
both append
instantiate_device_type_tests(...)calls at the file end, resolution is aone-line keep-both.
GPU_TYPE-gated classes could resolve to MTIA on MTIArunners; no MTIA test base is registered here, so no MTIA variants are generated. A
coverage note, not a regression on currently-tested devices.
Motivation
The static Triton launcher tests are gated by
@requires_gpu_and_triton/GPU_TYPE,which only recognize in-tree devices (
cuda/mps/xpu/mtia): out-of-tree acceleratorsregistered via
PrivateUse1never run them. Migrating each class toinstantiate_device_type_tests+hw_classificationmakes the tests device-agnostic andclassifiable by
--hw-classificationfiltering. The registry gate keeps thestrict-launcher config from turning a missing out-of-tree static launcher into an error for
the tests that need one, while still letting
test_disable_static_triton_launcherexercise the launcher-off path on every Triton-capabledevice.
Test Plan
torch-2.15-cpu)5ad9c394:pytest test/inductor/test_static_triton_launcher.pycollects 69 tests -> 22 passed / 45 skipped / 2 failed, both failures reproducing identically on the unmodified main file (pre-existing); this class's instantiated variants collect zero on CPU-only, as designed (earlier branch-cut-base run: 8 passed / 26 skipped).The review-fix heads
8ed07571(CUDA-class split) and1ff6807ef0(setUp gate fixes)were verified statically —
python -c "import ast; ast.parse(open('test/inductor/test_static_triton_launcher.py').read())",AST/grep checks of final class membership and instantiate wiring, line-length/ASCII checks on
changed lines — because no working torch environment is available on the machine that prepared
them. CI exercises the CUDA variants of both classes; the per-device gates skip cleanly
elsewhere.
Authored with AI assistance and reviewed by the PR owner before submission.
Rebase note (2026-11-16): #198440 landed in this file and gathered the
instantiate_device_type_testscalls into a single trailing group; this PR's instantiation joins that group and its import lines dedup against main. Since the branch was cut, main also addedtest_any(already in device form) andtest_oversized_shared_mem_mm_templateto this class; the latter is converted here to the device-parameter form and now lives in the CUDA-only class. Re-verified on a CPU-only wheel at that point: the file collects 69 tests (22 passed / 45 skipped / 2 failed), both failures pre-existing on current main (reproduced identically on the unmodified main file); this class's instantiated variants collect zero on CPU-only, as designed. CUDA/NPU legs delegated to CI.cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @FFrog
Rebase note (2026-11-17): rebased onto current main after #198439/#198440 merged; the three review-round commits were squashed into one (the mixin split plus the device-suffixed exemption/skip-ordering fixes from the final round are all in). Diff unchanged in substance: mixin + TestStaticTritonCompileResult instantiation, gates skip before super().setUp(), config patch via enterContext.