pytorch - 💡(How to fix) Fix [Test] PyTorch Test Case Refactoring and Track

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

  • Accelerator-unrelated: These should run on the CPU since they target generic features (such as the Dispatcher) and have no ties to any accelerator.
  • Accelerator-related:
      • Accelerator-agnostic: These are generic across hardware and should be tested across different accelerators.
      • Accelerator-specific: These are strictly limited to a particular accelerator.
RAW_BUFFERClick to expand / collapse

Background and Acknowledgments

To better support and empower new hardware accelerators, we have been planning and designing the refactoring of the test cases in PyTorch since the beginning of this year. After rounds of discussions and iterations, the proposal and action plan have finally been finalized today.

We would like to extend our special thanks to @albanD, @malfet, @mikaylagawarecki, @jbschlosser for providing comprehensive guidance and technical support throughout this process. Thank you all for collaborating to push this initiative into action!

Core Goals

The core direction of this refactoring is to break the tight coupling between existing test cases and specific hardware. We are systematically categorizing the test suite into the following three dimensions:

  • Accelerator-unrelated: These should run on the CPU since they target generic features (such as the Dispatcher) and have no ties to any accelerator.
  • Accelerator-related:
      • Accelerator-agnostic: These are generic across hardware and should be tested across different accelerators.
      • Accelerator-specific: These are strictly limited to a particular accelerator.

Our ultimate goal is to enable new hardware backends to seamlessly reuse PyTorch's extensive existing test suite, allowing teams to ensure delivery quality more efficiently and avoid reinventing the wheel.

Tracking Sheet, Workflow, and Ownership

We have conducted a comprehensive audit of all test files that require refactoring and organized them into a central tracking sheet. This document contains the technical directions, standard refactoring workflows, and specific community ownership assignments. Everyone is welcome to review it and share your feedback!

This is a long-term, systemic effort that requires the joint cooperation of the entire PyTorch community. We highly welcome and encourage Maintainers and Contributors to participate and claim your modules. Thank you!

Note: Subsequent optimizations and new thoughts will be continuously supplemented into this spreadsheet.

Related Issues and Technical Context

This Tracking Issue consolidates and extends several prior discussions within the community. The following two issues share the exact same goal as this refactoring initiative and provide crucial underlying technical context, serving as perfect complements to this plan:

  • #174469
  • #185142

Looking forward to great discussions and contributions in the Slack channel and PR reviews!

cc @mruberry

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix [Test] PyTorch Test Case Refactoring and Track