Repository navigation
helios/scheduler: scale GPU prefix calibration ceiling per step across depth - #632
original-el8 wants to merge 1 commit into
Conversation
|
A case file has been opened for 632. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe
Walkthrough
Merge Risk: Medium · up to
|
e453a18 to
3bca0a8
Compare
…s depth
Per the model-agnostic sidecar contract in `helios/model-contract.md`,
`proposal_confidence[frame, row, d]` carries per-step conditional confidence
values, which the host multiplies into cumulative prefix survival
(`prefix *= confidence[row][depth]`) across `depth + 1` draft steps. When a
drafter's per-step confidence signal (for example, Rényi-2 collision
probability `sum_i q_{j,i}^2`) underpredicts target-matching acceptance on
each step, that ratio compounds multiplicatively across `depth + 1` steps.
Clamping `realized / predicted` to a flat `CALIBRATION_FACTOR_MAX = 2.0`
regardless of depth truncated deeper calibration ratios (`d >= 2`) below
realized acceptance, trapping ordinary packed selection at shallow widths
(such as `packed_token_capacity = 3`). Scaling the ceiling across `depth`
additional steps by `2.0 * 1.75^depth` (`depth` capped at `30`) preserves a
conservative per-step shrinkage margin against noise (`0.5 * 1.75 = 0.875 < 1`
relative to doubling per step) while allowing sustained multi-step survival
to reach wider packed verification shapes, and preserves the unbiased
round-level `DepthCalibration` update (`if count > 0`) paired with
`population[depth]`.
Before -> after:
- `helios/src/scheduler/rounds.rs`: `DepthCalibration::factor` and
`RequestCalibration::factor` previously clamped `realized / predicted` to
`CALIBRATION_FACTOR_MAX` (`2.0`) at all depths. Added
`CALIBRATION_STEP_FACTOR_MAX = 1.75` and `CALIBRATION_MAX_DEPTH = 30`,
extracted `calibration_factor_max(depth)` and shared
`calibration_ratio(realized, predicted, depth)` used by both
`DepthCalibration::factor` and `RequestCalibration::factor`, and threaded
`depth` through calibration accessors and `RequestCalibration::observe`.
- `helios/src/scheduler/policy_tests.rs`: added
`gpu_confidence_calibration_ceiling_scales_per_step_across_depth` and
`gpu_confidence_multi_step_calibration_escapes_packed_three_trap_and_respects_low_depth_two_survival`.
- `docs/scheduling-runtime-design.md` and `helios/README.md`: documented the
per-step `proposal_confidence` sidecar multiplication and the
`[0, 2 * 1.75^depth]` ceiling (`depth` capped at `30`).
Claimed benefit:
Unblocks ordinary packed speculative selection at `depth >= 2` when per-step
calibration compounds across depth while bounding deep extrapolation
(`18.76` at depth 4) and keeping shallow-width selection when realized
survival at `depth >= 2` is low. On CPU scheduler simulation (`B=1`, `W=6`,
`alpha = 0.75`, per-step confidence `0.55`), realized survival
`[0.95, 0.90, 0.85, 0.80, 0.75]` moves from `packed_token_capacity = 3` to
`6`, while `[0.95, 0.90, 0.05, 0.0, 0.0]` stays at `3`.
Supporting evidence and material limitations:
- `helios` (`--locked --release --features runtime-core,server` with prepared
`FLARE_TEST_TEMPLATE_DIR`): 1,746 passed, 0 failed, 46 ignored in `--lib`
(399 passed, 0 failed, 4 ignored in `scheduler::`) and 62 passed, 0
failed, 34 ignored across integration test binaries (1,808 passed total).
- `flare` (`--locked --release`): 245 passed, 0 failed, 4 ignored.
- `flare-cli` (`--locked --release`): 227 passed, 0 failed, 3 ignored.
- `heliopause` (`--locked --release`): 216 passed, 0 failed, 6 ignored.
- `verification/helios-lifecycle/check.py` (TLC/TLA+) and `cargo kani` were
not run on this host because no TLC JAR or `cargo-kani` installation is
present.
- Isolated `origin/main` (`0a8c20f4`) vs this commit live SM121 TP4 `flare run`
A/B (`draft_tokens = 7`, default `alpha = 1.0`): HTML/JS code segment
`135.53 -> 140.32 tok/s` (+3.5%; 5s peak `155.07 -> 162.21 tok/s`, +4.6%;
depth-6/7 acceptance `0.287/0.216 -> 0.492/0.378`), while single-pass
`temperature = 1.0` `8K` prose and short coding samples measured `1.9%-5.2%`
lower (`C=32` acceptance `65.6% -> 59.4%`).
Design-Signed-Off-By: Jason Cook <jasonc@maxlyn.com>; design-review=2e5b
|
@flare-autobot Updated
|
3bca0a8 to
9110228
Compare
Problem
GPU-confidence speculative pricing in
helios/src/scheduler/rounds.rsclamps the ratio between realized verification survival and predicted confidence (DepthCalibration::factorandRequestCalibration::factor) toCALIBRATION_FACTOR_MAX = 2.0at every speculative depth.Per the model-agnostic sidecar contract in
helios/model-contract.md,proposal_confidence[frame, row, d]carries per-step conditional confidence values, which the host multiplies into cumulative prefix survival (prefix *= confidence[row][depth]) acrossdepth + 1draft steps. When a drafter's per-step confidence signal (for example, Rényi-2 collision probabilitysum_i q_{j,i}^2) underpredicts target-matching acceptance on each step, that ratio compounds multiplicatively acrossdepth + 1steps. Clampingrealized / predictedto a flat2.0at every depth truncates deeper calibration ratios (d >= 2) below realized acceptance, pulling calibrated survival down and underpricing deep speculative prefixes on sustained high-survival corridors.On 4x DGX Spark (GB10 / SM121) serving an exported
DeepSeek-V4.1-FlashTP4 core withdraft_tokens = 5(W=6,adaptive_verification_alpha = 0.75) viaflare run, a single-stream code-generation workload (temperature = 1.0,50,311completion tokens) remained at2.002offered drafts/round (36,726offered drafts across18,345rounds) with observed acceptance[0.917, 0.824, 0.001, 0.0, 0.0]([0.973, 0.929, 0.001, 0.0, 0.0]during the22,969-token HTML/JS code segment),2.74mean tokens/step, and87.74 tok/sdecode throughput.Scaling the calibration ceiling across
depthadditional steps as2.0 * 1.75^depth(depthcapped at30) preserves a conservative per-step shrinkage margin against noise (0.5 * 1.75 = 0.875 < 1relative to doubling per step) while allowing sustained multi-step survival to calibrate beyondd >= 2.What changed (before -> after)
helios/src/scheduler/rounds.rs:DepthCalibration::factorandRequestCalibration::factorduplicatedif self.predicted > 1e-6ratio clamping against a flatCALIBRATION_FACTOR_MAX(2.0) at all depths.CALIBRATION_STEP_FACTOR_MAX = 1.75andCALIBRATION_MAX_DEPTH = 30, extractedcalibration_factor_max(depth)and sharedcalibration_ratio(realized, predicted, depth)used by bothDepthCalibration::factorandRequestCalibration::factor, and threadeddepth: usizethrough calibration accessors andRequestCalibration::observe. Request-localRequestCalibration, round-levelDepthCalibration,[0.0, 1.0]clamping, and monotonic non-increasing depth survival are preserved.helios/src/scheduler/policy_tests.rs:gpu_confidence_calibration_ceiling_scales_per_step_across_depthverifying2.0,10.71875,15.0, and18.7578125calibration factors at depths0,3, and4.gpu_confidence_multi_step_calibration_escapes_packed_three_trap_and_respects_low_depth_two_survivalverifying that a single-laneB=1,W=6engine (adaptive_verification_alpha = 0.75, per-step confidence0.55) moves frompacked_token_capacity = 3to6under[0.95, 0.90, 0.85, 0.80, 0.75]realized survival while remaining atpacked_token_capacity = 3under[0.95, 0.90, 0.05, 0.0, 0.0].docs/scheduling-runtime-design.mdandhelios/README.md:proposal_confidencesidecar values and the[0, 2 * 1.75^depth]ceiling (depthcapped at30).Claimed benefit and measured results
Unblocks ordinary packed speculative selection at
depth >= 2for sustained high-acceptance corridors while bounding deep extrapolation (18.76at depth4) and preserving shallow-width selection when realized survival at depth>= 2is low.B=1,W=6,adaptive_verification_alpha = 0.75, per-step confidence0.55):[0.95, 0.90, 0.85, 0.80, 0.75]:depth 4request calibration factor exceeds8.0, calibrated survival matches realized survival within0.05, and ordinary selection moves frompacked_token_capacity = 3to6.[0.95, 0.90, 0.05, 0.0, 0.0]: ordinary selection remains atpacked_token_capacity = 3.flare runA/B (origin/main0a8c20f4vs this change) on 4x DGX Spark GB10 (SM121, TP4):Serving the identical
DeepSeek-V4.1-Flashexported package (gb10-tp4-202611301257,draft_tokens = 7,max_verification_token_budget = 256, defaultadaptive_verification_alpha = 1.0):spec_answer, sustainedd >= 5survival,temperature = 1.0):135.53 -> 140.32 tok/s(+3.5%), 5s peak155.07 -> 162.21 tok/s(+4.6%), 1s peak171.31 -> 174.59 tok/s77.5% -> 80.6%(5.66 -> 5.82tokens/step)0.287 / 0.216 -> 0.492 / 0.378(+71% / +75%)temperature = 1.0,48,000-token cap): the candidate run sampled a longerthinkingsegment (34,506thinking /13,494answer tokens at104.52thinkingtok/s=112.59overalltok/s) than theorigin/mainrun (28,364thinking /18,904answer tokens at106.21thinkingtok/s=116.27overalltok/s).8Kdecode (30 swindows,temperature = 1.0,alpha = 1.0) and5x Coding Peak(max_tokens = 2000,temperature = 1.0, ~800-token samples):origin/main(0a8c20f4)2.0 * 1.75^depth)8K C=1decode73.97 tok/s(44.3%accept,2.43accept len)70.14 tok/s(52.4%accept,2.06accept len)-5.2%(single-passtemperature = 1.0prose)8K C=4decode156.10 tok/s(63.7%accept,2.12accept len)153.20 tok/s(66.8%accept,2.12accept len)-1.9%8K C=16decode322.16 tok/s(60.5%accept,2.18accept len)313.43 tok/s(62.0%accept,2.20accept len)-2.7%8K C=32decode456.31 tok/s(65.6%accept,2.28accept len)441.56 tok/s(59.4%accept,2.33accept len)-3.2%(resolves the49.4%–51.8%acceptance drop from2^(d+1))5x Coding Peak102.19 tok/smedian (110.36max)98.09 tok/smedian (105.41max)-4.0%median (temperature = 1.0, ~800-token samples)spec_answer)135.53 tok/s(155.075s peak)140.32 tok/s(162.215s peak)d = 6..7+71% / +75%)gb10-tp4-202611301257core atadaptive_verification_alpha = 0.75:146.52 tok/sHTML/JS code (180.75 tok/s1s peak,118.55 tok/sdecode across52,902tokens),110.6median /119.9max5x Coding Peak,8K C=1 / 2 / 4 / 8 / 16 / 32 = 69.3 / 106.6 / 154.4 / 237.0 / 320.2 / 438.6 tok/s.Supporting evidence and material limitations
--locked --release):cargo test --locked --release --manifest-path helios/Cargo.toml --features runtime-core,server(with preparedFLARE_TEST_TEMPLATE_DIR):1,746 passed, 0 failed, 46 ignoredin--lib(399 passed, 0 failed, 4 ignoredinscheduler::, includingscheduler::lifecycle_testsandscheduler::speculative_lifecycle_tests) and62 passed, 0 failed, 34 ignoredacross integration test binaries (1,808 passedtotal).cargo test --locked --release --manifest-path flare/Cargo.toml:245 passed, 0 failed, 4 ignored(237--lib+8integration).cargo test --locked --release --manifest-path flare-cli/Cargo.toml:227 passed, 0 failed, 3 ignored(201--bin+26integration).cargo test --locked --release --manifest-path heliopause/Cargo.toml:216 passed, 0 failed, 6 ignored.origin/main(8da73911, including#624), resolving the two upstream Python preparation test failures (test_inductor_template_mutations.pyandtest_runtime_triton.py);verification/helios-lifecycle/check.py(TLA+) andcargo kanirun in GitHub Actions CI (TLCJAR andcargo-kaniare not installed on the local ARM64 build host).adaptive_verification_alpha = 1.0on anMTP 7core (draft_tokens = 7),origin/mainalready escapespacked_3through depth 5 ([0.956, 0.900, 0.837, 0.767, 0.698, 0.287, 0.216]); raising the ceiling above2.0increases sustained deep (d = 6..7) code generation (135.53 -> 140.32 tok/s,+3.5%; 5s peak+4.6%), while single-passtemperature = 1.0moderate-acceptance prose and short coding samples measured1.9%–5.2%lower throughput (C=32draft acceptance65.6% -> 59.4%).Discord: el8