Skip to content

Refine L3 promotion criteria for downstream repositories - #102

Open
fffrog wants to merge 3 commits into
pytorch:masterfrom
fffrog:relay
Open

Refine L3 promotion criteria for downstream repositories#102
fffrog wants to merge 3 commits into
pytorch:masterfrom
fffrog:relay

Conversation

@fffrog

@fffrog fffrog commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR clarifies the L3 promotion criteria for downstream repositories by:

  • Defining infrastructure metrics more precisely (queue time, execution time, timeout rate).
  • Clarifying that the pass rate refers to CI job success rate, not individual test pass rate..

@meta-cla meta-cla Bot added the cla signed label Jul 22, 2026
@fffrog

fffrog commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Hi @albanD @atalman, please help to take a look at this when you have a chance.

Comment thread RFC-0050-Cross-Repository-CI-Relay-for-PyTorch-Out-of-Tree-Backends.md Outdated
Comment thread RFC-0050-Cross-Repository-CI-Relay-for-PyTorch-Out-of-Tree-Backends.md Outdated
Comment thread RFC-0050-Cross-Repository-CI-Relay-for-PyTorch-Out-of-Tree-Backends.md Outdated
Comment thread RFC-0050-Cross-Repository-CI-Relay-for-PyTorch-Out-of-Tree-Backends.md Outdated
Comment thread RFC-0050-Cross-Repository-CI-Relay-for-PyTorch-Out-of-Tree-Backends.md Outdated
@fffrog
fffrog requested a review from albanD August 3, 2026 08:40
subinz1 added a commit to subinz1/test-infra that referenced this pull request Aug 3, 2026
Replace the "Flaky Jobs" stat card with a "Timeout Rate" percentage
card on the CRCR downstream repo page, aligning with the L3 promotion
criteria proposed in pytorch/rfcs#102 which defines timeout rate < 10%
as an infrastructure metric.

The timeout rate is computed as timed_out / total_jobs directly in the
ClickHouse query, replacing the complex flaky-job subquery. The card
shows the percentage with color coding: green (0%), orange (>0%), red
(≥10% — exceeds L3 threshold).
subinz1 added a commit to subinz1/test-infra that referenced this pull request Aug 3, 2026
Update the Pass Rate card color coding to match the L3 promotion
criteria from pytorch/rfcs#102 (job pass rate > 90%):

- Green: 100% (perfect)
- Orange: 90–99.9% (meets L3 threshold)
- Red: < 90% (below L3 threshold)

Previously the thresholds were ≥95% green, ≥80% orange, <80% red.
Comment thread RFC-0050-Cross-Repository-CI-Relay-for-PyTorch-Out-of-Tree-Backends.md Outdated
> \[!NOTE\]
> - The requirements above are an **initial reference** and may **be adjusted over time based on real-world conditions** (e.g., determining the specific values of `X`).
> - The requirements above are an **initial reference** and may **be adjusted over time based on real-world conditions**.
> - To maintain the PyTorch community's user experience, **downstream repos that no longer meet the requirements of their current level will be downgraded to the level that matches their actual status.**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @fffrog maybe we should also callout de-motion Criteria here. Also would be nice to document temporary downgrade process.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another point to consider, and maybe add here is that we probably want to add possibility of temporary downgrades for certain repos. For example when dealing with SEV's.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree on that. We can also write a script to automatically upgrade or downgrade the repos so that we don't need to waste our efforts tracking whether a repo meets the criteria. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @atalman, thank you for those valuable suggestions, and I have added new sections named Promotion and Demotion, especially, add a new mechanism to achieve the temporary downgrade.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@can-gaa-hou Thank you.

Sure, based on the new mechanism of temporary downgrade, we can prepare a script to collect the necessary info to determine whether some repo should be downgraded.

subinz1 added a commit to pytorch/test-infra that referenced this pull request Aug 4, 2026
Replace the "Flaky Jobs" stat card with a "Timeout Rate" percentage
card on the CRCR downstream repo page, aligning with the L3 promotion
criteria proposed in pytorch/rfcs#102 which defines timeout rate < 10%
as an infrastructure metric.

The timeout rate is computed as timed_out / total_jobs directly in the
ClickHouse query, replacing the complex flaky-job subquery. The card
shows the percentage with color coding: green (0%), orange (>0%), red
(≥10% — exceeds L3 threshold).
subinz1 added a commit to pytorch/test-infra that referenced this pull request Aug 4, 2026
Update the Pass Rate card color coding to match the L3 promotion
criteria from pytorch/rfcs#102 (job pass rate > 90%):

- Green: 100% (perfect)
- Orange: 90–99.9% (meets L3 threshold)
- Red: < 90% (below L3 threshold)

Previously the thresholds were ≥95% green, ≥80% orange, <80% red.
atalman pushed a commit to pytorch/test-infra that referenced this pull request Aug 4, 2026
…colors with L3 criteria (#8421)

## Summary

Two changes to the CRCR per-repo dashboard page (`/crcr/{org}/{repo}`),
aligning stat card thresholds with the L3 promotion criteria proposed in
[pytorch/rfcs#102](pytorch/rfcs#102).

### 1. Replace Flaky Jobs card → Timeout Rate

**ClickHouse query** (`crcr_backend_summary/query.sql`):
- Removed the complex flaky-job subquery (correlated subquery scanning
the table twice)
- Added `timeout_rate = timed_out / total_jobs`

**Frontend card**:
- Shows percentage (e.g., `0.0%`, `1.2%`)
- Sub-text: `X timed out / Y jobs`
- Color: green (0%), orange (>0% but <10%), red (≥10% — exceeds L3
threshold)

### 2. Align Pass Rate color thresholds

Updated to match L3 criteria (`job pass rate > 90%`):
- **Green**: 100%
- **Orange**: 90–99.9% (meets L3)
- **Red**: < 90% (below L3)

Previously: ≥95% green, ≥80% orange, <80% red.

## Context

The L3 criteria in
[pytorch/rfcs#102](pytorch/rfcs#102) defines:
- **Timeout rate < 10%** as an infrastructure reliability signal
- **Job pass rate > 90%** as a test quality signal

These cards make L3 readiness directly visible on the per-repo
dashboard.

## Test plan
- [ ] Verify `crcr_backend_summary` query returns `timeout_rate`
correctly
- [ ] Verify Timeout Rate card renders with proper color coding
- [ ] Verify Pass Rate card shows red when < 90%, orange when 90–99.9%,
green at 100%
| Metric | Target | Description |
| :--- | :--- | :--- |
| Max execution time | < 4 h | The longest "run" phase of any single job (excludes queue wait). |
| Avg queue time | < 30 min | Average time a job waits before a runner picks it up (excludes execution). |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question here: for most backends, they need to build PyTorch first, then they can run their first test, which means most of their test queue time includes PyTorch building time. So the average queue time definitely exceeds 30 mins. cc @fffrog @albanD @atalman

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for asking this question. I've already sought help in this channel (https://pytorch.slack.com/archives/C0BBJK4B1EJ/p1785912202488279).

Additionally, I'd like to share my personal thoughts.

I believe that avg queue time here is just a reference value, but it is indeed a necessary metric. So, what we need to discuss is how to calculate the correct value, right?

@fffrog
fffrog requested a review from atalman August 5, 2026 10:57
@fffrog

fffrog commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Hi @albanD @atalman @can-gaa-hou , the new commit is ready, please help to take a look at it when you have a time. thank you in advance.

@albanD albanD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. Mostly small comments to tune numbers and be more precise.

Formal demotion is a permanent level reduction triggered when a downstream repo continuously fails to meet its current level's [demotion criteria](#criteria-for-every-level):

1. **Collect data**: The PyTorch CI Maintainer checks HUD data against the current level's demotion thresholds to confirm whether the repo has triggered a demotion condition.
2. **Notify downstream**: Notify the downstream repo maintainers via email or other established channels that their repo has triggered demotion, including the specific metrics and a remediation deadline (4 weeks).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 weeks is way too long here. If it has impact on trunk and live PRs, I would expect a couple days.
I think 2 working days is ok.

- **Formal config**: synced from the `allowlist.yml` file in the PyTorch repo (Redis formal cache)
- **The temporary cache takes priority over the formal cache**: if an unexpired override record exists for a repo in the temporary cache, it wins; otherwise the formal cache is used.
3. **Restoration**: There are two ways to restore the original level:
- **Automatic**: The override record expires from the temporary cache, and the repo's level automatically falls back to the formal config.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How long is that override for?


Temporary downgrade is an **operational tool** for exceptional situations (e.g., an upstream PyTorch CI SEV, or a downstream repo causing large-scale disruption to the relay system). It must take effect **immediately** without modifying config files, and be **reversible** after the incident:

1. **Admin page**: HUD provides an admin page for PyTorch CI Maintainers to perform temporary downgrade operations.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that page already exist?

L1 is the experimental onboarding phase. Requirements:

1. The GitHub App must be installed.
2. Provide verifiable accelerator hardware information.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this one is about? Maybe drop it?


| Metric | Target | Description |
| :--- | :--- | :--- |
| end-to-end time | < 4.5 h | The longest wall-clock time of a single job, from webhook delivery to CI status report. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@georgehong does that match our current TTS goal for the trunk job?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd like to reach a sub 3-hour P50 TTS for trunk, and this encompasses build to the longest test shard. Over the past seven days, this metric was hovering around 3.4 hours. 4.5 definitely exceeds that by quite a bit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's aim for 3 here then!

| Timeout rate | < 1% | Percentage of jobs terminated due to timeout, measured over a 7-day window. |

> [!NOTE]
> Average queue time requirements may be relaxed for hardware-constrained accelerators with approval from the PyTorch CI maintainers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add here that the end-to-end time will not be relaxed though right?


#### L3 Demotion

Demotion is triggered when any of the following conditions are observed over a **4 week** evaluation window:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do 1 or 2 weeks here?

1. Prerequisites

- Must have been operating at **L2 for at least 1 month** before applying for L3 promotion.
- The [HUD](https://hud.pytorch.org/crcr) must have at least 2 weeks of recent data for the downstream repo.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that all the metrics and reuqirement below must be met over a 2week period before the upgrade can happen?

2. **Hardware usage**: the actual deployment scale of the accelerator among PyTorch users.
3. **Test coverage**: whether the accelerator is required to run the PyTorch core test suite.
4. **Test pass rate**: the stability of the accelerator's CI test results.
5. **Oncall responsiveness**: how quickly the downstream team responds to and resolves CI failures.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failures and PR being blocked on this job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants