Gate the fitted layout score on measured execution classes (calibration expansion, stage 1) - #844
Draft
bradhilton wants to merge 1 commit into
Draft
Gate the fitted layout score on measured execution classes (calibration expansion, stage 1)#844bradhilton wants to merge 1 commit into
bradhilton wants to merge 1 commit into
Conversation
Prepares the cost-model calibration for more model families (other hidden sizes, MoE): a coefficient table now applies only to the execution classes it was measured on, and the harness, fitter and certificate carry those classes. - `_planner_cost`: `ModelGeometry` (read from the Megatron config: widths, attention head geometry, GDN state shape, expert geometry; never a model name; layer counts stay scoring facts), `DeviceClass` (capability plus a memory-system bucket, so the 80 GB H100 is not admitted on the H200 table), `ParallelShape` (TP x CP x EP x ETP) and `CalibratedTable` replace `CalibrationProfile`; `select_scoring` picks the admitting table or the version-1 fallback. The shipped dense hidden-2,560 table admits the Qwen3.5-4B and Qwen3-4B geometries at exactly the four measured shapes, so TP2 x CP2, CP8, TP4 and expert parallelism now fall back until measured. The table identity joins the coefficient version in the planner facts and layout cache key; the selector threads the table through the scorer. - TrainerRank derives geometry, EP/ETP and MoE layer count from the runtime; the two admitted geometries were cross-checked against providers built on CPU for both models. - Harness: rows record the geometry, device memory class, EP/ETP, MoE facts and the score the runtime actually used; a Qwen3-tokenized Ellavox corpus (`cal-ellavox-qwen3`, git-ignored, SHA-pinned) with an explicit tokenizer agreement check for Ellavox cells. - Fitter: cell keys carry EP/ETP when above one; certificates name their table and record the admitted classes; per-model, per-shape and per-family gate reports (never pooled). - Certificate regenerated from the same evidence with the class facts: identical table hash; the certificate test now asserts the admitted sets equal the production table's and that every geometry was measured at every admitted shape. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
bradhilton
temporarily deployed
to
trainer-rank-gpu-validation
September 3, 2026 22:35 — with
GitHub Actions
Inactive
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.
Stage 1 of the expanded cost-model calibration campaign (other hidden sizes, MoE), per the plan agreed with Codex: no new GPU evidence yet, only the machinery so that new execution classes can be measured, fitted and certified without loosening the current gate.
What changes
Admission by execution class, not by hidden size. A calibrated coefficient table applies only to the execution classes it was measured on:
ModelGeometry, read from the Megatron config (never a model name): hidden and FFN widths, attention head geometry, GDN state shape, expert geometry. Layer counts remain scoring facts, not identity.DeviceClass: compute capability plus a memory-system bucket (the 80 GB H100 shares capability 9.0 with the H200 but is not admitted).ParallelShape: TP × CP × EP × ETP.CalibratedTable+select_scoringreplaceCalibrationProfile/coefficient_version_for. The shipped dense hidden-2,560 table admits exactly the Qwen3.5-4B and Qwen3-4B geometries at the four measured shapes (TP1 × CP1/2/4, TP2 × CP1). Consequently TP2 × CP2, CP8, TP4 and any expert parallelism now fall back to the version-1 score until measured (previously TP2 × CP2 would have used the fitted table unmeasured). CPU-only planning keeps the default table.Runtime facts. TrainerRank derives the geometry, EP/ETP and the MoE layer count from the runtime. Both admitted geometries were cross-checked against providers built on CPU for the two models (identical).
Harness. Cell rows record the geometry, device memory class, EP/ETP, MoE facts and the score the runtime actually used (the earlier rows recorded the module constant, which was wrong for fallback runtimes). New cell family
cal-ellavox-qwen3uses the Qwen3-tokenized Ellavox corpus Codex pointed at (git-ignored, SHA-pinned like the Qwen3.5 corpus; 44 groups, 261 histories, max id 151,668), with an explicit tokenizer-agreement check (vocabulary size and a decoded sample) that fails a cell loudly on mismatch.Fitter. Cell keys carry
|ep{n}/|etp{n}only when above one (existing keys unchanged); certificates name their table (--table-id) and record the admitted device classes, dtypes, geometries and shapes; per-model, per-shape and per-family gate reports, judged per group and never pooled, as Codex asked.Certificate. Regenerated from the same 58-cell evidence with the class facts backfilled: identical table hash. The certificate test now asserts the admitted sets equal the production table's, that every geometry was measured at every admitted shape, and one geometry per model.
Checks
uv run prek run --all-filesgreen;tests/acceptance/trainer_rank_planner+tests/unit/test_trainer_rank*.py+tests/unit/test_planner_cost*.py: 588 passed, 17 skipped (including the opt-in full refit). No GPU runs in this PR.Next stages
🤖 Generated with Claude Code