Torch Spyre Integrates with PyTorch CRCR Using Automated Test Selection

A minimalist editorial illustration of a glowing relay switch focusing light through a crystal prism lens.

Torch Spyre has implemented Level 2 integration with PyTorch's Cross-Repository CI Relay (CRCR), establishing automated downstream continuous integration for out-of-tree hardware accelerators. The implementation combines an agentic test-selection pipeline with a declarative YAML adaptation framework, allowing backend developers to target upstream PyTorch developments without maintaining downstream code patches.

Automating Test Selection for Evolving Codebases

Out-of-tree PyTorch accelerators face non-trivial continuous integration challenges as they must validate three moving targets simultaneously: the backend codebase, PyTorch core, and PyTorch's vast suite of tens of thousands of tests. Manually curating relevant tests does not scale across frequent updates. Torch Spyre resolves this using a four-stage agentic pipeline that filters tests based on architectural extension points, generates a queryable repository memory index, executes static analysis, and refines selections based on real hardware execution logs.

The agentic framework translates selections into explicit configuration files containing human-readable rationale for every skipped or required test. When upgrading between PyTorch releases, such as moving from version 2.13 to 2.14, the pipeline analyzes only the modified delta of tests rather than evaluating the complete suite again, reducing test evaluations from tens of thousands to roughly 4,000 modified cases.

Declarative YAML Adaptation and Upstream Isolation

PyTorch core tests frequently contain CUDA-specific assumptions or parameter matrices across unsupported data types. Instead of patching upstream tests, Torch Spyre uses a declarative YAML interface that adjusts decorator execution hooks at runtime using pytest marks. Backend engineers can modify parameter lists, manage specific data type exclusions, or bucket test expectations into pass, expected failure, strict expected failure, or skip states without touching PyTorch core source code.

The declarative schema maintains single-point capability definitions. Declaring supported operators and data types globally automatically admits newly enabled hardware operations into test coverage. Unlisted tests fall back to declared default policies to ensure unexpected upstream additions do not silently break execution runs.

Handling Integration Dispatch Workflows

The CRCR system uses GitHub repository dispatches to alert downstream accelerators when pull requests land upstream. Torch Spyre's pipeline accounts for indirect GitHub landing flows by verifying specific merge labels while implementing direct SHA resolution patterns for unscheduled nightly builds and manual release branch validation. Execution efficiency is maintained by compiling PyTorch and backend wheels once per run before splitting hardware test tasks into balanced duration-constrained parallel splits.

AI-generated editorial illustration; not a documentary photograph.

Source: From Upstream Changes to Downstream Confidence: Inside Torch Spyre’s Integration with PyTorch CRCR

Share this article
FacebookThreadsLinkedInX

Leave a Reply

Your email address will not be published. Required fields are marked *