Crate atlas_kernels

Crate atlas_kernels 

Source
Expand description

Atlas CUDA kernel PTX modules.

Single source of truth for embedded PTX. The spark-runtime (pure Rust engine) and benchmarks consume these.

PTX modules are grouped by KernelTarget — each (H, M_q) tuple maps to a distinct set of hyperoptimized kernels.

Constants, ptx_modules(), and all_ptx_sets() are auto-generated by build.rs from the kernels/{hw}/{model}/{quant}/ directories. When ATLAS_TARGET_MODEL=* or ATLAS_TARGET_QUANT=*, multiple targets are compiled and available at runtime.

Re-exports§

pub use resolve::ResolveCandidate;
pub use resolve::TargetResolveError;
pub use resolve::ptx_for_config;
pub use resolve::ptx_for_exact_target;

Modules§

resolve
Kernel-target resolution: which compiled target serves a checkpoint.

Structs§

DflashConfig
DFlash speculative-decoding pairing for a target model. Parsed from [dflash] in MODEL.toml at build time. None when the model has no DFlash drafter associated.
ModelBehavior
Model-specific behavior flags from MODEL.toml [behavior].
ModelTypeMatch
Declares which (model_type, hidden_size) pairs a kernel target supports. Parsed from [[model_types]] in MODEL.toml at build time.
SamplingCategory
Per-category sampling defaults from MODEL.toml.
SamplingPresets
Model-specific sampling presets loaded from MODEL.toml [sampling.*].
TargetPtxSet
Kernel modules hyperoptimized for a specific (H, M_q) target.

Constants§

DECODE_DOMAIN
Domain salt folded into every decode cold-tier key so a decode-ring blob can never collide with a Marconi prefix-hash key on a shared store/peer.
DECODE_ROLLBACK_RING_SLOTS
Phase-C: number of boundary SSM-state snapshots retained per sequence in the decode-rollback ring (hybrid GDN/Mamba models). DECOUPLED from ROLLBACK_RESTEER_CAP: the cap bounds how many times we re-steer, but the ring must retain enough boundary snapshots that a clean PRE-loop boundary survives long enough to roll back to. Sizing it at the old CAP + 1 = 3 meant a loop spanning ≥3 sentence/newline boundaries evicted the clean boundary before the fuzzy detector (3 repeats) fired, forcing a NoSsmSnapshot decline → hard-stop (observed: Claude-Code @ nvfp4-head, 2026-06-07). 8 covers the 3-repeat detector with margin at modest cost (8 × max_batch × per-layer GDN state, allocated once). Pure-attention models ignore this (their ring is 0; they roll back to any boundary).
DEFAULT_EFFORT_CAPPED_AT_CEILING
Default [behavior].effort_capped_at_ceiling — whether qualitative reasoning_effort levels are clamped at the model’s effective ceiling E (max_thinking_budget / --max-thinking-budget).
DEFAULT_MAX_INTER_TOOL_PROSE
Default cap on free-text tokens between successive tool calls on a tool-armed request ([behavior].max_inter_tool_prose).
DEFAULT_MAX_THINKING_BUDGET
Default [behavior].max_thinking_budget — the effort-ladder anchor E and the budget for budgetless thinking-on requests. 256 is the historical built-in every model inherited before MODEL.toml could override it. Lifted here (2026-08-14, effort-ladder work) because it was three hand-synced literals (lib.rs default, build-parse default, build-parse unwrap_or) — the exact drift shape that shipped #328’s 384-vs-3072 bug.
KERNEL_SET_HASH
Content fingerprint of the generated kernel set, emitted by build.rs as a rustc-env. Referencing it here makes cargo recompile this crate whenever the kernel set changes — closing the include!-not-tracked staleness hole that silently embedded a stale module list (the 98-vs-99 regression).
ROLLBACK_RESTEER_CAP
Phase-C: maximum number of watchdog-triggered rollbacks a single sequence may perform before the watchdog reverts to a hard stop. Bounds the worst case where re-steering re-enters the same attractor — without this a degenerate sequence could rollback indefinitely.
TARGET_CLOSURES
What each kernel target in THIS binary was compiled from, as JSON.

Functions§

all_ptx_sets
available_targets
All compiled kernel targets and their PTX module sets.
metallib_modules
ptx_for_model
Find the PTX module set for a target whose model name contains needle.
ptx_modules