Repository navigation
Bind core-declared FP32 parameters into text forward graphs - #505
Merged
Merged
Conversation
jcartu
force-pushed
the
pr/core-declared-graph-inputs
branch
7 times, most recently
from
November 25, 2026 03:50
d8b3d22 to
8bf2284
Compare
lukealonso
force-pushed
the
pr/core-declared-graph-inputs
branch
from
November 28, 2026 22:41
8bf2284 to
7374e22
Compare
lukealonso
marked this pull request as ready for review
November 28, 2026 22:52
Captured CUDA graphs already receive per-request inputs such as token IDs,
positions, and the six-column sampling parameters, which are consumed only by
post-logit sampling. Model recipes that condition forward computation on a
client-supplied FP32 parameter cannot reuse the sampling layout without widening
a contract shared by every core, and cannot isolate prefix-cache checkpoints by
the conditioning value without native scheduler support. Declaring named FP32
core parameters in the model contract lets a single loaded core serve requests
with different conditioning values without model-specific native policy or
per-model flags.
This change extends the runtime core contract, Helios runtime, Heliopause
exporter, and Ignition preparation and direct-execution paths additively:
- Schema and helpers (`helios/proto/runtime_core.proto`,
`ignition/preparation/runtime_core_pb2.py`,
`ignition/preparation/contract.py`): add `ModelContract.core_parameters = 8`,
`CoreParameter`, `CoreParameterRange`, `ValueSource::CORE_PARAMETER = 43`,
and `ValueBinding.parameter = 7`, keeping `ModelContract.version` at 3 and
leaving existing cores without declarations unchanged.
- Contract and export validation (`helios/src/model/contract.rs`,
`helios/src/runtime_core/protobuf.rs`, `heliopause/src/export/binding.rs`):
validate unique nonempty names, required finite FP32 defaults, ordered finite
ranges containing their defaults, contiguous width-one FP32 destination
buffers covering prepared request capacity, zero offset and padding, and an
empty `tensor` field. Restrict `CORE_PARAMETER` bindings to text forward
graphs (`PREFILL`, `TERMINAL_PREFILL`, `SCORED_PREFILL`, `RESUME`, `DECODE`,
`SPECULATIVE`, and `MIXED`), rejecting `VISION`, `INIT`, `RESTORE`, and
`SNAPSHOT` graphs, and require every selected text forward graph to bind every
declared core parameter so no forward step can read stale slot storage.
- HTTP decoding, discovery, admission, prefix hashing, and packing
(`helios/src/server/`, `helios/src/scheduler.rs`, `helios/src/cache/hash.rs`,
`helios/src/model/{admission,packing}.rs`): accept an optional top-level
`core_parameters` object on Chat, Completions, Responses, and Messages
requests (treating omitted or `null` as prepared defaults, rejecting unknown
names, non-objects, booleans, non-numbers, non-finite values, magnitudes
above `f32::MAX`, and nonzero underflow to FP32 zero with HTTP 400), clamp
finite values to declared inclusive ranges, canonicalize `-0.0` to `+0.0`,
advertise declarations under `flare.core_parameters` in `/v1/models`, hash
every declared core parameter in declaration order into the prefix-history
root (leaving the root hash unchanged when no core parameters are declared),
retain the resolved map in `AdmissionPlan` across pool lookup retries and
preemption/readmission, verify exact bit equality against the planned value
during step packing, and pre-allocate staging storage in `Inputs::new` with
checked offset and extent arithmetic.
- Direct diagnostic execution and documentation (`ignition/direct/`,
`docs/api.md`, `docs/direct-execution.md`, `helios/model-contract.md`):
mirror the same text-forward binding rules, top-level-only `core_parameters`
decoding, `/v1/models` metadata, packing, immutable request parameter map,
and checkpoint isolation.
Claimed result: a model core can declare generic per-request FP32 core
parameters consumed by text forward graphs with shared admission validation,
prefix-cache isolation, and zero steady-state packing allocation, while cores
without declarations retain their wire contract and prefix-cache hashes. No
recipe in this repository binds a core parameter, and no throughput or
output-quality improvement is claimed.
Supporting evidence and limitations:
- Python CPU tests (`tests/direct`, `tests/cli`,
`tests/preparation/test_core_boundary.py`): 218 passed, 2 CUDA-gated skipped.
- Rust CPU tests (`--locked --release`): `flare-helios --features
runtime-core,server --lib` 1,692 passed, 43 ignored, 1 unrelated pre-existing
`origin/main` failure (`packed_combined_budget_keeps_width_one_batches_without_a_useful_packed_shape`);
`flare-helios --test '*'` 61 passed, 37 ignored; `flare-heliopause` 209
passed, 5 ignored (including `serving_metadata_round_trips_and_validates_core_parameters`);
`flare` 236 passed, 4 ignored; `flare-cli` 224 passed, 3 ignored
(`distribution::tests::source_waits_for_receiver_file_verification` skipped as
a pre-existing 130 s environment failure).
- TLA+ models and Rust lifecycle conformance (`verification/helios-lifecycle/check.py`,
TLC 2.19): all 9 models, model mutations, Rust source mutations, and observed
Rust transition replays passed across all 8 conformance suites.
- Kani (`cargo kani --manifest-path helios/Cargo.toml --lib`, Kani 0.68.0 /
CBMC 6.11.0): 9 of 9 harnesses verified, 0 failures, including
`core_parameter_validation_enforces_finite_ordered_bounds` and
`core_parameter_resolution_produces_valid_canonical_value`.
- Unrun checks: live GPU export and serving of a core declaring
`core_parameters` were not run on this rebased revision in this CPU
verification environment.
Signed-off-by: Joshua Cartu <[email protected]>
Co-Authored-By: Luke Alonso <[email protected]>
Signed-off-by: Luke Alonso <[email protected]>
Design-Signed-Off-By: Antigravity (Gemini); design-review=c3a9
lukealonso
force-pushed
the
pr/core-declared-graph-inputs
branch
from
November 28, 2026 23:18
7374e22 to
ef94d62
Compare
Collaborator
|
A case file has been opened for 505. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Collaborator
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe core design, wire compatibility, HTTP decoding, prefix-cache salting, steady-state packing, and Kani/TLA+ verification are sound with 0 blockers, but two verified issues should be fixed: the latent unsalted-admission trap on
Have your agent review the Full Review for complete verified findings, To opt out, include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Captured CUDA graphs already receive per-request inputs such as token IDs, positions, and the six-column sampling parameters (
SAMPLING_PARAMETERS), which are read only by post-logit sampling. Model recipes that condition forward computation on a client-supplied FP32 parameter (for example, serving requests at different conditioning strengths from a single loaded multi-rank core without swapping weights) cannot reuse the sampling layout without widening a contract shared by every core, and cannot isolate prefix-cache checkpoints without native scheduler support.Because a recipe can use a core parameter to change hidden state during prefill and decode, the resolved value must participate in prefix-cache identity and be written consistently on every text forward launch. Declaring generic named FP32 core parameters in
ModelContractkeeps Helios free of model-specific policy or per-model capability flags while enforcing storage, validation, caching, and packing invariants in shared runtime code.What Changed
Before this change,
ModelContracthad no declaration for generic per-request FP32 inputs,ValueSourceended atPROMPT_LOOKAHEAD_LENGTH(42), HTTP decoding had nocore_parametersfield,/v1/modelsdid not advertise core parameters, andPrefixHistoryhashed only the domain tag and core identity into its root. After this change:helios/proto/runtime_core.proto,ignition/preparation/runtime_core_pb2.py,ignition/preparation/contract.py):ModelContract.core_parameters = 8(CoreParameterwithname,optional float default_value, and optionalCoreParameterRangewithoptional float min/max),ValueSource::CORE_PARAMETER = 43, andValueBinding.parameter = 7.ModelContract.versionat3; cores without core-parameter declarations encode and decode identically without re-export.ignition.preparation.contract.core_parameter(...),binding(..., parameter=...), andmodel_contract(..., core_parameters=...)with finite-FP32 validation and-0.0canonicalization.ignition/preparation/runtime_core_pb2.pywithprotoc36.1 (gencode7.36.1, verified clean underprotobuf>=7.36.2,<8).helios/src/model/contract.rs,helios/src/runtime_core/{mod,protobuf}.rs,heliopause/src/export/binding.rs):serving_contract/PreparedContract::validate) and during Heliopause export (serving_metadataviahelios_core::runtime_core::validate_core_parameters): nonempty unique names, present finitedefault_value, and whenrangeis present, present finitemin <= default_value <= max.CORE_PARAMETERbindings to text forward graphs (PREFILL,TERMINAL_PREFILL,SCORED_PREFILL,RESUME,DECODE,SPECULATIVE, andMIXED), rejectingVISION,INIT,RESTORE, andSNAPSHOTgraphs at load time.CORE_PARAMETERbinding to target a contiguous width-one FP32 buffer covering prepared request capacity withSUBMISSION_ROW,ACTIVE_ROW, orREQUEST_ROWindexing, zerovalue_offset, zeropadding, and emptytensor; reject nonemptyparameteron every otherValueSource.helios/src/server/,helios/src/scheduler.rs,helios/src/cache/hash.rs,helios/src/model/{admission,packing}.rs):core_parametersJSON object across all four generation protocols (Chat,Completions,Responses, andMessages). Omittingcore_parametersor passingnullresolves all declared core parameters to their prepared defaults. Non-object values, empty or unknown names, booleans, non-numeric values, non-finite numbers, values with magnitude abovef32::MAX, and nonzero values that underflow to FP32 zero return HTTP 400.rangeis omitted) and canonicalizing-0.0to+0.0.flare.core_parametersin/v1/modelswith canonicalized+0.0values.PrefixHistorywithPrefixHistory::with_core_parameters, hashing each declared core parameter in declaration order as(u64 len, name bytes, canonical FP32 bits)into the root hash while keeping the exact previous root hash (flare-prefix-root-v1\0 || identity) for cores with no declarations.RequestScheduler::plan_admissionunchanged for declaration-free callers and addplan_admission_with_core_parameters, validating resolved values via sharedvalidate_resolved_core_parameters, storing them onAdmissionPlanandLiveRequestacross pool lookup retries, preemption, and readmission, and verifying exact bit equality inInputs::pack_step.Inputs::core_parametersinInputs::newforSubmissionRowcore-parameter bindings (padding inactive rows with0.0without steady-state allocation) and guard offset/extent calculations with checked arithmetic.ignition/direct/{packing,scheduler,server}.py,docs/api.md,docs/direct-execution.md,helios/model-contract.md):core_parametersparsing,/v1/modelsflare.core_parametersadvertisement, FP32 row packing, immutableMappingProxyTyperequest parameter maps, and checkpoint key isolation./v1/modelsmetadata, request semantics, and direct-execution behavior.Claimed Result
A model core can declare generic per-request FP32 core parameters bound into its text forward graphs with shared load-time and export-time validation, strict HTTP request validation, deterministic prefix-cache isolation, and zero steady-state packing allocation. Cores without declared core parameters keep their existing wire contract (
ModelContract.version == 3), six-columnSAMPLING_PARAMETERSlayout, and prefix-cache root hashes.No model recipe in this repository binds a core parameter (official recipes live in
local-inference-lab/hyperflare-recipes). No throughput or output-quality improvement is claimed.Supporting Evidence and Limitations
Executed on Linux x86_64 (CPU and formal verification) against this commit:
tests/direct,tests/cli,tests/preparation/test_core_boundary.py: 218 passed, 2 skipped (CUDA-gated tests). Coverscore_parameterhelper and wire protobuf round-tripping (CORE_PARAMETER == 43), text-forward completeness and maintenance-graph rejection,SUBMISSION_ROW/ACTIVE_ROW/REQUEST_ROWpacking, checkpoint isolation, top-levelcore_parametersvalidation, and destination contiguity checks.--locked --release, withFLARE_TEST_TEMPLATE_DIRpopulated viatests/frontend/prepare_templates.py):flare-helios --features runtime-core,server --lib: 1,692 passed, 43 ignored, plus 1 unrelated pre-existing failure onorigin/main(model::tests::packed_combined_budget_keeps_width_one_batches_without_a_useful_packed_shape, broken when#555relaxedcatalog::validate). Covers protobuf wire round-trip and missing-field rejection, contract validation (includingVISION,INIT,RESTORE,SNAPSHOTrejection and missing-forward-graph rejection),SUBMISSION_ROW/ACTIVE_ROW/REQUEST_ROWpacking, bit-mismatch rejection,PrefixHistoryhash vectors,/v1/modelsmetadata, all 4 HTTP protocols, pool lookup retry, and preemption/readmission with parameter-salted checkpoints.flare-helios --features runtime-core,server --test '*': 61 passed, 0 failed, 37 ignored (checkpoint/snapshot-gated).flare-heliopause: 209 passed, 0 failed, 5 ignored, includingserving_metadata_round_trips_and_validates_core_parameters.flare: 236 passed, 0 failed, 4 ignored (228 lib, 7packed_canonical_download, 1reference_workflows).flare-cli: 224 passed, 0 failed, 3 ignored (24 integration tests acrosscache_commands,cli,inspect,unverified_payload, plus 200 bin unit tests;distribution::tests::source_waits_for_receiver_file_verificationwas skipped as an unrelated 130 s test failing onorigin/mainin this environment).verification/helios-lifecycle/check.py, TLC 2.19):Lifecycle, 1,291RankProtocol, 7,940DispatchRing, 8,490OffloadTransfer, 195,492CacheOwnership, 13,566Speculation, 365,508ResponseLifecycle, and 31CheckpointReservationtransitions).cargo kani --manifest-path helios/Cargo.toml --lib, Kani 0.68.0 / CBMC 6.11.0):f32values:model::contract::kani_proofs::core_parameter_validation_enforces_finite_ordered_boundsandmodel::contract::kani_proofs::core_parameter_resolution_produces_valid_canonical_value.core_parameterswere not run on this rebased commit in this CPU verification environment; GPU end-to-end qualification remains to be executed with a declaring recipe.Discord: jcartu