[WIP] Add CI job priority system#2217
Draft
adibarra wants to merge 17 commits into
Draft
Conversation
…ties # Conflicts: # .github/workflows/collectivex-sweep.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Priority-aware CI scheduling
GitHub Actions does not natively prioritize self-hosted jobs. This PR adds an opt-in controller that decides which queued GPU job each compatible idle runner may accept.
How dispatch works
With priority scheduling enabled, a job requests labels similar to:
self-hostedb200ci-job-6.000-a81f23...Runners permanently carry only their normal hardware and identity labels. They do not permanently carry
ci-job-*labels.The controller:
ci-job-<score>-<hash>label.ci-job-*label.The combined label transports both the human-readable score and a unique 128-bit job hash through GitHub's queued-job API. Because every label must match, the hash prevents GitHub from selecting another job with the same hardware and priority.
Running jobs are never preempted or relabeled.
Single-node and multinode awareness
Existing runner labels remain compatibility constraints:
b200b200-multinodeA single-node runner cannot accept a multinode job unless it already satisfies the multinode label. The controller schedules the coordinating GitHub runner; existing Slurm launchers continue provisioning worker nodes.
Automatic scoring
All ordinary priorities are numeric, nonnegative, automatic, and uncapped. Higher scores run first.
For PR sweeps, Claude Fable inspects the diff and returns only verified priority facts, such as topology, workload type, precision, speculative decoding, framework, model family, checklist completion, and patchwork.
Fable never receives weights and never calculates a score.
ci_priority.py:configs/ci-priority.yaml.ci-job-<score>-<hash>label metadata.This intersection keeps mixed matrices correct: a PR may contain both vLLM and SGLang jobs, but each job receives only its matching criteria. Main-branch pushes retain deterministic matrix-field scoring without a Fable call.
Malformed or unavailable Fable output conservatively classifies the PR as patchwork. Arbitrary
ci-priority:pNoverrides are not supported.Ties are resolved by queue timestamp and job ID. Runner selection preserves scarce exact-match runners when a less-constrained runner can accept the higher-priority job.
Job hashes
Generated job hashes are the first 128 bits of a SHA-256 digest over:
Manual matrix workflows derive the same 32-character hash from their run and matrix-cell identity. Hashes are routing identifiers, not credentials or secrets.
A score alone could release any compatible job with that priority.
ci-job-<score>-<hash>combines ordering and one-job identity in a single exact-match label.Protected
skip_queueskip_queueis the only absolute bypass mechanism. The workflow keeps the job's ordinary numeric priority and adds a PR-scoped skip request label.The trusted controller then:
SemiAnalysisAI/Coremembership.Unauthorized or unverifiable requests retain their numeric priority. The scheduler credential remains inside the trusted controller and is never passed to PR-controlled workflow code.
Required controller-token permissions:
Safety and failure behavior
Activation requires deploying the controller and setting:
PRIORITY_SCHEDULER_ENABLED=trueVerification
actionlint.skip_queueoutranked numeric priority100.000while retaining its numeric job label.