Expand description
Portable, deliberately unfused executor for canonical ModelPlan operations.
This crate is a correctness oracle, not a serving backend. It has no CUDA dependency and no external engine fallback. Unsupported canonical operations return a named error.
Modules§
- hidden_
trace - Env-gated hidden-state trace, shared by the reference executor and the CUDA trunk.
Structs§
- Reference
Draft Output - Reference
Fixture - Reference
MtpOutput - Reference
Multimodal Output - Reference
Output - Reference
State - Reference
Tensor - Reference
Vision Input - Reference
Vision Output - Streamed
Trunk Execution - Layer-at-a-time trunk execution over the exact per-layer math of
execute, for checkpoint-scale runs where all weights cannot be resident at once. The driver materializes only the current layer’s tensors, callsStreamedTrunkExecution::step, and frees them before the next layer.
Enums§
Functions§
- deterministic_
fixture - execute
- execute_
mtp_ standalone - Execute ONLY the MTP draft arm on CALLER-PROVIDED trunk wide states — the
real-checkpoint draft-parity instrument (mtp-spec lane): the full-trunk host
reference cannot hold the 360 GB artifact, but the MTP block’s rows fit host f32,
so the engine’s captured trunk wide state feeds this host twin and the draft
programs are compared row for row.
trunk_hiddenis [tokens, streams*hidden] (gated-residual plans) or [tokens, hidden]; row i seeds token_ids[i] — the same pairingexecuteuses internally. - execute_
multimodal - execute_
vision - kimi_
delta_ net_ layer - Kimi Delta Attention (recurrent_kimi_delta_attention + Glm5NextTextLinearAttention),
all f32, sequential over tokens. Only the lower-bound forget-gate branch exists:
GLM-5.3-Flash always configures
gate_lower_bound, so the softplus branch of Glm5NextTextForgetGate is dead for this model and deliberately not implemented. GPU-parity seam: run ONE KDA layer’s mixer overx([tokens, hidden], already pre-attention-normed) and return its output plus the recurrent state it leaves behind. - kpool_
allowed_ tokens - K-pool compressed indexer selection (Glm5NextTextIndexer.forward), single-sequence causal case: every token is a valid key, so pooling starts at index 0 and only causality masks candidates. Returns the allowed source-token set per query, sorted ascending.