Skip to content

Add optional per-request activation steering for DeepSeek V4.1 cores - #404

Closed
jcartu wants to merge 1 commit into
NVIDIA:mainfrom
jcartu:pr/per-request-steering
Closed

jcartu wants to merge 1 commit into
NVIDIA:mainfrom
jcartu:pr/per-request-steering

Conversation

@jcartu

@jcartu jcartu commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Serving both unsteered and activation-steered DeepSeek V4.1 behavior previously required preparing and loading two separate ~473 GiB on-disk model cores, doubling GPU memory footprint or requiring offline core swaps. Runtime Python hooks cannot execute inside Flare's captured CUDA graphs, and per-request steering also requires prefix-cache key isolation across distinct scales and a dedicated per-slot parameter column across speculative decoding kernels.

Change

  • Export & identity (ignition/recipes/deepseek41): Accept an optional --steering-sidecar <PATH> (safetensors) during flare export / ignition export for DeepSeek V4.1 checkpoints, validating per-layer positive FP32 alpha, unit-norm BF16[5120] direction, and BF16[5120] attn_row_gain tensors across decoder layers 4..36, retaining persistent FP32 direction and attn_row_gain - 1 vectors on device, and folding the sidecar SHA-256 into the core's model identity so distinct sidecars never collide in shared prefix stores.
  • Contract-driven width & admission (helios, heliopause, helios/proto): Derive request parameter width (6 vs 7) and steering admission strictly from the existing ValueSource::SamplingParameters binding (f32[max_slots, 6] vs f32[max_slots, 7]) and sampling_ranges.steering_scale / sampling_defaults.steering_scale, with no capability flag on ServingContract or ModelConfig and no new captured-graph operation contract. Preserve the non-vision prompt.conditioning admission guard independently, enforce two-way 6/7-column metadata/binding symmetry, and verify that packed steering_scale matches the request's planned PrefixHistory scale.
  • HTTP boundary, kernels & --direct execution (helios/src/server, ignition/components, ignition/direct): Clamp steering_scale at the HTTP boundary via sampling_number (0.0 default, {"min": 0.0, "max": 1.0} or null on /v1/models, -0.0 canonicalized to 0.0, malformed types and conflicting top-level vs chat_template_kwargs.steering_scale duplicates rejected with HTTP 400). Keep PARAMETERS: tl.constexpr = 6 as the default in ignition/components/sampling.py while passing state.parameters.shape[1] across score, admission, draft, Markov, and vocabulary-parallel sampling kernels, and wire steering_scale end-to-end through ignition/direct (scheduler.py, packing.py, server.py).
  • Captured forward execution & prefix isolation (paged_batch, deepseek41, helios/src/cache): Gather per-token steering_scale across PreparedBatch.begin, Metadata.pack, Metadata.set, and layer-24 sliding-window attention suffix replay, applying rank-local shared-expert directional ablation before TP4 BF16 all-reduce (matching post-reduction ablation within BF16 rounding, verified in tests/recipes/test_deepseek41_steering.py::test_shared_expert_projection_commutes_with_tp4_sum) and post-attention ablation + row-gain rescaling with torch.where(token_scale == 0.0, output, steered). Salt PrefixHistory root digests with exact nonzero FP32 steering_scale bits while preserving unsteered prefix keys at 0.0 within a core's model identity and across preemption, checkpoint readmission, and pooled host-lookup retries.

One prepared DeepSeek V4.1 core serves both unsteered (steering_scale = 0.0 or omitted) and activation-steered (0.0 < steering_scale <= 1.0) requests concurrently without loading duplicate weights or swapping cores, while 6-column cores load unchanged without re-export.

Validation

  • Rebased head (6555f939 base) CPU & interpreter suites:
    • Rust: 1,448 passed, 0 failed in non-gated cargo test -p flare-helios --lib --features server,runtime-core (worker_observes_prefill_decode_and_prerequisite_timings re-run unloaded after a parallel-load timing flake), 550 passed, 0 failed in cargo test -p flare-helios --lib, 195 passed, 0 failed in cargo test -p flare-heliopause --lib, and locked release flare build; the suites cover steered_pool_lookup_retry_preserves_salted_history_and_steering_scale and steered_preemption_preserves_steering_scale_and_prefix_history.
    • Python CPU & lint: 7 passed in tests/recipes/test_deepseek41_steering.py, 124 passed across CPU tests/direct/ and tests/bench/test_runner.py, 5 passed in CPU-interpreter tests/recipes/test_completion_abi.py, and zero added ruff findings (0 findings on new files).
  • Pre-rebase 4x RTX PRO 6000 (gb202 SM120 architecture, TP4, compressed safetensors weights, DSpark k=7 multi-token speculative draft head, host-RAM Engram lookup tables) GPU validation on revision 15ade6b9 (69858cd1 base) (exported from the unmodified PR worktree; the HTTP serving comparisons below use flare run; CUDA unit suites and full 4-GPU core re-export were not repeated after rebasing onto 6555f939):
    • CUDA unit suites: 128 passed across tests/components/test_sampling_score_defaults_cuda.py, tests/recipes/test_completion_abi.py (PARAMETERS=6 and 7 exercised at nonzero slot indices to verify row stride), tests/components/test_draft_scores_cuda.py, tests/components/test_markov_sampling_cuda.py, and tests/components/test_vocabulary_sampling_cuda.py.
    • Live 4-GPU ignition.direct (RankSteps + Scheduler): 0 cross-scale reused tokens (0.0 -> 1.0), 12/12 reused prompt tokens within 0.0 and 1.0, and 38 speculative draft rounds.
    • 6-column core backward compatibility: Loaded and served an unmodified TP4 core exported at 69858cd1 via flare run without re-export (sampling_defaults.steering_scale = 0.0, sampling_ranges.steering_scale = null, nonzero requests clamped to 0.0 and matching omitted, malformed/conflicting inputs returning HTTP 400, 42 speculative draft rounds).
    • Unsteered checks (A1 and A2 are unsteered 6-column baseline core runs before and after steering-enabled 7-column core B, core SHA-256 235e2891, prepared with a 668 KiB steering sidecar, SHA-256 68551f9b): 16/16 top-1 token agreement between steering_scale omitted and explicit 0.0 on B; 95% item agreement between B (0.0) and A1 on a 100-item SQuAD2 + TruthfulQA slice (squad_answerable_fraction / squad_invented_fraction [lower is better] / truthfulqa_fraction: 0.92 / 0.12 / 0.86 on B at 0.0 vs 0.92 / 0.20 / 0.88 on A1); and 100-prompt keyword refusal rates (sampled at temperature=0.6) of 90/100 on A1, 90/100 on B with steering_scale omitted, and 89/100 on B at explicit 0.0 (semantic classifier counts 76/100, 75/100, and 69/100 under temperature=0.6 sampling).
    • Full-scale steering (steering_scale = 1.0 on B): 0/100 semantic refusals (1/100 keyword match) on the same core weights and 95% item agreement on the 100-item SQuAD2 + TruthfulQA slice (B scores 0.92 / 0.20 / 0.82 vs 0.92 / 0.20 / 0.84 on a standalone weight-edited reference checkpoint).
    • Concurrent mixed-batch & prefix-cache isolation on B: 8/8 (C=8) and 16/16 (C=16 at 33,381 prompt tokens across layer-24 sliding-window attention + k=7 speculation) mixed-scale first-token bit-identity against homogeneous-scale batches (0 first-token mismatches); on a 27,046-token prompt, 0 cached tokens across 0.75 -> 0.25 and 27,046 / 27,046 same-scale cached tokens on 0.0 -> omitted, 0.0 -> 0.0, 1.0 -> 1.0, and 0.75 -> 0.75.
    • Throughput & KV capacity via flare run (B at steering_scale = 1.0 vs the geometric mean $\sqrt{A_1 \cdot A_2}$ of baseline runs A1 and A2, range across temperature=0.01 and temperature=1.0): 250K prefill = 18,042–18,212 tok/s (100.1–100.7%), C=32 = 2,268.1–2,268.5 tok/s (100.0–100.1%), C=8 = 1,170.1–1,191.6 tok/s (98.5–102.2%), C=1 = 293.3–301.8 tok/s (92.2–97.8%), and 185,230 vs 185,524 KV pages (99.84%, 23.71M vs 23.75M tokens).
  • AI disclosure: Prepared and reviewed with AI assistance (Gemini 4 Carbon, GPT-6.2 Astra, Claude Fable 5.2); Claude Opus 5.5 did not author or edit any CUDA, Triton, or PTX code (Principle 14).

Limitations

  • Activation steering preparation is implemented only for the deepseek41 recipe (layers 4..36 post-attention reduction and shared-expert output); other recipes continue to prepare 6-column unsteered cores.
  • At steering_scale = 1.0, C=1 decode throughput was ~2–8% lower than the 6-column baseline (C=1 throughput at steering_scale = 0.0 was not separately timed, though captured CUDA graphs launch the gated steering kernels at all scales); 6-column cores prepared without --steering-sidecar are unaffected.
  • Each steering-enabled core binds one sidecar at export time and scales continuously over [0, 1] per request; changing sidecar tensors requires re-exporting the core (reusing unchanged weight shards via core weight reuse).

Discord: jcartu

@yatesdr yatesdr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed write-up and the GPU results. Per-request steering is a capability Flare can support, but this PR needs the changes below before it can merge. Whether to revise is your call.

  1. Shared Helios code selects behavior from a one-recipe capability.
    • Only the deepseek41 recipe can set steering_sidecar_sha256 (ignition/planning.py:211, :509). Helios branches on it for:
      • the sampling-parameter width (helios/src/model/packing.rs:177-179);
      • admission (model/admission.rs:77-78, :181-184);
      • request handling (server/request.rs:100-107);
      • the model card (server/models.rs:67-74).
    • "Architecture and ownership" in AGENTS.md rules out default-false opt-ins and metadata fields that act as model allowlists. Principle 3 keeps input packing and admission shared.
    • The width of a bound value source has to come from the declared binding, and admission has to follow declared contract data, not a capability field.
    • admission.rs:181-184 also lets conditioning events through for any core with a sidecar.
  2. Core compatibility is unproven. Principle 13 requires previous cores to be validated by loading and serving them; the PR loads none. The layout of SamplingParameters now depends on a ServingContract field.
  3. Kernel callers were not updated.
    • _scores, _sampling_metadata, _admission_validate and _admission_finish take a new required PARAMETERS argument before SLOTS (ignition/components/sampling.py:282, :312, :733, :792). The other kernels default it to six.
    • Two existing direct callers were not changed: tests/components/test_sampling_score_defaults_cuda.py:41-43 now passes batch in that position, and tests/recipes/test_completion_abi.py:105-111 omits it. (Found by reading; not run.)
  4. Direct execution. ignition/direct packs the six sampling parameters (scheduler.py, "The six FP32 admission parameters") and has no steering input. A steering core run with --direct therefore cannot apply a scale.
  5. Evidence.
    • The GPU results come from a tree with host-memory changes that are not in this PR (the description's Disclosures), so they do not describe this head.
    • cargo test -p flare-helios --lib builds with no features (helios/Cargo.toml:17), so it does not compile the server and runtime-core tests the PR changes.
    • The TP4 commutation test (tests/recipes/test_deepseek41_steering.py:104-117) runs in FP32, while each rank rounds its steered partial to BF16 before the reduction.
    • "Boundary triggers", the headline metric, is not defined.
  6. Principle 14. The description says the model that principle 14 restricts wrote no CUDA, Triton or PTX code. The principle also covers changes to model fusion and GPU execution optimizations in optimized model paths, such as the steering application in ignition/recipes/deepseek41/decoder.py. Please confirm the statement covers those changes too.
  7. The description has no Discord: line (AGENTS.md, "Contact on PRs and issues").

A revision would need:

  • shared Helios code that takes the parameter width and admission rules from declared contract data;
  • a core exported before the change, loaded and served;
  • every kernel caller updated, with the CUDA tests run;
  • GPU evidence from the PR's own head;
  • the four-part description with the Discord: line.

@jcartu
jcartu force-pushed the pr/per-request-steering branch from 7e977d6 to 15ade6b Compare November 20, 2026 08:29
@jcartu

jcartu commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review @yatesdr — pushed 15ade6b9 addressing every item:

  1. Contract-driven Helios (ServingContract / ModelConfig / PrefixHistory): Removed steering_sidecar_sha256 from ServingContract and ModelConfig. Parameter width (6 vs 7), two-way metadata/binding symmetry, and planned-vs-packed steering_scale checks now derive strictly from the declared ValueSource::SamplingParameters buffer binding and sampling_ranges.steering_scale. The non-vision prompt.conditioning guard in admission.rs stays independent, nonzero steering_scale salts the PrefixHistory root digest (canonicalizing -0.0 to 0.0), bootstrap.py folds sidecar_sha256 into server_config["identity"] so distinct sidecar cores remain isolated in shared prefix stores, and phase_tests.rs verifies steered preemption and checkpoint readmission.
  2. HTTP boundary clamping & /v1/models: server/request.rs parses steering_scale via sampling_number (0.0 default, sampling_ranges.steering_scale), clamping out-of-range or unsteered requests consistently with other distribution parameters while rejecting malformed types and conflicting top-level vs chat_template_kwargs.steering_scale values with HTTP 400 (with exact 64-bit integer + f64 comparison before clamping). /v1/models advertises sampling_defaults.steering_scale = 0.0 and sampling_ranges.steering_scale = null or {"min": 0.0, "max": 1.0}.
  3. Python sampling callers & --direct execution: Restored PARAMETERS: tl.constexpr = 6 as the default in ignition/components/sampling.py (with atomic pre-mutation validation in DeviceRequestState.admit and AdmissionBuffers.stage), updated draft_score_reference.py, sampling_score_reference.py, test_sampling_score_defaults_cuda.py, and test_completion_abi.py across widths 6 and 7 (slot >= 1), and wired steering_scale end-to-end through ignition/direct (scheduler.py, packing.py, server.py), verified on 4 GPUs via RankSteps + Scheduler.
  4. CUDA & TP4 BF16 commutation tests: test_shared_expert_projection_commutes_with_tp4_sum rounds each rank's steered partial to torch.bfloat16 before summation, and all 128 CUDA component/ABI tests pass on clean PR head.
  5. Clean PR head export & pre-change core compatibility: Exported and qualified the steered TP4 core directly from the unmodified PR commit (zero out-of-PR host-memory adjustments; the earlier export limit turned out to be an SSH session cgroup cap on our workstation), and verified that an unmodified pre-change 6-column TP4 core loads and serves cleanly without re-export.
  6. Prose & PR metadata: Cleaned docs/comments and added Discord: jcartu to the PR description.

Problem
-------
Serving both unsteered and activation-steered DeepSeek V4.1 behavior previously
required preparing and loading two separate ~473 GiB on-disk model cores, doubling GPU
memory footprint or requiring offline core swaps. Runtime Python hooks cannot
execute inside Flare's captured CUDA graphs, and per-request steering also
requires prefix-cache key isolation across distinct scales and a dedicated
per-slot parameter column across speculative decoding kernels.

Change
------
- Accept an optional `--steering-sidecar <PATH>` (`safetensors`) during
  `flare export` / `ignition export` for DeepSeek V4.1 checkpoints, validating
  per-layer positive FP32 `alpha`, unit-norm BF16 `direction`, and BF16
  `attn_row_gain` tensors across decoder layers 4..36, retaining persistent FP32
  `direction` and `attn_row_gain - 1` vectors on device, and folding the sidecar
  SHA-256 into the core's model identity.
- Derive request parameter width (`6` vs `7`) and steering admission strictly
  from the existing `ValueSource::SamplingParameters` binding and
  `sampling_ranges.steering_scale` (`[0, 1]` with `0` default when prepared, or
  `null` on 6-column cores), without adding model-policy capability flags or
  new captured-graph operation contracts.
- Clamp `steering_scale` at the HTTP boundary via `sampling_number` (canonicalizing
  `-0.0` to `0.0`, rejecting malformed types and conflicting top-level vs
  `chat_template_kwargs.steering_scale` duplicates with HTTP 400, and advertising
  defaults and ranges on `/v1/models`), while enforcing two-way metadata/binding
  symmetry and planned-vs-packed `steering_scale` equality in Helios.
- Keep `PARAMETERS: tl.constexpr = 6` as default in `ignition/components/sampling.py`
  while propagating `state.parameters.shape[1]` across score, admission, draft,
  Markov, and vocabulary-parallel sampling kernels and wiring `steering_scale`
  end-to-end through `ignition/direct` (`scheduler.py`, `packing.py`, `server.py`).
- Gather per-token `steering_scale` across `PreparedBatch.begin`, `Metadata.pack`,
  `Metadata.set`, and layer-24 sliding-window attention suffix replay, applying
  rank-local shared-expert directional ablation before TP4 BF16 all-reduce
  (matching post-reduction ablation within BF16 rounding in
  `tests/recipes/test_deepseek41_steering.py::test_shared_expert_projection_commutes_with_tp4_sum`)
  and post-attention ablation plus row-gain rescaling gated by
  `torch.where(token_scale == 0.0, output, steered)`.
- Salt the `PrefixHistory` root digest with exact nonzero FP32 `steering_scale`
  bits while preserving unsteered prefix keys at `0.0` within a core's
  model identity and preserving `steering_scale` across preemption, checkpoint
  readmission, and pooled host-lookup retries.

One prepared DeepSeek V4.1 core serves both unsteered (`steering_scale = 0.0` or
omitted) and activation-steered (`0.0 < steering_scale <= 1.0`) requests
concurrently without loading duplicate weights or swapping cores, while 6-column
cores load unchanged without re-export.

Validation
----------
- Rebased head (`6555f939` base) CPU & interpreter suites:
  - Rust: `1,448 passed, 0 failed` in non-gated `flare-helios` (`--features
    server,runtime-core`, with `worker_observes_prefill_decode_and_prerequisite_timings`
    re-run unloaded after a parallel-load timing flake), `550 passed, 0 failed` in
    `flare-helios` (default features), `195 passed, 0 failed` in `flare-heliopause`,
    and locked release `flare` build; the suites cover `/v1/models` serialization, `-0.0`
    canonicalization, mixed 6/7 binding rejection, column-6 float byte packing,
    steered preemption/readmission, and `steered_pool_lookup_retry_preserves_salted_history_and_steering_scale`.
  - Python CPU & lint: `7 passed` in `tests/recipes/test_deepseek41_steering.py`,
    `124 passed` across CPU `tests/direct/` and `tests/bench/test_runner.py`,
    `5 passed` CPU-interpreter ABI tests in `tests/recipes/test_completion_abi.py`,
    and zero added `ruff` findings.
- Pre-rebase 4x RTX PRO 6000 (`gb202` SM120 architecture, TP4, compressed
  safetensors weights, DSpark `k=7` multi-token speculative draft head, host-RAM
  Engram lookup tables) GPU validation on revision `15ade6b9` (`69858cd1` base;
  CUDA unit suites and full 4-GPU core re-export were not repeated after
  rebasing onto `6555f939`):
  - `128 passed` CUDA component and completion-ABI tests across parameter widths
    6 and 7 (exercised at nonzero slot indices to verify row stride).
  - Live 4-GPU `ignition.direct` (`RankSteps` + `Scheduler`) execution: `0`
    cross-scale reused tokens (`0.0 -> 1.0`), `12/12` reused prompt tokens within
    `0.0` and `1.0`, and `38` speculative draft rounds.
  - 6-column core compatibility: loaded and served an unmodified TP4 core exported
    at `69858cd1` via `flare run` without re-export
    (`sampling_defaults.steering_scale = 0.0`, `sampling_ranges.steering_scale = null`,
    nonzero requests clamped to `0.0` and matching omitted, `42` draft rounds).
  - End-to-end `flare run` HTTP serving comparison (`A1` and `A2` are unsteered
    6-column baseline core runs before and after steering-enabled 7-column core
    `B`, core SHA-256 `235e2891`, prepared with a 668 KiB steering sidecar,
    SHA-256 `68551f9b`):
    - Unsteered checks: `16/16` top-1 token agreement between `steering_scale`
      omitted and explicit `0.0` on `B`; `95%` item agreement between `B` (`0.0`)
      and `A1` on a 100-item SQuAD2 + TruthfulQA slice; and 100-prompt keyword
      refusal rates (sampled at `temperature=0.6`) of `90/100` on `A1`, `90/100`
      on `B` with scale omitted, and `89/100` on `B` at explicit `0.0` (semantic
      classifier counts `76/100`, `75/100`, and `69/100` under `temperature=0.6`
      sampling).
    - Full-scale steering (`steering_scale = 1.0` on `B`): `0/100` semantic
      refusals (`1/100` keyword match) on the same core weights and `95%`
      item agreement on the 100-item SQuAD2 +
      TruthfulQA slice against a standalone weight-edited reference checkpoint.
    - Mixed-batch & prefix-cache isolation on `B`: `8/8` (`C=8`) and `16/16`
      (`C=16`, `33,381` prompt tokens) mixed-scale first-token bit-identity
      against homogeneous-scale batches (`0` first-token mismatches); `0`
      cross-scale cached tokens (`0.75 -> 0.25`) and `27,046/27,046` same-scale
      cached tokens.
    - Throughput & KV capacity via `flare run` (`B` at `steering_scale = 1.0` vs
      the geometric mean of baseline runs `A1` and `A2`, range across
      `temperature=0.01` and `1.0`): `185,230` vs `185,524` KV pages (`99.84%`),
      `18,042-18,212 tok/s` 250K prefill (`100.1-100.7%`),
      `2,268.1-2,268.5 tok/s` `C=32` decode (`100.0-100.1%`),
      `1,170.1-1,191.6 tok/s` `C=8` decode (`98.5-102.2%`), and
      `293.3-301.8 tok/s` `C=1` decode (`92.2-97.8%`).
- AI disclosure: prepared and reviewed with `Gemini 4 Carbon`, `GPT-6.2 Astra`,
  and `Claude Fable 5.2`; Claude Opus 5.5 did not write or modify any CUDA,
  Triton, or PTX code (Principle 14).

Limitations
-----------
- Activation steering preparation is wired only for the `deepseek41` recipe
  (layers 4..36 post-attention reduction and shared-expert output); other model
  recipes continue to export 6-column unsteered cores.
- At `steering_scale = 1.0`, `C=1` decode throughput was ~2-8% lower than the
  6-column baseline (`C=1` throughput at `steering_scale = 0.0` was not
  separately timed, though captured CUDA graphs launch the gated steering kernels
  at all scales); 6-column cores prepared without `--steering-sidecar` are
  unaffected.
- A steering core binds one sidecar at export time and interpolates over `[0, 1]`
  per request; switching to a different sidecar requires re-exporting the core
  (reusing unchanged weight shards via core weight reuse).

Design-Signed-Off-By: Gemini 4 Carbon (agent for Josh Cartu); design-review=1af4
Signed-off-by: Joshua Cartu <[email protected]>
@jcartu
jcartu force-pushed the pr/per-request-steering branch from 15ade6b to 8e5a1b0 Compare November 20, 2026 10:13
@yatesdr

yatesdr commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the revision and the rebase. The pooled lookup retry now keeps the steering scale, and the description names its revisions and defines its terms. Before another round of detail, two questions decide whether this can merge at all. As the PR stands, we don't think it should.

1. Principle 1.

  • Design-review principle 1 requires approval before a new captured-graph operation contract is introduced, even one that reuses an existing graph kind.
  • Here the DeepSeek V4.1 decoder layers read a per-request value inside the captured forward pass:
    • the per-token gather in ignition/components/paged_batch.py:48-56 and :305-309;
    • the steering after the attention reduction and on the shared-expert partial in ignition/recipes/deepseek41/decoder.py:237-241 and :253-254.
  • Existing captured operations read request sampling values only in the sampling stage, after the logits.
  • The description says no new operation contract is added. If you read it that way, please name the existing operation whose contract this matches.

2. What the steering is for.

  • Your results show it: unsteered, 90 of 100 prompts are refused by keyword count; at steering_scale = 1.0, 0 of 100 are refused semantically.
  • So the feature is a per-request switch that removes the model's refusals on a shared serving core. That is a significant step for the engine to take.
  • The description should state the intended use and argue why Flare should provide it per request.

Change impact. +1,794/-309 in 49 files, for one recipe and one sidecar per core:

  • Shared Helios:
    • the SamplingParameters width becomes 6 or 7 (helios/src/model/packing.rs:176-190);
    • request parsing gains a second spelling through chat_template_kwargs (server/protocol/decode.rs:586-627);
    • admission and the /v1/models card change for every core, and prefix-cache keys gain a scale salt;
    • a fixed 0..1 range is enforced in five places (heliopause/src/export/binding.rs:773-786, helios/src/runtime_core/protobuf.rs:93-110 twice, server/config.rs:119-125, model.rs:265).
  • Sampling kernels: the parameter stride is threaded through the score, admission, draft, Markov and vocabulary kernels.
  • Forward path: the paged-batch metadata and the DeepSeek V4.1 decoder.
  • Cost: on a steering core, C=1 decode is 2-8% slower at scale 1.0. Scale 0 was not timed, although the steering kernels run at every scale.
  • Tests: they exercise the steering helpers on CPU. None runs the decoder with steering, so later changes to these paths have little protection.

Recommendation.

  • Close this PR, and serve a weight-edited checkpoint, like the reference your results compare against, as its own core. That needs no change to Helios or the sampling kernels.
  • What Add optional per-request activation steering for DeepSeek V4.1 cores #404 adds over that is serving both behaviors from one copy of the weights. We don't think that benefit outweighs the shared complexity above.
  • We'll leave the PR open for your reply. If you have evidence of a deployment that needs both behaviors from one core and cannot hold two, or a design that leaves the shared paths unchanged, post it here and we'll consider it.
  • The earlier review's principle-14 question also still needs an answer if this goes forward.

AzallazA pushed a commit to AzallazA/hyperflare-inference that referenced this pull request Nov 21, 2026
…(upstream PR NVIDIA#404)

Cherry-pick of NVIDIA/hyperflare-inference PR NVIDIA#404 head 7e977d6 (author Joshua
Cartu, open as of 2026-11-19, upstream parent 69858cd) onto perf/ds41-e3c-a
feca17e. Upstream change: optional --steering-sidecar export flag (DS41 layers
4-36: unit-norm BF16 direction, BF16 attention row gain, FP32 alpha), a seventh
request parameter column steering_scale in [0, 1] only for sidecar cores,
per-token scale gathered into Metadata (begin, pack, set, suffix replay), the
projection after the attention all-reduce and on the rank-local shared-expert
partial before the MLP all-reduce (torch.where(scale == 0, output, steered)),
a BLAKE2b prefix-cache conditioning event at position 0 for nonzero scales,
and steering_scale on /v1/chat/completions and /v1/completions.

TP3 conflict resolution (no behaviour change beyond the upstream commit):
- decoder.py: the fork's PreparedLayer (BRRR tail, probes, route capture,
  Engram side stream, mma pads, index split, merged bank, EXL3 joins) keeps its
  code; token_scale is threaded through and the two projections sit where
  upstream put them (after attention_reduce; on `shared` before routed + shared).
  next_mix stays torch.empty_like (fork glue), not upstream's zeros_like.
- bootstrap.py / weights.py: steering_sidecar added next to the fork's TP3Config,
  host allocator and _sampling_defaults (vocabulary-parallel top_p range kept).
- vocabulary_sampling.py: upstream PARAMETERS stride added next to STAGED.
- runtime_core_pb2.py: the fork's checked-in descriptor plus the three steering
  fields only (ServingContract.steering_sidecar_sha256 = 26,
  DefaultSamplingParameters.steering_scale = 10, SamplingRanges.steering_scale =
  8), checked field-for-field against protoc output of the merged proto. The
  fork's pb2 was already missing two enum values of its own proto
  (MXFP4_E2M1_E8M0, INT4_FP16_BLOCK32); left as it was.
AzallazA added a commit to AzallazA/hyperflare-inference that referenced this pull request Nov 21, 2026
…kov stride, BRRR/EXL3 refusal, export knobs)

- vocabulary_sampling.py: the fork-only _score_tiles_rows (tp3.markov_tile_rows) read request parameters with a
  fixed stride of 6. With a steering core's 7-column state it would read another slot's temperature and penalties
  for every slot >= 1 (silent wrong Markov proposals). It now takes PARAMETERS = state.parameters.shape[1] like
  upstream's kernels. test_markov_tile_rows_interpret gains a seven-column case (both kernels, staged and direct,
  must score bit-identically to the 6-column twin); it fails on the old fixed stride.
- decoder.py: refuse a steering layer that would run the BRRR fused tail (decode/verify graphs of tp3.brrr_layers):
  the kernel has no steering projection, so the request scale would be ignored silently. Also refuse steering
  with the EXL3 merged epilogue (shared expert folded into the routed output). Both fail at preparation.
- export.sh: STEERING=<sidecar> (= --steering-sidecar) and BRRR_LAYERS (default 0-39 as before). A steering export
  must leave layers 4-36 out of BRRR until the kernel supports it. Defaults unchanged.
No change for exports without a sidecar.
AzallazA added a commit to AzallazA/hyperflare-inference that referenced this pull request Nov 21, 2026
…on for unsteered cores

The PR removes steering_scale from /v1/models sampling_defaults when the core has no sidecar (wire form unchanged),
but its metadata test still compared against the full serialized defaults, which now include steering_scale.
helios lib: 1470 passed, 5 failed = the same 5 as feca17e (FLARE_TEST_TEMPLATE_DIR template tests).
AzallazA added a commit to AzallazA/hyperflare-inference that referenced this pull request Nov 21, 2026
PR NVIDIA#404's projections in brrr/kernels/decoder.cu, compiled only with BRRR_STEER=1 (packages with a steering
sidecar; brrr.kernel_defines(tp3, steering=True)). Without the define the layer kernel compiles to the same SASS
as before (nvcc 13.1, serving flags; analysis/work/steering-sidecar-20261119/optionB/build).

- Per-launch flag: any nonzero row scale, read on device after pdl_wait (no graph change, one graph set).
- Attention site: job_xa adds each chunk's yattn . d to a fixed-point per-token dot and signals C_YD; OWNA waits
  for all chunks when steering and projects + row-gains ya for rows with s != 0.
- Shared site: finish_sh1 accumulates h . u (u = W2_rank^T d, computed at registration from the checkpoint shard);
  job_xf projects bf(shacc) for rows with s != 0 before the MLP exchange. No extra wait.
- Rows with scale 0 keep their unsteered values; dots cleared by the last CTA.
- brrr.py: Engine(steering), register_steering, shared_down_direction, op flare::brrr_layer_tail_steered,
  PreparedBRRRTail(steering=) / __call__(token_scale=). decoder.py: steered BRRR layers use it; the BRRR refusal is
  removed (EXL3 merged-epilogue refusal stays). bootstrap.py creates the steering engine for sidecar packages.
- TP3Config.steering_plain_identity (FLARE_DS41_STEERING_PLAIN_IDENTITY, export.sh STEERING_PLAIN_ID=1, recorded
  when on): tune under the plain checkpoint identity for strict scale-0 comparisons. Default unchanged.
- Tests: test_deepseek41_brrr_steering.py (CPU: kernel-arithmetic mirror vs upstream reference, exact pieces,
  make_fx wiring), test_deepseek41_brrr_steering_cuda.py (GPU layer test, not run yet).
AzallazA added a commit to AzallazA/hyperflare-inference that referenced this pull request Nov 21, 2026
…ode removed

seq377 (v3): post-mode steer@1 +4..+7 us at 1-16 rows; steer@0 and zero-constant steering
still +5 us at 1 row; the projection effect check failed the same way in post and pre mode.

- Cost at scale 0: v3's job_xf_run<STEERED> instantiated share() twice, so the steering build
  carried a second copy of reduce4 / gather / post / await with 24 more spill loads in reduce4
  (per-source-line SASS attribution against the plain build). Only the mixing loop is
  instantiated twice now (xf_mix<STEERED>); one share() after it. The plain build keeps the
  original job_xf text (its SASS stays identical to base). The steering flag moved from a Ctx
  register to Smem::steer (one consumer barrier at entry). Exchange functions now compile
  identically in both builds.
- Pre mode (dot before the all-reduce) removed with everything it added (+43..+48 us).
- Accuracy: seq377's per-direction comparison with Flare's reference measured the
  BRRR-vs-Flare difference of the unsteered attention output (FP8 o-projection inputs), which the
  projection amplifies for rows with a small y . d; both dot modes showed the same error because
  both use the kernel's own y. B now checks the kernel's ffn_residual against upstream PR NVIDIA#404's
  steer_attention applied to the kernel's own reduced attention output (last_yattn test hook)
  and owna_tile's hc mix in FP32 with the kernel's operation order: <= 1 BF16 step, <= 1 % of
  elements off, steered and scale-0 rows; the MHC cosine against Flare's reference stays.
AzallazA added a commit to AzallazA/hyperflare-inference that referenced this pull request Nov 21, 2026
…IDIA#404 + BRRR steering + Markov stride fix) into the upstream-sync binary 394fcb2

No textual conflicts; docs/api.md, docs/model-preparation.md, helios/model-contract.md,
decode.rs, request.rs, phase_tests.rs, glm_frontend.rs, image_admission.rs auto-merged.
@jcartu

jcartu commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

@yatesdr, you're right on Principle 1. I can't name a matching captured operation. Existing captured operations read per-request SamplingParameters only in sampling, after logits. This PR has the deepseek41 decoder layers read a per-request scalar inside the captured forward. That widens its input contract even though the graph kind is unchanged. My description was wrong. This needs explicit approval from Luke Alonso.

On Principle 14, Claude Opus 5.5 was not used anywhere on this PR. It did not design, author, or modify ignition/recipes/deepseek41/decoder.py, ignition/components/paged_batch.py, any model fusion or GPU execution optimization, or any CUDA, Triton, or PTX code. The only models used were Gemini 4 Carbon, GPT-6.2 Astra, and Claude Fable 5.2.

My workstation serves two workloads concurrently. I keep defensive security and configuration reviews at steering_scale = 0.0 to preserve stock safety boundaries and avoid extra false positives on clean configs. I use 1.0 for authorized red-team analysis that stock otherwise refuses.

The host has four RTX PRO 6000 Blackwell GPUs (384 GiB total). Even with Engram tables in host RAM, one TP4 DeepSeek-V4.1-Flash-1017 core and its ~23.7M-token KV pool use ~96 GiB per GPU. There's no room for a second TP4 core at that capacity. Each core is ~473 GiB on disk; swapping interrupts every active agent session for ~2 minutes.

The shared-path diff is +1,794/-309. At C=1 I measured a 2-8% cost at 1.0; I didn't time 0.0 at C=1. If this deployment doesn't justify widening the forward contract or the shared parameters upstream, I'm fine closing #404 and maintaining the sidecar build out of tree. If you'd welcome an out-of-band mechanism that leaves the shared six-parameter Helios/Triton paths untouched, I can close this PR now.

@yatesdr

yatesdr commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

@jcartu - this is really cool work and I'm personally interested in it as well with the way security is being nerfed in newer models I think it is forward looking and will become more relevant as time goes on. The above comments are the triage bot enforcing what it was told to enforce, but I do think this adds value if we can find a way to do it that will not cause major issues in flare for support and future models.

For now please leave it open as a proposal, it's very forward looking work. Discord: D-Rock

@lukealonso

Copy link
Copy Markdown
Collaborator

See if your agent can implement this not as a hardcoded steering_scale parameter, but as a generic system by which model cores can expose scalar arguments that can then be provided on a per-request basis and bound dynamically into the graphs. All of this would be described in the model proto.

@jcartu

jcartu commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @yatesdr, appreciated. I'll leave #404 open as a design proposal rather than something to merge as written.

The review points above stand: reading a per-request steering_scale inside the decoder forward widens the captured-graph contract, and putting it in SamplingParameters with deepseek41-specific wiring places that cost on shared paths. Any new contract for an operation inside a captured graph still requires Luke's explicit approval under Principle 1, and I don't take your comment as that approval.

Whenever we revisit the design, the first choice is whether stock and steered requests need to share a single GPU batch or only a single loaded model:

  1. One mode per core. Apply the sidecar at export time. No per-request input and no Helios or wire changes, at the cost of separate cores for separate modes.
  2. Per-batch profile on one loaded model. Capture a steered graph set alongside the unchanged stock graph set, batch requests by profile in Helios, and key prefix-cache state by profile. Stock-only steps run the unmodified stock graphs and neither forward reads a per-request scale, at the cost of a second graph ladder and time-slicing when both profiles are active.
  3. Per-slot conditioning. Required only if stock and steered requests must share one replay batch (for example, 31 stock + 1 steered at C32). Moving the scale out of SamplingParameters into an isolated binding and pairing it with (2) keeps stock-only steps on the stock graphs, while mixed steps remain an explicit Principle 1 exception.

I'll hold off on pushing more code here until we agree on a direction, and I'm happy to prototype and measure whichever option is most useful.

@jcartu

jcartu commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@lukealonso @yatesdr I’ve prototyped the core-declared scalar interface Luke suggested. The use case is to vary a recipe’s conditioning strength between requests served by one loaded TP4 core, rather than keep two copies of the weights resident or reload between requests. The original DeepSeek experiment included changing refusal behavior; I’m not proposing that as a Helios feature or an acceptance metric.

The proposed engine revision lets a core declare named FP32 inputs, defaults and optional ranges in the model proto. A graph binding names the input and its row indexing. Helios resolves the request values at admission, includes them in prefix-cache identity, and packs them independently of the six sampling columns. A core that declares none retains its previous prefix identity and rejects unknown scalar names. The recipe owns any computation that consumes an input. I’d keep the DeepSeek adapter separate in hyperflare-recipes rather than include it in the engine revision.

On a prototype build, not the published PR head, 10,304 device rank/row checks on four SM120 GPUs matched the intended request slot and value. In a separate C8 mixed-scale run, scores matched the same-scale controls bit for bit at all 3,056 tested row/token positions. The runtime also served a pre-scalar core without re-export. We have not qualified C16/C32 output isolation: a separate unsteered Stock control repeated exactly at fixed row order, but reversing only compute rows exceeded the 0.05 logprob-difference limit at 330/4,096 C32 positions. That is not evidence of a scalar upload error or a performance claim.

Luke: under design principle 1, do you approve this core-declared scalar binding for use inside an existing captured operation, with no change to sampling layout or new graph kind? Yates and Luke: would you prefer a successor engine PR scoped to that contract and its native/direct tests, leaving #404 as the design discussion, or an update to this PR? I’ll keep the existing branch intact pending that decision.

@jcartu

jcartu commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

@lukealonso @yatesdr I’ve now exported and served a new signed TP4 core with the generic engine revision on four SM120 GPUs. The test uses an external recipe that scales even embedding channels by a request’s embedding_gain (default 1.0, range 0.5–1.5). No steering sidecar or model-specific behavior is in the engine commit. The release CLI SHA-256 starts fcbf610b; the core envelope starts e1d3a7ab.

  • Prefix isolation: with the same 4,114-token prompt, gains 0.5 and 1.5 each reused zero tokens on first use, then each reused all 4,114 on repeat.
  • Two live rows, matched history: I fixed the continuation tokens and compared eight token logprobs at each of 32 positions for both requests, with both assignments of the two gains. All 1,024 mixed-versus-same-gain values matched exactly. Each measured warm batch took 31 ordinary decode launches for two 32-token outputs (no MTP). The two homogeneous gain settings gave measurably different scores on both rows.
  • Limit: unconstrained chat did not pass the 0.05 logprob tolerance. In the first run the three batches used 77, 61 and 63 decode launches. A second run stopped on the full-prompt cache-reuse check: the two requests reused 12/14 and 13/15 prompt tokens. Its recorded launch counts (63, 62 and 63) also differed. Neither run establishes chat score parity or identifies the cause of the differences. I’m not claiming throughput parity, or extrapolating the two-row result to C16/C32.

The published #404 branch is unchanged. The remaining upstream question is whether this generic graph input belongs in a successor engine PR or a revision here.

@original-el8

Copy link
Copy Markdown
Collaborator

Repository-split triage: this PR spans both repositories and remains open for its runtime changes.

  • hyperflare-recipes: the DeepSeek activation-steering recipe and model components.
  • This runtime repository: the per-request steering protocol, scheduler/cache behavior, and runtime interfaces.

The recipe portion needs a linked PR against the hyperflare_recipes/ package, with its tests and validation evidence carried over. The runtime portion can remain here after removing recipe-owned files.

@jcartu

jcartu commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

@lukealonso @yatesdr Draft #505 implements the generic engine interface requested here as one commit based on c0c4f79, targeting main. It binds core-declared FP32 operands outside the sampling columns and keys prefixes on their resolved values. It includes no steering recipe. The draft requests a decision on the binding, not approval for a consuming forward. I left the #404 branch unchanged. If you prefer the engine commit here rather than in a new draft, say so and I will move it.

jcartu added a commit to jcartu/hyperflare-inference that referenced this pull request Nov 25, 2026
Captured graphs already receive request inputs such as token IDs and
positions. What a recipe cannot declare is a named, client-supplied FP32
conditioning value for its forward. The six FP32 sampling columns carry the
per-request values that select tokens, and captured operations read them only
in the sampling stage, after the logits. Putting a recipe-specific operand into
the sampling columns would widen a layout shared by every core. A separately
declared buffer leaves that layout unchanged. In NVIDIA#404, Luke Alonso requested a
generic alternative declared in the model proto. At the configured cache
capacity, the target host can hold one four-rank core. It needs to serve
requests at two conditioning strengths without swapping weights. Because a
recipe can use the value to change hidden state, the resolved value must also
take part in prefix identity.

Before this change the model proto could not declare such a value. Now a
core declares named FP32 arguments with defaults and optional inclusive
ranges, and a graph binding names an argument and its row indexing. Helios
resolves the values during request preparation, before prefix-pool lookup,
clamps them to the declared ranges, packs
them in their own buffer in the native and direct paths, and includes their
canonical bits (the FP32 bit pattern, with negative zero stored as positive
zero) in prefix identity. Requests name values in a request_scalars object.
Protocol decoding rejects non-numeric values, numbers whose FP64 magnitude
exceeds f32::MAX, and nonzero FP64 values that narrow to FP32 zero; request
preparation rejects a name absent from the loaded core. A declaration without a
range accepts any finite FP32 value. The sampling layout is unchanged. A core
with no declarations keeps its prefix identity and rejects a request that names
an argument. Shared input packing also gains bounds and overflow checks on
existing integer, sampling and image writes. The Python protobuf module is
regenerated with protoc 36.2; its gencode version 7.36.2 is the minimum protobuf
runtime in pyproject.toml.

The engine change adds no captured-graph operation, and no recipe in this
commit consumes an argument. A recipe that reads an argument inside a captured
graph changes the input contract of that operation, which requires prior
approval from the project owner.

The result is a capability: a core can take a per-request FP32 value from one
loaded copy of the weights. Requests whose resolved values differ have
distinct prefix identities and cannot reuse each other's checkpoints. For the
same core and otherwise identical prefix inputs, values that narrow or clamp to
the same FP32 bits contribute the same scalar identity. The recipe must bind
the argument on every graph that reads its destination. Helios requires at least
one selected binding per argument and cannot see which captured graphs read a
persistent buffer. No throughput or output-quality benefit is claimed.

CPU results on this revision (Linux x86_64, no GPU assigned): without
features, 576 Helios library tests passed and four manual benchmarks were
ignored. With runtime-core and server, 1,586 library tests passed and 38 were
ignored for a missing CUDA device, exported test core or tokenizer snapshot.
The Helios library tests check native packed bytes, prefix identity, lookup
retry, preemption and protocol decoding; the direct tests check Python packing
and checkpoint reuse. Direct: 94 passed, two CUDA-device tests skipped. CLI:
130 passed. The preparation suite fails 13 tests, the same 13 on this revision
and on the base tag in this environment. The eos, selene, selene-manager and
Flare Cargo suites and the preparation suite were run before the final edits,
which changed neither their tests nor the code they import.

GPU results come from three builds on four SM120 GPUs. The release CLI of
this revision (SHA-256
c311e67f0cbeed3c4c10e3e87e37506e787e022fff82c5f4e89cb8d467034860) loaded a signed
TP4 core exported without declarations and returned HTTP 400 for an undeclared
argument; it also ran the prefix-isolation and declaring-core fixed-continuation
checks. The same source plus a nine-line stderr trace
(aa503ef1f573eada8141bdb4763bb960ceef7357873a33513d1e8d657eedf116) produced the
free-running chat pairs. The release CLI of the base commit c0c4f79
(98773503faf34471179408f5a8037048520b2c96246d5d6b42b17501bddb8aef) supplied the
baseline for the declaration-free comparisons. Every server passed its PCIe performance checks
at startup.

The same 4,114-token prompt at gains 0.5 and 1.5 reused none of its tokens at
the first use of each gain and all of them on repeat. In two-row batches with a
grammar-fixed 32-token continuation, each row's 256 reported logprobs equal the
same-gain batch run with the same cached prompt: 1,024 of 1,024 across both gain
assignments. At eight rows, the core's largest decode graph, 3,789 of 4,096
values equal the second same-gain batch, and all 4,096 equal a same-gain repeat
when each row is compared with whichever of the two repeats it matched. At gain
1.5 the two repeats differ on every row by at most 0.0000038; at gain 0.5 they
are identical on six rows, differ on one row by at most 0.0000076, and on one
row in all 256 values by up to 1.33. The declaring core
was exported with --mtp-draft-tokens 0; a positive runtime setting is refused
for it, and its measured decode launches were plain decode. The declaring core
in these measurements was exported by an earlier iteration of the export code,
not by the tooling of this revision.

Eight rows matched only against a per-row choice of repeat, and the repeats
disagree; 16 and 32 concurrent requests and speculative decoding with an
argument were not qualified. Throughput on the declaration-free core and
workload: two stock runs bracketed one run of this CLI in run order (18,071.0,
18,250.5 and 18,156.6 prefill tokens per second; 2,497, 2,531 and 2,522
aggregate decode tokens per second at 32 requests), which does not isolate a
cost. In two-row plain-decode chat runs, scores differed even for pairs with
the same observed frame history and prior token IDs on both rows: all 332
changed-gain pairs and all 520 same-gain repeats exceeded a 0.05 top-logprob
tolerance, and none were equal; on the core without declarations, with no
scalar request, all 1,244 matched pairs exceeded it. With the production draft
settings on the core without declarations, the stock CLI and this CLI gave
different values for every reported logprob of a forced continuation, largest
2.87 at two rows and 8.17 at eight rows, while each repeated its own cached two-row batches exactly.
In plain decode each CLI also repeated its own cached two-row batches exactly,
and between them no value was equal (largest 3.03 at two rows and 5.54 at
eight rows). Follow-up controls ran the comparisons across process starts and
builds. The stock CLI does not reproduce itself across two starts on the same
forced continuation: 0 of 512 values equal at two rows (largest 2.93) and 0 of
2,048 at eight rows (largest 8.13). Two builds of one tree, the observer
against the release CLI, differ the same way (largest 2.91 and 2.67 at two
rows, 8.13 at eight rows), as do the stock CLI against this revision's release
CLI (largest 2.19 and 2.30 at two rows, 6.78 at eight). Within one process,
cached batches repeat exactly at two rows and agree to within 0.000004 at
eight rows, with one observer outlier of 0.49. The difference between the
stock CLI and this revision is therefore of the same kind and size as the
stock CLI against itself across two starts, on one forced continuation, once
per arm; these comparisons do not isolate a numeric change to a core without
declarations. The declaring core's throughput on this revision's CLI in plain
decode: 9,625.5 prefill tokens per second (248,375 tokens in 25.8039 s),
aggregate decode 182.70, 960.77 and 988.06 tokens per second at 1, 8 and 32
requests, 212,992 KV pages, startup 90.1 s; a different core and export
settings, so not comparable with the declaration-free figures.
The cause of these differences is not identified. Open checks are listed in
docs/TODO.txt.

Design-Signed-Off-By: omp coding agent (zai/glm-5.4), agent for Josh Cartu; design-review=eb2f
Signed-off-by: Joshua Cartu <[email protected]>
jcartu added a commit to jcartu/hyperflare-inference that referenced this pull request Nov 25, 2026
Captured graphs already receive request inputs such as token IDs and
positions. What a recipe cannot declare is a named, client-supplied FP32
conditioning value for its forward. The six FP32 sampling columns carry the
per-request values that select tokens, and captured operations read them only
in the sampling stage, after the logits. Putting a recipe-specific operand into
the sampling columns would widen a layout shared by every core. A separately
declared buffer leaves that layout unchanged. In NVIDIA#404, Luke Alonso requested a
generic alternative declared in the model proto. At the configured cache
capacity, the target host can hold one four-rank core. It needs to serve
requests at two conditioning strengths without swapping weights. Because a
recipe can use the value to change hidden state, the resolved value must also
take part in prefix identity.

Before this change the model proto could not declare such a value. Now a
core declares named FP32 arguments with defaults and optional inclusive
ranges, and a graph binding names an argument and its row indexing. Helios
resolves the values during request preparation, before prefix-pool lookup,
clamps them to the declared ranges, packs
them in their own buffer in the native and direct paths, and includes their
canonical bits (the FP32 bit pattern, with negative zero stored as positive
zero) in prefix identity. Requests name values in a request_scalars object.
Protocol decoding rejects non-numeric values, numbers whose FP64 magnitude
exceeds f32::MAX, and nonzero FP64 values that narrow to FP32 zero; request
preparation rejects a name absent from the loaded core. A declaration without a
range accepts any finite FP32 value. The sampling layout is unchanged. A core
with no declarations keeps its prefix identity and rejects a request that names
an argument. Shared input packing also gains bounds and overflow checks on
existing integer, sampling and image writes. The Python protobuf module is
regenerated with protoc 36.2; its gencode version 7.36.2 is the minimum protobuf
runtime in pyproject.toml.

The engine change adds no captured-graph operation, and no recipe in this
commit consumes an argument. A recipe that reads an argument inside a captured
graph changes the input contract of that operation, which requires prior
approval from the project owner.

The result is a capability: a core can take a per-request FP32 value from one
loaded copy of the weights. Requests whose resolved values differ have
distinct prefix identities and cannot reuse each other's checkpoints. For the
same core and otherwise identical prefix inputs, values that narrow or clamp to
the same FP32 bits contribute the same scalar identity. The recipe must bind
the argument on every graph that reads its destination. Helios requires at least
one selected binding per argument and cannot see which captured graphs read a
persistent buffer. No throughput or output-quality benefit is claimed.

CPU results on this revision (Linux x86_64, no GPU assigned): without
features, 576 Helios library tests passed and four manual benchmarks were
ignored. With runtime-core and server, 1,586 library tests passed and 38 were
ignored for a missing CUDA device, exported test core or tokenizer snapshot.
The Helios library tests check native packed bytes, prefix identity, lookup
retry, preemption and protocol decoding; the direct tests check Python packing
and checkpoint reuse. Direct: 94 passed, two CUDA-device tests skipped. CLI:
130 passed. The tests/preparation suite fails 13 tests, the same 13 on this revision
and on the base tag in this environment. The eos, selene, selene-manager and
Flare Cargo suites and the preparation suite were run before the final edits,
which changed neither their tests nor the code they import.

GPU results come from three builds on four SM120 GPUs. The release CLI of
this revision (SHA-256
c311e67f0cbeed3c4c10e3e87e37506e787e022fff82c5f4e89cb8d467034860) loaded a signed
TP4 core exported without declarations and returned HTTP 400 for an undeclared
argument; it also ran the prefix-isolation and declaring-core fixed-continuation
checks. The same source plus a nine-line stderr trace
(aa503ef1f573eada8141bdb4763bb960ceef7357873a33513d1e8d657eedf116) produced the
free-running chat pairs. The release CLI of the base commit c0c4f79
(98773503faf34471179408f5a8037048520b2c96246d5d6b42b17501bddb8aef) supplied the
baseline for the declaration-free comparisons. Every server passed its PCIe performance checks
at startup.

The same 4,114-token prompt at gains 0.5 and 1.5 reused none of its tokens at
the first use of each gain and all of them on repeat. In two-row batches with a
grammar-fixed 32-token continuation, each row's 256 reported logprobs equal the
same-gain batch run with the same cached prompt: 1,024 of 1,024 across both gain
assignments. At eight rows, the core's largest decode graph, 3,789 of 4,096
values equal the second same-gain batch, and all 4,096 equal a same-gain repeat
when each row is compared with whichever of the two repeats it matched. At gain
1.5 the two repeats differ on every row by at most 0.0000038; at gain 0.5 they
are identical on six rows, differ on one row by at most 0.0000076, and on one
row in all 256 values by up to 1.33. The declaring core
was exported with --mtp-draft-tokens 0; a positive runtime setting is refused
for it, and its measured decode launches were plain decode. The declaring core
in these measurements was exported by an earlier iteration of the export code,
not by the tooling of this revision.

Eight rows matched only against a per-row choice of repeat, and the repeats
disagree; 16 and 32 concurrent requests and speculative decoding with an
argument were not qualified. Throughput on the declaration-free core and
workload: two stock runs bracketed one run of this CLI in run order (18,071.0,
18,250.5 and 18,156.6 prefill tokens per second; 2,497, 2,531 and 2,522
aggregate decode tokens per second at 32 requests), which does not isolate a
cost. In two-row plain-decode chat runs, scores differed even for pairs with
the same observed frame history and prior token IDs on both rows: all 332
changed-gain pairs and all 520 same-gain repeats exceeded a 0.05 top-logprob
tolerance, and none were equal; on the core without declarations, with no
scalar request, all 1,244 matched pairs exceeded it. With the production draft
settings on the core without declarations, the stock CLI and this CLI gave
different values for every reported logprob of a forced continuation, largest
2.87 at two rows and 8.17 at eight rows, while each repeated its own cached two-row batches exactly.
In plain decode each CLI also repeated its own cached two-row batches exactly,
and between them no value was equal (largest 3.03 at two rows and 5.54 at
eight rows). Follow-up controls ran the comparisons across process starts and
builds. The stock CLI does not reproduce itself across two starts on the same
forced continuation: 0 of 512 values equal at two rows (largest 2.93) and 0 of
2,048 at eight rows (largest 8.13). Two builds of one tree, the observer
against the release CLI, differ the same way (largest 2.91 and 2.67 at two
rows, 8.13 at eight rows), as do the stock CLI against this revision's release
CLI (largest 2.19 and 2.30 at two rows, 6.78 at eight). Within one process,
cached batches repeat exactly at two rows and agree to within 0.000004 at
eight rows, with one observer outlier of 0.49. The difference between the
stock CLI and this revision is therefore of the same kind and size as the
stock CLI against itself across two starts, on one forced continuation, once
per arm; these comparisons do not isolate a numeric change to a core without
declarations. The declaring core's throughput on this revision's CLI in plain
decode: 9,625.5 prefill tokens per second (248,375 tokens in 25.8039 s),
aggregate decode 182.70, 960.77 and 988.06 tokens per second at 1, 8 and 32
requests, 212,992 KV pages, startup 90.1 s; a different core and export
settings, so not comparable with the declaration-free figures.
The cause of these differences is not identified. Open checks are listed in
docs/TODO.txt.

Design-Signed-Off-By: omp coding agent (zai/glm-5.4), agent for Josh Cartu; design-review=eb2f
Signed-off-by: Joshua Cartu <[email protected]>
jcartu added a commit to jcartu/hyperflare-inference that referenced this pull request Nov 25, 2026
Captured graphs already receive request inputs such as token IDs and
positions. What a recipe cannot declare is a named, client-supplied FP32
conditioning value for its forward. The six FP32 sampling columns carry the
per-request values that select tokens, and captured operations read them only
in the sampling stage, after the logits. Putting a recipe-specific operand into
the sampling columns would widen a layout shared by every core. A separately
declared buffer leaves that layout unchanged. In NVIDIA#404, Luke Alonso requested a
generic alternative declared in the model proto. At the configured cache
capacity, the target host can hold one four-rank core. It needs to serve
requests at two conditioning strengths without swapping weights. Because a
recipe can use the value to change hidden state, the resolved value must also
take part in prefix identity.

Before this change the model proto could not declare such a value. Now a
core declares named FP32 arguments with defaults and optional inclusive
ranges, and a graph binding names an argument and its row indexing. Helios
resolves the values during request preparation, before prefix-pool lookup,
clamps them to the declared ranges, packs
them in their own buffer in the native and direct paths, and includes their
canonical bits (the FP32 bit pattern, with negative zero stored as positive
zero) in prefix identity. Requests name values in a request_scalars object.
Protocol decoding rejects non-numeric values, numbers whose FP64 magnitude
exceeds f32::MAX, and nonzero FP64 values that narrow to FP32 zero; request
preparation rejects a name absent from the loaded core. A declaration without a
range accepts any finite FP32 value. The sampling layout is unchanged. A core
with no declarations keeps its prefix identity and rejects a request that names
an argument. Shared input packing also gains bounds and overflow checks on
existing integer, sampling and image writes. The Python protobuf module is
regenerated with protoc 36.2; its gencode version 7.36.2 is the minimum protobuf
runtime in pyproject.toml.

The engine change adds no captured-graph operation, and no recipe in this
commit consumes an argument. A recipe that reads an argument inside a captured
graph changes the input contract of that operation, which requires prior
approval from the project owner.

The result is a capability: a core can take a per-request FP32 value from one
loaded copy of the weights. Requests whose resolved values differ have
distinct prefix identities and cannot reuse each other's checkpoints. For the
same core and otherwise identical prefix inputs, values that narrow or clamp to
the same FP32 bits contribute the same scalar identity. The recipe must bind
the argument on every graph that reads its destination. Helios requires at least
one selected binding per argument and cannot see which captured graphs read a
persistent buffer. No throughput or output-quality benefit is claimed.

CPU results on this revision (Linux x86_64, no GPU assigned): without
features, 576 Helios library tests passed and four manual benchmarks were
ignored. With runtime-core and server, 1,586 library tests passed and 38 were
ignored for a missing CUDA device, exported test core or tokenizer snapshot.
The Helios library tests check native packed bytes, prefix identity, lookup
retry, preemption and protocol decoding; the direct tests check Python packing
and checkpoint reuse. Direct: 94 passed, two CUDA-device tests skipped. CLI:
130 passed. The tests/preparation suite fails 13 tests, the same 13 on this revision
and on the base tag in this environment. The eos, selene, selene-manager and
Flare Cargo suites and tests/preparation were rerun on this revision: eos 1
passed, selene 467 passed, selene-manager 176 passed with one ignored, Flare
225 passed with four ignored, and tests/preparation 1,149 passed with 70
skipped and the same 13 failures as the base tag.

GPU results come from three builds on four SM120 GPUs. The release CLI of
this revision (SHA-256
c311e67f0cbeed3c4c10e3e87e37506e787e022fff82c5f4e89cb8d467034860) loaded a signed
TP4 core exported without declarations and returned HTTP 400 for an undeclared
argument; it also ran the prefix-isolation and declaring-core fixed-continuation
checks. The same source plus a nine-line stderr trace
(aa503ef1f573eada8141bdb4763bb960ceef7357873a33513d1e8d657eedf116) produced the
free-running chat pairs. The release CLI of the base commit c0c4f79
(98773503faf34471179408f5a8037048520b2c96246d5d6b42b17501bddb8aef) supplied the
baseline for the declaration-free comparisons. Every server passed its PCIe performance checks
at startup.

The same 4,114-token prompt at gains 0.5 and 1.5 reused none of its tokens at
the first use of each gain and all of them on repeat. In two-row batches with a
grammar-fixed 32-token continuation, each row's 256 reported logprobs equal the
same-gain batch run with the same cached prompt: 1,024 of 1,024 across both gain
assignments. At eight rows, the core's largest decode graph, 3,789 of 4,096
values equal the second same-gain batch, and all 4,096 equal a same-gain repeat
when each row is compared with whichever of the two repeats it matched. At gain
1.5 the two repeats differ on every row by at most 0.0000038; at gain 0.5 they
are identical on six rows, differ on one row by at most 0.0000076, and on one
row in all 256 values by up to 1.33. The declaring core
was exported with --mtp-draft-tokens 0; a positive runtime setting is refused
for it, and its measured decode launches were plain decode. The declaring core
in these measurements was exported by an earlier iteration of the export code,
not by the tooling of this revision.

Eight rows matched only against a per-row choice of repeat, and the repeats
disagree; 16 and 32 concurrent requests and speculative decoding with an
argument were not qualified. Throughput on the declaration-free core and
workload, with production draft settings (7 draft tokens, adaptive
verification): one run per build in the order stock, this CLI, stock gave
prefill 18,071.0, 18,250.5 and 18,156.6 tokens per second, and aggregate
decode at 32, 8 and 1 requests of (2,497, 1,307, 343.2), (2,531, 1,299,
342.6) and (2,522, 1,316, 343.3) tokens per second. This CLI falls outside
the range of the two stock runs on all four metrics, in both directions; one
run per arm does not isolate a cost. In two-row plain-decode chat runs, scores differed even for pairs with
the same observed frame history and prior token IDs on both rows: all 332
changed-gain pairs and all 520 same-gain repeats exceeded a 0.05 top-logprob
tolerance, and none were equal; on the core without declarations, with no
scalar request, all 1,244 matched pairs exceeded it. With the production draft
settings on the core without declarations, the stock CLI and this CLI gave
different values for every reported logprob of a forced continuation, largest
2.87 at two rows and 8.17 at eight rows, while each repeated its own cached two-row batches exactly.
In plain decode each CLI also repeated its own cached two-row batches exactly,
and between them no value was equal (largest 3.03 at two rows and 5.54 at
eight rows). Follow-up controls ran the comparisons across process starts and
builds. The stock CLI does not reproduce itself across two starts on the same
forced continuation: 0 of 512 values equal at two rows (largest 2.93) and 0 of
2,048 at eight rows (largest 8.13). Two builds of one tree, the observer
against the release CLI, differ the same way (largest 2.91 and 2.67 at two
rows, 8.13 at eight rows), as do the stock CLI against this revision's release
CLI (largest 2.19 and 2.30 at two rows, 6.78 at eight). Within one process,
cached batches repeat exactly at two rows and agree to within 0.000004 at
eight rows, with one observer outlier of 0.49. The difference between the
stock CLI and this revision is no larger than the stock CLI's difference
against itself across two starts, on one forced continuation, once per arm;
these comparisons do not isolate a numeric change to a core without
declarations. The declaring core's throughput on this revision's CLI in plain
decode: 9,625.5 prefill tokens per second (248,375 tokens in 25.8039 s),
aggregate decode 182.70, 960.77 and 988.06 tokens per second at 1, 8 and 32
requests, 212,992 KV pages, startup 90.1 s; a different core and export
settings, so not comparable with the declaration-free figures.
The cause of these differences is not identified. Open checks are listed in
docs/TODO.txt.

Design-Signed-Off-By: omp coding agent (zai/glm-5.4), agent for Josh Cartu; design-review=eb2f
Signed-off-by: Joshua Cartu <[email protected]>
jcartu added a commit to jcartu/hyperflare-inference that referenced this pull request Nov 25, 2026
Captured graphs already receive request inputs such as token IDs and
positions. What a recipe cannot declare is a named, client-supplied FP32
conditioning value for its forward. The six FP32 sampling columns carry the
per-request values that select tokens, and captured operations read them only
in the sampling stage, after the logits. Putting a recipe-specific operand into
the sampling columns would widen a layout shared by every core. A separately
declared buffer leaves that layout unchanged. In NVIDIA#404, Luke Alonso requested a
generic alternative declared in the model proto. At the configured cache
capacity, the target host can hold one four-rank core. It needs to serve
requests at two conditioning strengths without swapping weights. Because a
recipe can use the value to change hidden state, the resolved value must also
take part in prefix identity.

Before this change the model proto could not declare such a value. Now a
core declares named FP32 arguments with defaults and optional inclusive
ranges, and a graph binding names an argument and its row indexing. Helios
resolves the values during request preparation, before prefix-pool lookup,
clamps them to the declared ranges, packs
them in their own buffer in the native and direct paths, and includes their
canonical bits (the FP32 bit pattern, with negative zero stored as positive
zero) in prefix identity. Requests name values in a request_scalars object.
Protocol decoding rejects non-numeric values, numbers whose FP64 magnitude
exceeds f32::MAX, and nonzero FP64 values that narrow to FP32 zero; request
preparation rejects a name absent from the loaded core. A declaration without a
range accepts any finite FP32 value. The sampling layout is unchanged. A core
with no declarations keeps its prefix identity and rejects a request that names
an argument. Shared input packing also gains bounds and overflow checks on
existing integer, sampling and image writes. The Python protobuf module is
regenerated with protoc 36.2; its gencode version 7.36.2 is the minimum protobuf
runtime in pyproject.toml.

The engine change adds no captured-graph operation, and no recipe in this
commit consumes an argument. A recipe that reads an argument inside a captured
graph changes the input contract of that operation, which requires prior
approval from the project owner.

The result is a capability: a core can take a per-request FP32 value from one
loaded copy of the weights. Requests whose resolved values differ have
distinct prefix identities and cannot reuse each other's checkpoints. For the
same core and otherwise identical prefix inputs, values that narrow or clamp to
the same FP32 bits contribute the same scalar identity. The recipe must bind
the argument on every graph that reads its destination. Helios requires at least
one selected binding per argument and cannot see which captured graphs read a
persistent buffer. No throughput or output-quality benefit is claimed.

CPU results on this revision (Linux x86_64, no GPU assigned): without
features, 576 Helios library tests passed and four manual benchmarks were
ignored. With runtime-core and server, 1,586 library tests passed and 38 were
ignored for a missing CUDA device, exported test core or tokenizer snapshot.
The Helios library tests check native packed bytes, prefix identity, lookup
retry, preemption and protocol decoding; the direct tests check Python packing
and checkpoint reuse. Direct: 94 passed, two CUDA-device tests skipped. CLI:
130 passed. The tests/preparation suite fails 13 tests, the same 13 on this revision
and on the base tag in this environment. The eos, selene, selene-manager and
Flare Cargo suites and tests/preparation were rerun on this revision: eos 1
passed, selene 467 passed, selene-manager 176 passed with one ignored, Flare
225 passed with four ignored, and tests/preparation 1,149 passed with 70
skipped and the same 13 failures as the base tag.

GPU results come from three builds on four SM120 GPUs. The release CLI of
this revision (SHA-256
c311e67f0cbeed3c4c10e3e87e37506e787e022fff82c5f4e89cb8d467034860) loaded a signed
TP4 core exported without declarations and returned HTTP 400 for an undeclared
argument; it also ran the prefix-isolation and declaring-core fixed-continuation
checks. The same source plus a nine-line stderr trace
(aa503ef1f573eada8141bdb4763bb960ceef7357873a33513d1e8d657eedf116) produced the
free-running chat pairs. The release CLI of the base commit c0c4f79
(98773503faf34471179408f5a8037048520b2c96246d5d6b42b17501bddb8aef) supplied the
baseline for the declaration-free comparisons. Every server passed its PCIe performance checks
at startup.

The same 4,114-token prompt at gains 0.5 and 1.5 reused none of its tokens at
the first use of each gain and all of them on repeat. In two-row batches with a
grammar-fixed 32-token continuation, each row's 256 reported logprobs equal the
same-gain batch run with the same cached prompt: 1,024 of 1,024 across both gain
assignments. At eight rows, the core's largest decode graph, 3,789 of 4,096
values equal the second same-gain batch, and all 4,096 equal a same-gain repeat
when each row is compared with whichever of the two repeats it matched. At gain
1.5 the two repeats differ on every row by at most 0.0000038; at gain 0.5 they
are identical on six rows, differ on one row by at most 0.0000076, and on one
row in all 256 values by up to 1.33. The declaring core
was exported with --mtp-draft-tokens 0; a positive runtime setting is refused
for it, and its measured decode launches were plain decode. The declaring core
in these measurements was exported by an earlier iteration of the export code,
not by the tooling of this revision.

Eight rows matched only against a per-row choice of repeat, and the repeats
disagree; 16 and 32 concurrent requests and speculative decoding with an
argument were not qualified. Throughput on the declaration-free core and
workload, with production draft settings (7 draft tokens, adaptive
verification): one run per build in the order stock, this CLI, stock gave
prefill 18,071.0, 18,250.5 and 18,156.6 tokens per second, and aggregate
decode at 32, 8 and 1 requests of (2,497, 1,307, 343.2), (2,531, 1,299,
342.6) and (2,522, 1,316, 343.3) tokens per second. This CLI falls outside
the range of the two stock runs on all four metrics, in both directions; one
run per arm does not isolate a cost. In two-row plain-decode chat runs, scores differed even for pairs with
the same observed frame history and prior token IDs on both rows: all 332
changed-gain pairs and all 520 same-gain repeats exceeded a 0.05 top-logprob
tolerance, and none were equal; on the core without declarations, with no
scalar request, all 1,244 matched pairs exceeded it. With the production draft
settings on the core without declarations, the stock CLI and this CLI gave
different values for every reported logprob of a forced continuation, largest
2.87 at two rows and 8.17 at eight rows, while each repeated its own cached two-row batches exactly.
In plain decode each CLI also repeated its own cached two-row batches exactly,
and between them no value was equal (largest 3.03 at two rows and 5.54 at
eight rows). Follow-up controls ran the comparisons across process starts and
builds. The stock CLI does not reproduce itself across two starts on the same
forced continuation: 0 of 512 values equal at two rows (largest 2.93) and 0 of
2,048 at eight rows (largest 8.13). Two builds of one tree, the observer
against the release CLI, differ the same way (largest 2.91 and 2.67 at two
rows, 8.13 at eight rows), as do the stock CLI against this revision's release
CLI (largest 2.19 and 2.30 at two rows, 6.78 at eight). Within one process,
cached batches repeat exactly at two rows and agree to within 0.000004 at
eight rows, with one outlier of 0.49 in the build carrying a nine-line stderr trace. The difference between the
stock CLI and this revision is no larger than the stock CLI's difference
against itself across two starts, on one forced continuation, once per arm;
these comparisons do not isolate a numeric change to a core without
declarations. The declaring core's throughput on this revision's CLI in plain
decode: 9,625.5 prefill tokens per second (248,375 tokens in 25.8039 s),
aggregate decode 182.70, 960.77 and 988.06 tokens per second at 1, 8 and 32
requests, 212,992 KV pages, startup 90.1 s; a different core and export
settings, so not comparable with the declaration-free figures.
The cause of these differences is not identified. Open checks are listed in
docs/TODO.txt.

Design-Signed-Off-By: omp coding agent (zai/glm-5.4), agent for Josh Cartu; design-review=eb2f
Signed-off-by: Joshua Cartu <[email protected]>
jcartu added a commit to jcartu/hyperflare-inference that referenced this pull request Nov 25, 2026
Captured graphs already receive request inputs such as token IDs and
positions. What a recipe cannot declare is a named, client-supplied FP32
conditioning value for its forward. The six FP32 sampling columns carry the
per-request values that select tokens, and captured operations read them only
in the sampling stage, after the logits. Putting a recipe-specific operand into
the sampling columns would widen a layout shared by every core. A separately
declared buffer leaves that layout unchanged. In NVIDIA#404, Luke Alonso requested a
generic alternative declared in the model proto. At the configured cache
capacity, the target host can hold one four-rank core. It needs to serve
requests at two conditioning strengths without swapping weights. Because a
recipe can use the value to change hidden state, the resolved value must also
take part in prefix identity.

Before this change the model proto could not declare such a value. Now a
core declares named FP32 arguments with defaults and optional inclusive
ranges, and a graph binding names an argument and its row indexing. Helios
resolves the values during request preparation, before prefix-pool lookup,
clamps them to the declared ranges, packs them in their own buffer in the
native and direct paths, and includes their canonical bits (the FP32 bit
pattern, with negative zero stored as positive zero) in prefix identity. Requests name values in a request_scalars object.
Protocol decoding rejects non-numeric values, numbers whose FP64 magnitude
exceeds f32::MAX, and nonzero FP64 values that narrow to FP32 zero; request
preparation rejects a name absent from the loaded core. A declaration without a
range accepts any finite FP32 value. The sampling layout is unchanged. A core
with no declarations keeps its prefix identity and rejects a request that names
an argument. Shared input packing also gains bounds and overflow checks on
existing integer, sampling and image writes. The Python protobuf module is
regenerated with protoc 36.2; its gencode version 7.36.2 is the minimum protobuf
runtime in pyproject.toml.

The engine change adds no captured-graph operation, and no recipe in this
commit consumes an argument. A recipe that reads an argument inside a captured
graph changes the input contract of that operation, which requires prior
approval from the project owner.

The result is a capability: a core can take a per-request FP32 value from one
loaded copy of the weights. Requests whose resolved values differ have
distinct prefix identities and cannot reuse each other's checkpoints. For the
same core and otherwise identical prefix inputs, values that narrow or clamp to
the same FP32 bits contribute the same scalar identity. The recipe must bind
the argument on every graph that reads its destination. Helios requires at least
one selected binding per argument and cannot see which captured graphs read a
persistent buffer. No throughput or output-quality benefit is claimed.

CPU results on this revision (Linux x86_64, no GPU assigned): without
features, 576 Helios library tests passed and four manual benchmarks were
ignored. With runtime-core and server, 1,586 library tests passed and 38 were
ignored for a missing CUDA device, exported test core or tokenizer snapshot.
The Helios library tests check native packed bytes, prefix identity, lookup
retry, preemption and protocol decoding; the direct tests check Python packing
and checkpoint reuse. Direct: 94 passed, two CUDA-device tests skipped. CLI:
130 passed. The tests/preparation suite fails 13 tests, the same 13 on this revision
and on the base tag in this environment. The eos, selene, selene-manager and
Flare Cargo suites and tests/preparation were rerun on this revision: eos 1
passed, selene 467 passed, selene-manager 176 passed with one ignored, Flare
225 passed with four ignored, and tests/preparation 1,149 passed with 70
skipped and the same 13 failures as the base tag.

GPU results come from three builds on four SM120 GPUs. The release CLI of
this revision (SHA-256
c311e67f0cbeed3c4c10e3e87e37506e787e022fff82c5f4e89cb8d467034860, built before the
final validation-only amendment; the final tree builds to
4c40832e83ffc5c049b45a3f14917cfc3567fc34754e41e645e13588884c0211) loaded a signed
TP4 core exported without declarations and returned HTTP 400 for an undeclared
argument; it also ran the prefix-isolation and declaring-core fixed-continuation
checks. The same source plus a nine-line stderr trace
(aa503ef1f573eada8141bdb4763bb960ceef7357873a33513d1e8d657eedf116) produced the
free-running chat pairs. The release CLI of the base commit c0c4f79
(98773503faf34471179408f5a8037048520b2c96246d5d6b42b17501bddb8aef) supplied the
baseline for the declaration-free comparisons. Every server passed its PCIe performance checks
at startup.

The same 4,114-token prompt at gains 0.5 and 1.5 reused none of its tokens at
the first use of each gain and all of them on repeat. In two-row batches with a
grammar-fixed 32-token continuation, each row's 256 reported logprobs equal the
same-gain batch run with the same cached prompt: 1,024 of 1,024 across both gain
assignments. At eight rows, the core's largest decode graph, 3,789 of 4,096
values equal the second same-gain batch, and all 4,096 equal a same-gain repeat
when each row is compared with whichever of the two repeats it matched. At gain
1.5 the two repeats differ on every row by at most 0.0000038; at gain 0.5 they
are identical on six rows, differ on one row by at most 0.0000076, and on one
row in all 256 values by up to 1.33. The declaring core
was exported with --mtp-draft-tokens 0; a positive runtime setting is refused
for it, and its measured decode launches were plain decode. The declaring core
in these measurements was exported by an earlier iteration of the export code,
not by the tooling of this revision.

Eight rows matched only against a per-row choice of repeat, and the repeats
disagree; 16 and 32 concurrent requests and speculative decoding with an
argument were not qualified. Throughput on the declaration-free core and
workload, with production draft settings (7 draft tokens, adaptive
verification): one run per build in the order stock, this CLI, stock gave
prefill 18,071.0, 18,250.5 and 18,156.6 tokens per second, and aggregate
decode at 32, 8 and 1 requests of (2,497, 1,307, 343.2), (2,531, 1,299,
342.6) and (2,522, 1,316, 343.3) tokens per second. This CLI falls outside
the range of the two stock runs on all four metrics, in both directions; one
run per arm does not isolate a cost. In two-row plain-decode chat runs, scores differed even for pairs with
the same observed frame history and prior token IDs on both rows: all 332
changed-gain pairs and all 520 same-gain repeats exceeded a 0.05 top-logprob
tolerance, and none were equal; on the core without declarations, with no
scalar request, all 1,244 matched pairs exceeded it. With the production draft
settings on the core without declarations, the stock CLI and this CLI gave
different values for every reported logprob of a forced continuation, largest
2.87 at two rows and 8.17 at eight rows, while each repeated its own cached two-row batches exactly.
In plain decode each CLI also repeated its own cached two-row batches exactly,
and between them no value was equal (largest 3.03 at two rows and 5.54 at
eight rows). Follow-up controls ran the comparisons across process starts and
builds. The stock CLI does not reproduce itself across two starts on the same
forced continuation: 0 of 512 values equal at two rows (largest 2.93) and 0 of
2,048 at eight rows (largest 8.13). Two builds of one tree, the observer
against the release CLI, differ the same way (largest 2.91 and 2.67 at two
rows, 8.13 at eight rows), as do the stock CLI against this revision's release
CLI (largest 2.19 and 2.30 at two rows, 6.78 at eight). Within one process,
cached batches repeat exactly at two rows and agree to within 0.000004 at
eight rows, with one outlier of 0.49 in the build carrying a nine-line stderr trace. The difference between the
stock CLI and this revision are of the same order as the stock CLI's
difference against itself across two starts (largest 2.93 at two rows and
8.13 at eight rows): with production draft settings the stock CLI against
this revision's CLI gave largest differences of 2.87 and 8.17, in plain
decode 3.03 and 5.54, and in the follow-up control 2.19, 2.30 and 6.78;
these comparisons do not isolate a numeric change to a core without
declarations. The declaring core's throughput on this revision's CLI in plain
decode: 9,625.5 prefill tokens per second (248,375 tokens in 25.8039 s),
aggregate decode 182.70, 960.77 and 988.06 tokens per second at 1, 8 and 32
requests, 212,992 KV pages, startup 90.1 s; a different core and export
settings, so not comparable with the declaration-free figures.
The cause of these differences is not identified. Open checks are listed in
docs/TODO.txt.

Design-Signed-Off-By: omp coding agent (zai/glm-5.4), agent for Josh Cartu; design-review=eb2f
Signed-off-by: Joshua Cartu <[email protected]>
jcartu added a commit to jcartu/hyperflare-inference that referenced this pull request Nov 25, 2026
Captured graphs already receive request inputs such as token IDs and
positions. What a recipe cannot declare is a named, client-supplied FP32
conditioning value for its forward. The six FP32 sampling columns carry the
per-request values that select tokens, and captured operations read them only
in the sampling stage, after the logits. Putting a recipe-specific operand into
the sampling columns would widen a layout shared by every core. A separately
declared buffer leaves that layout unchanged. In NVIDIA#404, Luke Alonso requested a
generic alternative declared in the model proto. At the configured cache
capacity, the target host can hold one four-rank core. It needs to serve
requests at two conditioning strengths without swapping weights. Because a
recipe can use the value to change hidden state, the resolved value must also
take part in prefix identity.

Before this change the model proto could not declare such a value. Now a
core declares named FP32 arguments with defaults and optional inclusive
ranges, and a graph binding names an argument and its row indexing. Helios
resolves the values during request preparation, before prefix-pool lookup,
clamps them to the declared ranges, packs them in their own buffer in the
native and direct paths, and includes their canonical bits (the FP32 bit
pattern, with negative zero stored as positive zero) in prefix identity. Requests name values in a request_scalars object.
Protocol decoding rejects non-numeric values, numbers whose FP64 magnitude
exceeds f32::MAX, and nonzero FP64 values that narrow to FP32 zero; request
preparation rejects a name absent from the loaded core. A declaration without a
range accepts any finite FP32 value. The sampling layout is unchanged. A core
with no declarations keeps its prefix identity and rejects a request that names
an argument. Shared input packing also gains bounds and overflow checks on
existing integer, sampling and image writes. The Python protobuf module is
regenerated with protoc 36.2; its gencode version 7.36.2 is the minimum protobuf
runtime in pyproject.toml.

The engine change adds no captured-graph operation, and no recipe in this
commit consumes an argument. A recipe that reads an argument inside a captured
graph changes the input contract of that operation, which requires prior
approval from the project owner.

The result is a capability, verified at two request rows: a core can take a
per-request FP32 value from one loaded copy of the weights. Requests whose resolved values differ have
distinct prefix identities and cannot reuse each other's checkpoints. For the
same core and otherwise identical prefix inputs, values that narrow or clamp to
the same FP32 bits contribute the same scalar identity. The recipe must bind
the argument on every graph that reads its destination. Helios requires at least
one selected binding per argument and cannot see which captured graphs read a
persistent buffer. No throughput or output-quality benefit is claimed.

CPU results on this revision (Linux x86_64, no GPU assigned): without
features, 576 Helios library tests passed and four manual benchmarks were
ignored. With runtime-core and server, 1,586 library tests passed and 38 were
ignored for a missing CUDA device, exported test core or tokenizer snapshot.
The Helios library tests check native packed bytes, prefix identity, lookup
retry, preemption and protocol decoding; the direct tests check Python packing
and checkpoint reuse. Direct: 94 passed, two CUDA-device tests skipped. CLI:
130 passed. The eos, selene, selene-manager and
Flare Cargo suites and tests/preparation were rerun on this revision: eos 1
passed, selene 467 passed, selene-manager 176 passed with one ignored, Flare
225 passed with four ignored, and tests/preparation 1,149 passed with 70
skipped and the same 13 failures as the base tag.

GPU results come from three builds on four SM120 GPUs. The release CLI of
this revision (SHA-256
c311e67f0cbeed3c4c10e3e87e37506e787e022fff82c5f4e89cb8d467034860; the final tree builds to
4c40832e83ffc5c049b45a3f14917cfc3567fc34754e41e645e13588884c0211 and differs only by a
load-time validation check and test changes) loaded a signed
TP4 core exported without declarations and returned HTTP 400 for an undeclared
argument; it also ran the prefix-isolation and declaring-core fixed-continuation
checks. The same source plus a nine-line stderr trace
(aa503ef1f573eada8141bdb4763bb960ceef7357873a33513d1e8d657eedf116) produced the
free-running chat pairs. The release CLI of the base commit c0c4f79
(98773503faf34471179408f5a8037048520b2c96246d5d6b42b17501bddb8aef) supplied the
baseline for the declaration-free comparisons. Every server passed its PCIe performance checks
at startup.

The same 4,114-token prompt at gains 0.5 and 1.5 reused none of its tokens at
the first use of each gain and all of them on repeat. In two-row batches with a
grammar-fixed 32-token continuation, each row's 256 reported logprobs equal the
same-gain batch run with the same cached prompt: 1,024 of 1,024 across both gain
assignments. At eight rows, the core's largest decode graph, 3,789 of 4,096
values equal the second same-gain batch, and all 4,096 equal a same-gain repeat
when each row is compared with whichever of the two repeats it matched. At gain
1.5 the two repeats differ on every row by at most 0.0000038; at gain 0.5 they
are identical on six rows, differ on one row by at most 0.0000076, and on one
row in all 256 values by up to 1.33. The declaring core
was exported with --mtp-draft-tokens 0; a positive runtime setting is refused
for it, and its measured decode launches were plain decode. The declaring core
in these measurements was exported by an earlier iteration of the export code,
not by the tooling of this revision.

Eight rows matched only against a per-row choice of repeat, and the repeats
disagree; 16 and 32 concurrent requests and speculative decoding with an
argument were not qualified. Throughput on the declaration-free core and
workload, with production draft settings (7 draft tokens, adaptive
verification): one run per build in the order stock, this CLI, stock gave
prefill 18,071.0, 18,250.5 and 18,156.6 tokens per second, and aggregate
decode at 32, 8 and 1 requests of (2,497, 1,307, 343.2), (2,531, 1,299,
342.6) and (2,522, 1,316, 343.3) tokens per second. This CLI falls outside
the range of the two stock runs on all four metrics, in both directions; one
run per arm does not isolate a cost. In two-row plain-decode chat runs, scores differed even for pairs with
the same observed frame history and prior token IDs on both rows: all 332
changed-gain pairs and all 520 same-gain repeats exceeded a 0.05 top-logprob
tolerance, and none were equal; on the core without declarations, with no
scalar request, all 1,244 matched pairs exceeded it. With the production draft
settings on the core without declarations, the stock CLI and this CLI gave
different values for every reported logprob of a forced continuation, largest
2.87 at two rows and 8.17 at eight rows, while each repeated its own cached two-row batches exactly.
In plain decode each CLI also repeated its own cached two-row batches exactly,
and between them no value was equal (largest 3.03 at two rows and 5.54 at
eight rows). Across process starts and builds, the stock CLI does not
reproduce itself on the same forced continuation: 0 of 512 values equal at two
rows (largest 2.93) and 0 of 2,048 at eight rows (largest 8.13). Two builds of one tree, the observer
against the release CLI, differ the same way (largest 2.91 and 2.67 at two
rows, 8.13 at eight rows), as do the stock CLI against this revision's release
CLI (largest 2.19 and 2.30 at two rows, 6.78 at eight). Within one process,
cached batches repeat exactly at two rows and agree to within 0.000004 at
eight rows, with one outlier of 0.49 in the build carrying a nine-line stderr trace. The difference between the
stock CLI and this revision are of the same order as the stock CLI's
difference against itself across two starts (largest 2.93 at two rows and
8.13 at eight rows): with production draft settings the stock CLI against
this revision's CLI gave largest differences of 2.87 and 8.17, in plain
decode 3.03 and 5.54, and in the follow-up control 2.19, 2.30 and 6.78;
these comparisons do not isolate a numeric change to a core without
declarations. The declaring core's throughput on this revision's CLI in plain
decode: 9,625.5 prefill tokens per second (248,375 tokens in 25.8039 s),
aggregate decode 182.70, 960.77 and 988.06 tokens per second at 1, 8 and 32
requests, 212,992 KV pages, startup 90.1 s; a different core and export
settings, so not comparable with the declaration-free figures.
The cause of these differences is not identified. Open checks are listed in
docs/TODO.txt.

Design-Signed-Off-By: omp coding agent (zai/glm-5.4), agent for Josh Cartu; design-review=eb2f
Signed-off-by: Joshua Cartu <[email protected]>
jcartu added a commit to jcartu/hyperflare-inference that referenced this pull request Nov 25, 2026
Captured graphs already receive request inputs such as token IDs and
positions. What a recipe cannot declare is a named, client-supplied FP32
conditioning value for its forward. The six FP32 sampling columns carry the
per-request values that select tokens, and captured operations read them only
in the sampling stage, after the logits. Putting a recipe-specific operand into
the sampling columns would widen a layout shared by every core. A separately
declared buffer leaves that layout unchanged. In NVIDIA#404, Luke Alonso requested a
generic alternative declared in the model proto. At the configured cache
capacity, a host with four RTX PRO 6000 Blackwell GPUs can hold one four-rank
core. It needs to serve
requests at two conditioning strengths without swapping weights. Because a
recipe can use the value to change hidden state, the resolved value must also
take part in prefix identity.

Before this change the model proto could not declare such a value. Now a
core declares named FP32 arguments with defaults and optional inclusive
ranges, and a graph binding names an argument and its row indexing. Helios
resolves the values during request preparation, before prefix-pool lookup,
clamps them to the declared ranges, packs them in their own buffer in the
native and direct paths, and includes their canonical bits (the FP32 bit
pattern, with negative zero stored as positive zero) in prefix identity. Requests name values in a request_scalars object.
Protocol decoding rejects non-numeric values, numbers whose FP64 magnitude
exceeds f32::MAX, and nonzero FP64 values that narrow to FP32 zero; request
preparation rejects a name absent from the loaded core. A declaration without a
range accepts any finite FP32 value. The sampling layout is unchanged. A core
with no declarations keeps its prefix identity and rejects a request that names
an argument. Shared input packing also gains bounds and overflow checks on
existing integer, sampling and image writes. The Python protobuf module is
regenerated with protoc 36.2; its gencode version 7.36.2 is the minimum protobuf
runtime in pyproject.toml.

The engine change adds no captured-graph operation, and no recipe in this
commit consumes an argument. A recipe that reads an argument inside a captured
graph changes the input contract of that operation, which requires prior
approval from the project owner.

The result is a capability, verified at two request rows: a core can take a
per-request FP32 value from one loaded copy of the weights. Requests whose resolved values differ have
distinct prefix identities and cannot reuse each other's checkpoints. For the
same core and otherwise identical prefix inputs, values that narrow or clamp to
the same FP32 bits contribute the same scalar identity. The recipe must bind
the argument on every graph that reads its destination. Helios requires at least
one selected binding per argument and cannot see which captured graphs read a
persistent buffer. No throughput or output-quality benefit is claimed.

CPU results on this revision (Linux x86_64, no GPU assigned): without
features, 576 Helios library tests passed and four manual benchmarks were
ignored. With runtime-core and server, 1,586 library tests passed and 38 were
ignored for a missing CUDA device, exported test core or tokenizer snapshot.
The Helios library tests check native packed bytes, prefix identity, lookup
retry, preemption and protocol decoding; the direct tests check Python packing
and checkpoint reuse. Direct: 94 passed, two CUDA-device tests skipped. CLI:
130 passed. The eos, selene, selene-manager and
Flare Cargo suites and tests/preparation were rerun on this revision: eos 1
passed, selene 467 passed, selene-manager 176 passed with one ignored, Flare
225 passed with four ignored, and tests/preparation 1,149 passed with 70
skipped and the same 13 failures as the base tag.

GPU results come from three builds on four SM120 GPUs. The release CLI of
this revision (SHA-256
c311e67f0cbeed3c4c10e3e87e37506e787e022fff82c5f4e89cb8d467034860; the final tree builds to
4c40832e83ffc5c049b45a3f14917cfc3567fc34754e41e645e13588884c0211 and differs only by a
load-time validation check and test changes) loaded a signed
TP4 core exported without declarations and returned HTTP 400 for an undeclared
argument; it also ran the prefix-isolation and declaring-core fixed-continuation
checks. The same source plus a nine-line stderr trace
(aa503ef1f573eada8141bdb4763bb960ceef7357873a33513d1e8d657eedf116) produced the
free-running chat pairs. The release CLI of the base commit c0c4f79
(98773503faf34471179408f5a8037048520b2c96246d5d6b42b17501bddb8aef) supplied the
baseline for the declaration-free comparisons. Every server passed its PCIe performance checks
at startup.

The same 4,114-token prompt at gains 0.5 and 1.5 reused none of its tokens at
the first use of each gain and all of them on repeat. In two-row batches with a
grammar-fixed 32-token continuation, each row's 256 reported logprobs equal the
same-gain batch run with the same cached prompt: 1,024 of 1,024 across both gain
assignments. At eight rows, the core's largest decode graph, 3,789 of 4,096
values equal the second same-gain batch, and all 4,096 equal a same-gain repeat
when each row is compared with whichever of the two repeats it matched. At gain
1.5 the two repeats differ on every row by at most 0.0000038; at gain 0.5 they
are identical on six rows, differ on one row by at most 0.0000076, and on one
row in all 256 values by up to 1.33. The declaring core
was exported with --mtp-draft-tokens 0; a positive runtime setting is refused
for it, and its measured decode launches were plain decode. The declaring core
in these measurements was exported by an earlier iteration of the export code,
not by the tooling of this revision.

Eight rows matched only against a per-row choice of repeat, and the repeats
disagree; 16 and 32 concurrent requests and speculative decoding with an
argument were not qualified. Throughput on the declaration-free core and
workload, with production draft settings (7 draft tokens, adaptive
verification): one run per build in the order stock, this CLI, stock gave
prefill 18,071.0, 18,250.5 and 18,156.6 tokens per second, and aggregate
decode at 32, 8 and 1 requests of (2,497, 1,307, 343.2), (2,531, 1,299,
342.6) and (2,522, 1,316, 343.3) tokens per second. This CLI falls outside
the range of the two stock runs on all four metrics, in both directions; one
run per arm does not isolate a cost. In two-row plain-decode chat runs, scores differed even for pairs with
the same observed frame history and prior token IDs on both rows: all 332
changed-gain pairs and all 520 same-gain repeats exceeded a 0.05 top-logprob
tolerance, and none were equal; on the core without declarations, with no
scalar request, all 1,244 matched pairs exceeded it. With the production draft
settings on the core without declarations, the stock CLI and this CLI gave
different values for every reported logprob of a forced continuation, largest
2.87 at two rows and 8.17 at eight rows, while each repeated its own cached two-row batches exactly.
In plain decode each CLI also repeated its own cached two-row batches exactly,
and between them no value was equal (largest 3.03 at two rows and 5.54 at
eight rows). Across process starts and builds, the stock CLI does not
reproduce itself on the same forced continuation: 0 of 512 values equal at two
rows (largest 2.93) and 0 of 2,048 at eight rows (largest 8.13). Two builds of one tree, the observer
against the release CLI, differ the same way (largest 2.91 and 2.67 at two
rows, 8.13 at eight rows), as do the stock CLI against this revision's release
CLI (largest 2.19 and 2.30 at two rows, 6.78 at eight). Within one process,
cached batches repeat exactly at two rows and agree to within 0.000004 at
eight rows, with one outlier of 0.49 in the build carrying a nine-line stderr trace. The difference between the
stock CLI and this revision is of the same order as the stock CLI's
difference against itself across two starts (largest 2.93 at two rows and
8.13 at eight rows): with production draft settings the stock CLI against
this revision's CLI gave largest differences of 2.87 and 8.17, in plain
decode 3.03 and 5.54, and in the follow-up control 2.19, 2.30 and 6.78;
these comparisons do not isolate a numeric change to a core without
declarations. The declaring core's throughput on this revision's CLI in plain
decode: 9,625.5 prefill tokens per second (248,375 tokens in 25.8039 s),
aggregate decode 182.70, 960.77 and 988.06 tokens per second at 1, 8 and 32
requests, 212,992 KV pages, startup 90.1 s; a different core and export
settings, so not comparable with the declaration-free figures.
The cause of these differences is not identified. Open checks are listed in
docs/TODO.txt.

Design-Signed-Off-By: omp coding agent (zai/glm-5.4), agent for Josh Cartu; design-review=eb2f
Signed-off-by: Joshua Cartu <[email protected]>
@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 404.
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

Copy link
Copy Markdown
Collaborator

Review Stopped

Auto-Review halted due to finding: It is low value or does not align with the project charter.
Value Proposition Report

@lukealonso

Copy link
Copy Markdown
Collaborator

Closing in favor of #505, which replaces the DeepSeek-specific steering_scale path with the generic ModelContract.scalar_arguments / SCALAR_ARGUMENT binding interface. Any recipe-side consumer belongs in local-inference-lab/hyperflare-recipes.

@lukealonso lukealonso closed this Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants