Skip to content

helios/scheduler: scale GPU prefix calibration ceiling per step across depth - #632

Open
original-el8 wants to merge 1 commit into
NVIDIA:mainfrom
liquidgravityai:fix/gpu-calibration-depth-ceiling
Open

original-el8 wants to merge 1 commit into
NVIDIA:mainfrom
liquidgravityai:fix/gpu-calibration-depth-ceiling

Conversation

@original-el8

@original-el8 original-el8 commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

GPU-confidence speculative pricing in helios/src/scheduler/rounds.rs clamps the ratio between realized verification survival and predicted confidence (DepthCalibration::factor and RequestCalibration::factor) to CALIBRATION_FACTOR_MAX = 2.0 at 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]) 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 2.0 at 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-Flash TP4 core with draft_tokens = 5 (W=6, adaptive_verification_alpha = 0.75) via flare run, a single-stream code-generation workload (temperature = 1.0, 50,311 completion tokens) remained at 2.002 offered drafts/round (36,726 offered drafts across 18,345 rounds) with observed acceptance [0.917, 0.824, 0.001, 0.0, 0.0] ([0.973, 0.929, 0.001, 0.0, 0.0] during the 22,969-token HTML/JS code segment), 2.74 mean tokens/step, and 87.74 tok/s decode throughput.

Scaling the calibration ceiling across depth additional steps as 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 calibrate beyond d >= 2.

What changed (before -> after)

  • helios/src/scheduler/rounds.rs:
    • Before: DepthCalibration::factor and RequestCalibration::factor duplicated if self.predicted > 1e-6 ratio clamping against a flat CALIBRATION_FACTOR_MAX (2.0) at all depths.
    • After: 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: usize through calibration accessors and RequestCalibration::observe. Request-local RequestCalibration, round-level DepthCalibration, [0.0, 1.0] clamping, and monotonic non-increasing depth survival are preserved.
  • helios/src/scheduler/policy_tests.rs:
    • Added gpu_confidence_calibration_ceiling_scales_per_step_across_depth verifying 2.0, 10.71875, 15.0, and 18.7578125 calibration factors at depths 0, 3, and 4.
    • Added gpu_confidence_multi_step_calibration_escapes_packed_three_trap_and_respects_low_depth_two_survival verifying that a single-lane B=1, W=6 engine (adaptive_verification_alpha = 0.75, per-step confidence 0.55) moves from packed_token_capacity = 3 to 6 under [0.95, 0.90, 0.85, 0.80, 0.75] realized survival while remaining at packed_token_capacity = 3 under [0.95, 0.90, 0.05, 0.0, 0.0].
  • docs/scheduling-runtime-design.md and helios/README.md:
    • Documented the host-side cumulative product over per-step proposal_confidence sidecar values and the [0, 2 * 1.75^depth] ceiling (depth capped at 30).
  • Compatibility: No model core format, Protobuf schema, or execution contract changes.

Claimed benefit and measured results

Unblocks ordinary packed speculative selection at depth >= 2 for sustained high-acceptance corridors while bounding deep extrapolation (18.76 at depth 4) and preserving shallow-width selection when realized survival at depth >= 2 is low.

  • CPU scheduler simulation (B=1, W=6, adaptive_verification_alpha = 0.75, per-step confidence 0.55):
    • High multi-step survival [0.95, 0.90, 0.85, 0.80, 0.75]: depth 4 request calibration factor exceeds 8.0, calibrated survival matches realized survival within 0.05, and ordinary selection moves from packed_token_capacity = 3 to 6.
    • Low depth-2 survival [0.95, 0.90, 0.05, 0.0, 0.0]: ordinary selection remains at packed_token_capacity = 3.
  • Isolated single-PR flare run A/B (origin/main 0a8c20f4 vs this change) on 4x DGX Spark GB10 (SM121, TP4):
    Serving the identical DeepSeek-V4.1-Flash exported package (gb10-tp4-202611301257, draft_tokens = 7, max_verification_token_budget = 256, default adaptive_verification_alpha = 1.0):
    • PS4 Tetris HTML/JS code corridor (spec_answer, sustained d >= 5 survival, temperature = 1.0):
      • Answer decode: 135.53 -> 140.32 tok/s (+3.5%), 5s peak 155.07 -> 162.21 tok/s (+4.6%), 1s peak 171.31 -> 174.59 tok/s
      • Draft acceptance: 77.5% -> 80.6% (5.66 -> 5.82 tokens/step)
      • Per-round depth-6 / depth-7 acceptance: 0.287 / 0.216 -> 0.492 / 0.378 (+71% / +75%)
      • Full-run context (temperature = 1.0, 48,000-token cap): the candidate run sampled a longer thinking segment (34,506 thinking / 13,494 answer tokens at 104.52 thinking tok/s = 112.59 overall tok/s) than the origin/main run (28,364 thinking / 18,904 answer tokens at 106.21 thinking tok/s = 116.27 overall tok/s).
    • Sustained 8K decode (30 s windows, temperature = 1.0, alpha = 1.0) and 5x Coding Peak (max_tokens = 2000, temperature = 1.0, ~800-token samples):
Workload origin/main (0a8c20f4) Candidate (2.0 * 1.75^depth) Delta / Notes
8K C=1 decode 73.97 tok/s (44.3% accept, 2.43 accept len) 70.14 tok/s (52.4% accept, 2.06 accept len) -5.2% (single-pass temperature = 1.0 prose)
8K C=4 decode 156.10 tok/s (63.7% accept, 2.12 accept len) 153.20 tok/s (66.8% accept, 2.12 accept len) -1.9%
8K C=16 decode 322.16 tok/s (60.5% accept, 2.18 accept len) 313.43 tok/s (62.0% accept, 2.20 accept len) -2.7%
8K C=32 decode 456.31 tok/s (65.6% accept, 2.28 accept len) 441.56 tok/s (59.4% accept, 2.33 accept len) -3.2% (resolves the 49.4%–51.8% acceptance drop from 2^(d+1))
5x Coding Peak 102.19 tok/s median (110.36 max) 98.09 tok/s median (105.41 max) -4.0% median (temperature = 1.0, ~800-token samples)
PS4 Tetris HTML/JS (spec_answer) 135.53 tok/s (155.07 5s peak) 140.32 tok/s (162.21 5s peak) +3.5% decode / +4.6% 5s peak (d = 6..7 +71% / +75%)
  • Same gb10-tp4-202611301257 core at adaptive_verification_alpha = 0.75: 146.52 tok/s HTML/JS code (180.75 tok/s 1s peak, 118.55 tok/s decode across 52,902 tokens), 110.6 median / 119.9 max 5x 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

  • Release crate CPU test suites (--locked --release):
    • cargo test --locked --release --manifest-path helios/Cargo.toml --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::, including scheduler::lifecycle_tests and scheduler::speculative_lifecycle_tests) and 62 passed, 0 failed, 34 ignored across integration test binaries (1,808 passed total).
    • cargo test --locked --release --manifest-path flare/Cargo.toml: 245 passed, 0 failed, 4 ignored (237 --lib + 8 integration).
    • cargo test --locked --release --manifest-path flare-cli/Cargo.toml: 227 passed, 0 failed, 3 ignored (201 --bin + 26 integration).
    • cargo test --locked --release --manifest-path heliopause/Cargo.toml: 216 passed, 0 failed, 6 ignored.
  • Formal verification & Python CI status:
    • Rebased onto origin/main (8da73911, including #624), resolving the two upstream Python preparation test failures (test_inductor_template_mutations.py and test_runtime_triton.py); verification/helios-lifecycle/check.py (TLA+) and cargo kani run in GitHub Actions CI (TLC JAR and cargo-kani are not installed on the local ARM64 build host).
  • Material limitations:
    • At default adaptive_verification_alpha = 1.0 on an MTP 7 core (draft_tokens = 7), origin/main already escapes packed_3 through depth 5 ([0.956, 0.900, 0.837, 0.767, 0.698, 0.287, 0.216]); raising the ceiling above 2.0 increases sustained deep (d = 6..7) code generation (135.53 -> 140.32 tok/s, +3.5%; 5s peak +4.6%), while single-pass temperature = 1.0 moderate-acceptance prose and short coding samples measured 1.9%–5.2% lower throughput (C=32 draft acceptance 65.6% -> 59.4%).

Discord: el8

@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 632.
Case File Intake Report

Future reviews will auto-run 90 minutes after code updates are pushed.

  • Re-review sooner: Call @flare-autobot after push.
  • Opt-out: Include #autobot:ignore in the PR or any comment.

@flare-autobot flare-autobot added area:scheduling Request scheduling, fairness, batching, and speculative-width selection. performance Performance, latency, throughput, or memory-efficiency investigation or improvement. triage:review Proposed change needs code review; this does not imply merge readiness. labels Nov 30, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Changes Requested

The rounds.rs calibration change is small, mathematically coherent, and preserves clamping, monotonic prefix survival, broken-drafter fallback, and ABI compatibility — but CI on 64c7198 is red and undisclosed, mandatory scheduler verification gates were skipped, the perf claim lacks an isolated matched-draft_tokens A/B, and the new docs misdescribe the proposal_confidence sidecar.

  • Blockers: 1 · Should fix: 2 · Subtract/Simplify: 3 · Nits: 2
Walkthrough
  • helios/src/scheduler/rounds.rs:15-18: Adds calibration_factor_max(depth) returning CALIBRATION_FACTOR_MAX.powi((depth + 1).min(30)) (keeping CALIBRATION_FACTOR_MAX = 2.0 as the per-step ceiling).
  • helios/src/scheduler/rounds.rs:47-53, 83-108, 283-297, 334-336: Threads depth: usize through DepthCalibration::factor, RequestCalibration::factor, RequestCalibration::observe, Forecast::calibration_factor, Forecast::observe_calibration, and Forecasts::calibration_factor, updating all callers while leaving speculative_curve clamping/monotonicity (rounds.rs:412-424) and SURPLUS_FACTOR_MAX = 2.0 (rounds.rs:25, 256) unchanged.
  • helios/src/scheduler/policy_tests.rs:6433-6596: Adds two isolated CPU unit tests: gpu_confidence_calibration_ceiling_scales_per_step_across_depth (verifying 2.0, 16.0, and 15.0 factors at depths 0, 3, and 4) and gpu_confidence_multi_step_calibration_escapes_packed_three_trap_and_respects_low_depth_two_survival (verifying a single-lane B=1, W=6 GPU-packed scheduler moves from packed_token_capacity = 3 to 6 under high survival and stays at 3 under low depth-2 survival).
  • docs/scheduling-runtime-design.md:113-145 and helios/README.md:447-453: Updates GPU-confidence calibration documentation from flat [0, 2] to [0, 2^(depth + 1)] (exponent capped at 30) and adds a Rényi-2 cumulative collision-survival rationale.
Merge Risk: Medium · up to 64c7198
  • Affected subsystem: Changes GPU-confidence verification calibration in helios/src/scheduler/rounds.rs for all GPU-confidence speculative cores (any model with PrefixAllocation::Gpu shapes); non-GPU-confidence cores do not execute this path, and there are no Protobuf, manifest, CUDA-graph, ABI, lock, or hot-path allocation changes.
  • Behavioral reach without runtime knob: Because speculative_curve feeds packed shape selection (rounds.rs:480, 543), per-request token_rate fairness normalizers (service.rs:209-216), and paired inputs to SurplusHistory (rounds.rs:586-624), loosening the depth >= 2 ceiling silently alters round widths on upgrade; the PR's own combined-stack run already notes increased packed verification rows and lower acceptance (49.4%–51.8% vs 59.7%–62.2%) on 8K C=16/C=32 low-acceptance prose at alpha = 0.75.
  • Verification gap: Head 64c7198 has failing CI and no isolated single-PR served A/B against main.
Pre-merge checks: ✅ 2 passed · ⚠️ 2 warnings

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

To opt out, include #autobot:ignore in your post or comment.

@original-el8
original-el8 force-pushed the fix/gpu-calibration-depth-ceiling branch 2 times, most recently from e453a18 to 3bca0a8 Compare November 30, 2026 15:00
…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
@original-el8

Copy link
Copy Markdown
Collaborator Author

@flare-autobot Updated fix/gpu-calibration-depth-ceiling (9110228f, rebased onto 8da73911 / #624) to address all review items:

  1. Tightened per-step calibration bound (helios/src/scheduler/rounds.rs):

    • Replaced 2.0^(depth + 1) (128x at d = 6) with 2.0 * 1.75^depth (CALIBRATION_STEP_FACTOR_MAX = 1.75, CALIBRATION_MAX_DEPTH = 30), keeping depth 0 at 2.0 and preserving a per-step shrinkage margin (0.5 * 1.75 = 0.875 < 1) so high-concurrency C=16/C=32 rounds avoid the 49.4%–51.8% draft over-allocation observed under 2^(d + 1) (C=16/C=32 acceptance is 62.0% / 59.4% at alpha = 1.0).
    • Moved calibration_factor_max below SURPLUS_FACTOR_MAX and extracted a shared calibration_ratio(realized, predicted, depth) helper used by both DepthCalibration::factor and RequestCalibration::factor.
  2. Documentation & test cleanups (docs/scheduling-runtime-design.md, helios/README.md, helios/src/scheduler/policy_tests.rs):

    • Updated docs/scheduling-runtime-design.md and helios/README.md to state accurately that proposal_confidence[frame, row, d] stores model-agnostic per-step conditional confidences multiplied into cumulative prefix survival on the host (prefix *= confidence[row][depth]), citing Rényi-2 collision probability only as an example drafter signal, and trimmed the helios/README.md summary clause.
    • Updated the depth-3 ceiling comment and removed the redundant post-plan() acceptance_credit_ns assignment in policy_tests.rs.
  3. Release verification gates & CI:

    • Rebased onto 8da73911 (tests: fix two Python CPU test premises about stock Triton and Inductor #624) so the two upstream Python CPU tests pass in GitHub Actions pytest; lifecycle (TLA+) and kani run in CI.
    • Ran all four --locked --release crate test suites locally: helios --features runtime-core,server (1,808 passed; 0 failed, 399 passed in scheduler::), flare (245 passed; 0 failed), flare-cli (227 passed; 0 failed), and heliopause (216 passed; 0 failed).
  4. Isolated single-PR flare run A/B (origin/main vs this branch, draft_tokens = 7 fixed, default adaptive_verification_alpha = 1.0):

    • Recorded matched measurements on 4x DGX Spark GB10 (SM121, TP4, DeepSeek-V4.1-Flash) in the PR description. On sustained deep (d = 6..7) HTML/JS code generation (spec_answer), decode rises 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 moderate-acceptance 8K C=1/4/16/32 prose and short ~800-token 5x Coding Peak samples measured 1.9%–5.2% lower than origin/main (since on MTP 7, origin/main already clears depths 1..5 and raising the global ratio ceiling offers slightly wider prefixes on moderate-acceptance text).

@original-el8
original-el8 force-pushed the fix/gpu-calibration-depth-ceiling branch from 3bca0a8 to 9110228 Compare November 30, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:scheduling Request scheduling, fairness, batching, and speculative-width selection. performance Performance, latency, throughput, or memory-efficiency investigation or improvement. triage:review Proposed change needs code review; this does not imply merge readiness.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants