Skip to content

[CI] Serve N parallel reviews with a runner pool - #9037

Merged
zufayu merged 1 commit into
mainfrom
review-bot-runner-pool
Dec 2, 2026
Merged

zufayu merged 1 commit into
mainfrom
review-bot-runner-pool

Conversation

@zufayu

@zufayu zufayu commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Let the review box serve several PRs at once: register N runner agents with the same labels and GitHub dispatches queued review jobs to whichever agent is free. No dispatch logic changes — the pool is the mechanism. This PR fixes everything downstream that still assumed one lane.

Motivation

18 queued requests at a ~24 min median was a 7-hour wait, with requesters' own PRs at the tail. The box's model endpoint has capacity to spare (one request slot per concurrent review), so the constraint was the single registered agent, not the hardware.

Changes

  • The pool itself is operational, not code: N agents, same box308 labels, one directory + .env + systemd service each (RUNNER-SETUP.md §7, new). The per-PR concurrency group still serialises repeat reviews of one PR — two reviews of one PR must not interleave.
  • queue_gate.py priced the wait as queue-depth × one review, so a pool would quote every requester an N-times-too-long ETA and fire the too-deep refusal N times too early. The wait is now divided by AITER_REVIEW_LANES (repo var, default 1 = today's arithmetic and wording, byte for byte).
  • The workflow now passes AITER_REVIEW_LANES through, and check_prompts.py holds the reader and the pass-through together — a repo var the workflow forgets to pass is not an error anyone sees; it is just a pool quoted as one lane, silently, forever.
  • preflight.sh vouched for whichever runner unit sorted first, so one hand-started agent among N would read green while being one reboot away from quietly taking the box below its quoted lane count. It now checks every unit and reports the pool size.
  • watchdog.py needed no logic change — a queued job behind a full pool is the normal state the gate already quoted an ETA for, and a dead box is still "nothing running at all". Only its wording said "single runner".

Testing

  • queue gate: divides the wait by the lanes, accepts a queue the lanes can work through, falls back to one lane on an unusable var; two mutants hold the lane arithmetic and the var read.
  • watchdog: stays silent behind a full 4-lane pool (pin).
  • check_prompts: red when the workflow stops passing the var (verified by deleting the line), green restored.
  • selftest.sh: 153 green / 0 red. actionlint clean on the workflow.
  • live pool verification on a scratch repo: 4 registered agents, 6 dispatches — the 4 distinct-key jobs ran simultaneously (one per agent, 4×90 s jobs done in ~105 s wall), and the 2 same-key dispatches serialized behind the concurrency group even with idle agents. All 6 green.

Rollout

  1. Register the extra agents on the box (RUNNER-SETUP.md §7 — needs a repo admin for the registration token).
  2. Set repo var AITER_REVIEW_LANES to the agent count.
  3. Re-run preflight.sh — it now vouches for every agent.

PR Self-Review

Reviewed revision

339bc17

Behavior and intent

The review box moves from one registered runner agent to a pool of N. GitHub Actions already dispatches queued jobs to any idle agent with matching labels, so the pool itself is operational, not code. What still assumed one lane: queue_gate.py priced the wait as queue-depth × one review (an N-times-too-long ETA, refusal N times too early), the workflow did not pass AITER_REVIEW_LANES through, preflight.sh vouched for whichever runner unit sorted first, and watchdog.py wording said "single runner". One lane is insufficient because the queue sat 18 deep at a ~24 min median (a 7 h wait) while the model endpoint had capacity for several concurrent reviews.

Validation and unverified scope

Validated: selftest.sh 153 green / 0 red; actionlint clean; the queue gate driven against live ROCm/aiter API data (lanes=1 and lanes=4 arithmetic and wording); the drift guard red when the workflow stops passing the var, green restored; live pool verification on a scratch repo — 4 registered agents, 6 dispatches: the 4 distinct-key jobs ran simultaneously (one per agent, 4×90 s jobs in ~105 s wall) and the 2 same-key dispatches serialized behind the concurrency group even with idle agents, all 6 green. Unverified: the production rollout itself (registering the extra agents on the box, setting the repo var) — it needs a repo admin for the registration token; the steps are the PR's Rollout section.

PR-specific question

No new permissions. The hosted jobs keep contents:read/actions:read, the review job is unchanged, and the only new input is the repo variable AITER_REVIEW_LANES, read by queue_gate.py with a fallback to 1 on any unusable value (a bad var cannot crash the gate). Fork PR code cannot reach it: the workflow triggers on issue_comment from allowlisted commenters only, and the gate runs on ubuntu-latest before any self-hosted checkout. The var influences only the ETA text and the queue-depth refusal threshold — no privileged execution path.

Changed op tests

None

🤖 Generated with Claude Code

One agent serves one review at a time, and 18 queued requests at ~24 min
each was a 7-hour wait. GitHub Actions parallelises across a pool by
itself: every agent registered with the same labels picks up queued
review jobs as it frees, so N agents review N PRs concurrently with no
workflow change. The per-PR concurrency group still serialises repeat
reviews of one PR, which is correct.

What stayed single-lane was everything that TALKS about the box:

- queue_gate priced the wait as queue-depth x one review, so a pool
  would quote every requester an N-times-too-long ETA and refuse work
  N times too early. It now divides the wait by AITER_REVIEW_LANES (a
  repo var, default 1 = today's arithmetic and wording, unchanged).
- The workflow did not pass that var through; check_prompts now holds
  the reader and the pass-through together, because a var the workflow
  does not pass is not an error anyone sees.
- preflight vouched for whichever runner unit sorted first, so one
  hand-started agent among N would read green while being one reboot
  away from quietly taking the box below its quoted lane count. It now
  checks every unit and reports the pool size.
- RUNNER-SETUP documents the pool: one directory, .env and service per
  agent, the repo var, and the capacity line -- each lane holds one
  request slot on the model endpoint, so N lanes must fit it.

The watchdog needed no logic change: a queued job behind a full pool is
the normal state the gate already quoted an ETA for, and a dead box is
still 'nothing running at all'. Only its wording said 'single runner'.

Tests: the queue gate divides the wait by the lanes, accepts a queue
the lanes can work through, falls back to one lane on an unusable var,
and two mutants hold the arithmetic; the watchdog stays silent behind a
full pool. selftest.sh: 153 green.

Co-Authored-By: Claude Code <[email protected]>
@zufayu
zufayu requested a review from a team December 2, 2026 02:27
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 9037 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@github-actions github-actions Bot added the CI label Dec 2, 2026
@aiter-bot

aiter-bot commented Dec 2, 2026 •

Copy link
Copy Markdown

READY FOR HUMAN REVIEW

PR Self-Review

Revision 339bc179eed8 · mode shadow

Author self-review accepted. Readiness report:

Author answers

  • PASS — current-SHA answers are present and structurally specific
Show the author's self-review answers

Behavior and intent

The review box moves from one registered runner agent to a pool of N. GitHub Actions already dispatches queued jobs to any idle agent with matching labels, so the pool itself is operational, not code. What still assumed one lane: `queue_gate.py` priced the wait as queue-depth × one review (an N-times-too-long ETA, refusal N times too early), the workflow did not pass `AITER_REVIEW_LANES` through, `preflight.sh` vouched for whichever runner unit sorted first, and `watchdog.py` wording said "single runner". One lane is insufficient because the queue sat 18 deep at a ~24 min median (a 7 h wait) while the model endpoint had capacity for several concurrent reviews.

Validation and unverified scope

Validated: `selftest.sh` 153 green / 0 red; `actionlint` clean; the queue gate driven against live ROCm/aiter API data (lanes=1 and lanes=4 arithmetic and wording); the drift guard red when the workflow stops passing the var, green restored; live pool verification on a scratch repo — 4 registered agents, 6 dispatches: the 4 distinct-key jobs ran simultaneously (one per agent, 4×90 s jobs in ~105 s wall) and the 2 same-key dispatches serialized behind the concurrency group even with idle agents, all 6 green. Unverified: the production rollout itself (registering the extra agents on the box, setting the repo var) — it needs a repo admin for the registration token; the steps are the PR's Rollout section.

PR-specific question

No new permissions. The hosted jobs keep `contents:read`/`actions:read`, the review job is unchanged, and the only new input is the repo variable `AITER_REVIEW_LANES`, read by `queue_gate.py` with a fallback to 1 on any unusable value (a bad var cannot crash the gate). Fork PR code cannot reach it: the workflow triggers on `issue_comment` from allowlisted commenters only, and the gate runs on `ubuntu-latest` before any self-hosted checkout. The var influences only the ETA text and the queue-depth refusal threshold — no privileged execution path.

Changed op tests

None

🤖 Generated with [Claude Code](https://claude.com/claude-code)

PR state

  • PASS — pull request is marked ready for review

Copilot findings

  • PASS — no active Copilot finding lacks a substantive author reply
  • ADVISORY — Copilot did not review the current head SHA

Code and op-test hygiene

  • PASS — no committed artifact or conflict marker detected

Required CI

  • PASS — Black: passed
  • PASS — Ruff: passed
  • PASS — Repository dependency: passed
  • PASS — Aiter Test Gate: passed

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@zufayu
zufayu merged commit e823c45 into main Dec 2, 2026
54 checks passed
@zufayu
zufayu deleted the review-bot-runner-pool branch December 2, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants