Skip to content

[Testcase Refactoring] Decouple test_compile_subprocess.py from CUDA-specific - #193761

Draft
pengyeqing wants to merge 1 commit into
pytorch:mainfrom
pengyeqing:test/inductor-subprocess-decouple-cuda
Draft

[Testcase Refactoring] Decouple test_compile_subprocess.py from CUDA-specific#193761
pengyeqing wants to merge 1 commit into
pytorch:mainfrom
pengyeqing:test/inductor-subprocess-decouple-cuda

Conversation

@pengyeqing

@pengyeqing pengyeqing commented Aug 17, 2026

Copy link
Copy Markdown

Summary

This PR replaces hardcoded CUDA references with device-agnostic equivalents so out-of-tree accelerator backends can run these tests.

Changes

  • Add hw_classification = HardwareClassification.GENERIC|ACCELERATOR|CUDA|CPU to tests class.
  • Repalce HAS_TRITON with @requires_capabilities(Capability.lib.triton) at test cases.

Motivation

torch.cuda only recognizes CUDA. New accelerators (e.g., PrivateUse1-based out-of-tree backends) are silently skipped even when enough devices are available. A generic decorator lets inductor tests adapt to any accelerator supported by torch.accelerator.

Test Plan

  • CI: python test/inductor/test_compile_subprocess.py --hw-classification GENERIC ACCELERATOR CUDA CPU XXX
  • Verified test cases correctly on CPU, GPU, XPU.

Notes

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo

…specific

Summary:
- Add `hw_classification = HardwareClassification.GENERIC|ACCELERATOR|CUDA|CPU` to tests class.
- Repalce `HAS_TRITON` with `@requires_capabilities(Capability.lib.triton)` at test cases.

This allows out-of-tree accelerators to be recognized correctly when
deciding whether a inductor test has enough devices to run.

Signed-off-by: Yeqing Peng <846295776@qq.com>
@pytorch-bot

pytorch-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🔗 Helpful Links

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

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

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

@pytorch-bot

pytorch-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:

  • ciflow/inductor

Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows.

@pengyeqing

Copy link
Copy Markdown
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 Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/inductor module: inductor module: tests/graph This label covers all test cases within the Graph sheet. open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants