Expand description
2026-09-25: The compiled kernel registry: the kernel blobs build.rs
embeds per target, and the per-model sampling and behaviour defaults
baked from each target’s MODEL.toml.
Each compiled target is a TargetPtxSet keyed by its KernelTarget
(arch, model, quant). ptx_modules(), all_ptx_sets(),
TARGET_DEFAULTS and TARGET_SM_COUNT are generated by build.rs into
OUT_DIR/target_ptx.rs from the kernels/<hw>/<model>/<quant>/
directories that METRALE_TARGET_HW, METRALE_TARGET_MODEL (default *)
and METRALE_TARGET_QUANT (default nvfp4) select.
Owner: kernels crate. Invariants:
ModelBehavior::default()and the build-time[behavior]parse share the constants inbehavior_defaults.rs.
Re-exports§
pub use resolve::ResolveCandidate;pub use resolve::TargetResolveError;pub use resolve::ptx_for_config;pub use resolve::ptx_for_exact_target;pub use attn_splitk::MAX_DECODE_SPLITS;pub use attn_splitk::SplitkPolicy;
Modules§
- attn_
splitk - 2026-09-25: Paged-decode attention launch geometry: the split-K count, the split-K workspace size and the GQA-packed kernel gate, as pure functions of configuration.
- resolve
- 2026-09-25: Kernel-target resolution: which compiled target serves a
checkpoint. The rules are pure functions over
ResolveCandidates, so they are tested without compiled kernels.
Structs§
- Dflash
Config - 2026-09-25: A target’s DFlash drafter pairing, from MODEL.toml
[dflash](parse_dflashinbuild_parse.rs). The section requiresdraft_model; the other keys default as noted. - Model
Behavior - 2026-09-25: Model-specific behaviour flags from MODEL.toml
[behavior], parsed at build time bybuild_parse_behavior.rs. “Default” below is the value of an absent key, which equalsModelBehavior::default(). - Model
Type Match - 2026-09-25: One
(model_type, hidden_size)pair a kernel target supports, from MODEL.toml[[model_types]]. - Sampling
Category - 2026-09-25: One MODEL.toml
[sampling.<category>]table, parsed bybuild_parse.rs(parse_sampling_presets). An absent table, or an absent key, takes the valueSamplingCat::default()gives inbuild.rs. - Sampling
Presets - 2026-09-25: Model-specific sampling presets from MODEL.toml
[sampling.*], one per category. - Target
Defaults - 2026-09-25: One compiled target’s serving defaults. A
constthatbuild.rswrites intoOUT_DIR/target_ptx.rsandlib.rsinclude!s, socrate::TARGET_DEFAULTSis known at compile time. - Target
PtxSet - 2026-09-25: One compiled kernel target: its
KernelTargetidentity, kernel blobs and MODEL.toml declarations.
Constants§
- DECODE_
DOMAIN - 2026-09-25: Domain separator mixed with the model fingerprint to form the
SSM decode-ring cold-tier namespace (
derive_decode_ns_saltedin metrale-model-engine), which keeps decode keys apart from other key spaces derived from the same fingerprint. - DECODE_
ROLLBACK_ RING_ SLOTS - 2026-09-25: Deepest per-sequence decode-rollback ring (boundary SSM-state
snapshots): the default depth, the top of the auto-fit ladder, and the
largest value
--ssm-decode-ring-slotsaccepts. A model without SSM layers gets no ring. - DEFAULT_
EFFORT_ CAPPED_ AT_ CEILING - 2026-09-25: Default
[behavior].effort_capped_at_ceiling: whether the qualitativereasoning_effortlevels are clamped at E (max_thinking_budget, or--max-thinking-budget). - DEFAULT_
MAX_ INTER_ TOOL_ PROSE - 2026-09-25: Default
[behavior].max_inter_tool_prose: the cap on free-text tokens between tool calls on a tool request. 0 is reserved: the runtime resolver (resolve_max_inter_tool_prose) maps it to “guard disabled”. A model can pin a tighter bound in its MODEL.toml, askernels/strix/qwen3.6-35b-a3bdoes with 384. - DEFAULT_
MAX_ THINKING_ BUDGET - 2026-09-25: Default
[behavior].max_thinking_budget: the anchor E of thereasoning_effortladder and the budget of a thinking-on request that names none. - KERNEL_
SET_ HASH - 2026-09-25: Hash of the generated
target_ptx.rstext (content_hashinbuild.rs), emitted as theMETRALE_KERNEL_SET_HASHrustc-env on both the compiling and the skip-stub path. Reading it here withenv!ties this crate’s build to the generated file’s content. - ROLLBACK_
RESTEER_ CAP - 2026-09-25: Most watchdog-triggered rollbacks one sequence may perform;
at this count
rollback_to_boundarydeclines and the watchdog ends the response instead of re-steering. - TARGET_
CLOSURES - 2026-09-25: What each kernel target in this binary was compiled from, as
JSON: a map of
"hardware/model/quant"to{hash, arch, compiler, flags}, computed bybuild.rs’sclosure_attestation. The benchmark record copies it (bench_record.rs,with_closure), so a record attests to the binary’s sources rather than to the working tree. - TARGET_
DEFAULTS - TARGET_
SM_ COUNT - Streaming multiprocessors on the hardware this binary’s kernels were
built for, from
kernels/<hw>/HARDWARE.toml[hardware] sm_count.
Functions§
- all_
ptx_ sets - available_
targets - 2026-09-25: Every compiled kernel target, one entry per target
(
all_ptx_sets()); empty under theMETRALE_SKIP_BUILDstub. - metallib_
modules - ptx_
for_ model - 2026-09-25: The first compiled target whose model name contains
needle(case-sensitive), orNone. - ptx_
modules