Out-of-tree (OOT) accelerator backends need to maintain compatibility with PyTorch’s evolving codebase. As PyTorch continues to develop rapidly, changes in the upstream repository can potentially break downstream accelerator integrations. To address this challenge, PyTorch provides a Cross-Repository CI Relay (CRCR) mechanism that enables automatic CI coordination between the PyTorch repository and downstream accelerator repositories.
This chapter guides third-party accelerator vendors through the process of integrating their repositories with PyTorch’s CI ecosystem, ensuring continuous compatibility validation.
Why CI Integration Matters
Integrating with PyTorch’s CI ecosystem provides several key benefits:
Early Detection: Catch compatibility issues before they reach production, reducing debugging effort and user impact.
Automated Validation: Automatically test your accelerator against PyTorch PRs without manual intervention.
Reduced Maintenance Burden: Proactive testing reduces the need for reactive fixes when compatibility breaks.
How It Works
The CRCR system consists of four components: a GitHub App that bridges authentication and events, the PyTorch repository as the upstream event source, a Relay Server that dispatches events to eligible downstream repos, and downstream repositories that receive events and optionally report results back.
When a PR is opened or updated in PyTorch, GitHub notifies the Relay Server via the GitHub App. The Relay Server verifies the event, reads the allowlist, and dispatches a repository_dispatch event to each registered downstream repository. Downstream repos can optionally report CI results back to the Relay Server, which surfaces them in the PyTorch HUD or as PR check runs.
Create a test PR in PyTorch (or ask maintainers to trigger a test dispatch)
Confirm your workflow triggers correctly
Event Payload
The CRCR relay is a stateless pass-through: it forwards the complete GitHub webhook payload as client_payload in the repository_dispatch event. There is no simplified intermediary schema.
The client_payload has two top-level fields:
event_type: either pull_request or push
payload: the raw GitHub webhook payload for that event type
Commonly used fields:
github.event.client_payload.event_type# "pull_request" or "push"github.event.client_payload.payload.action# "opened", "synchronize", "reopened" or "closed" onlygithub.event.client_payload.payload.pull_request.number# PR number (pull_request events only)github.event.client_payload.payload.pull_request.head.sha# Head commit SHA to checkoutgithub.event.client_payload.payload.after# Commit SHA (push events only)
Supported action values for pull_request events:
Action
Description
opened
New PR created
synchronized
New commits pushed to an existing PR
reopened
Troubleshooting
Workflow Not Triggering
Confirm your onboarding with the PyTorch team is complete
Check that your workflow file is on the default branch
Ensure the repository_dispatch event type in your workflow matches what the relay sends