Expand description
The reference forward: what a ModelSpec computes, evaluated in f64 on the CPU over the checkpoint’s own
weights.
This is the oracle every compiled lane and every competitor is measured against — the “same-weights” reference:
the weights are exactly the checkpoint’s (each dequantized as ggml defines its format), and everything after the
weights is f64, so the only error left in a lane’s logits is the lane’s own. It runs one prompt as a batch per
layer (each weight is read once per pass, not once per token) and then decodes with a KV cache.
The operations follow llama.cpp’s graph for each architecture (src/models/<arch>.cpp at the pinned commit).
Structs§
- Reference
- The reference model over a checkpoint.
- Rounding
Call - A rounding the reference made within
NEAR_ROUNDINGof a half-way point: valueelementof the activation whosef32values hash toactivation(word0 the int8 or two-pass high word, 1 the low word,CACHE_WORDa cached row’s binary16), first made in the step ending atposition,marginlevels from the half-way point (a cached value’s in levels of its row’s scale, its largest magnitude over 127). An activation is one decision however many projections read it — the lane quantizes it once — so a call names the activation, not the read. - Routing
Call - The closest call a router made: at
position(0-based) in layerlayer, the last expert (or expert group) it chose scoredmarginabove the first it passed over, on a selection score ofscore. A run in another precision may choose otherwise wherevermarginis below what that precision resolves atscore. - Tensors
- Tensors held in memory, each in a GGUF format.
Enums§
- Activations
- How the reference’s projections by quantized weights read their activations. Exact is the model’s arithmetic; the others are the activations a quantized matmul reads under llama.cpp’s rule — a quantized weight reads a quantized activation — computed as the GPU lane’s kernels compute them, so a lane can be held to its own precision.
- KvStorage
- How an attention block’s cache keeps the rows it is given.
- Near
Call - A decision the reference made near its other outcome — one a run in another precision may make the other way.
- Reference
Error - Why the reference cannot run a checkpoint.
- State
Storage - How a gated-delta layer keeps its recurrent memory between steps.
Constants§
- CACHE_
WORD - The word a cached value’s binary16 rounding is recorded under (
RoundingCall::word). - DEFAULT_
CACHE_ BUDGET - The bytes the reference keeps of a checkpoint’s tensors by default: every tensor of a model up to this size is read from the file once.
- NEAR_
ROUNDING - How near a half-way point between two levels a rounding the reference records lies, in levels: within it, a run
whose activation differs from the reference’s by its own
f32rounding may take the other level. - NEAR_
ROUTING - How near a tie, as a fraction of the chosen score, a routing call the reference records lies.
Traits§
- Weight
Source - Where the reference reads a model’s weights: a checkpoint, or tensors held in memory (a test’s tiny model).
Tensors are named and laid out as GGUF names and lays them out (
dims[0]the fastest).
Functions§
- argmax
- The index of the largest logit (the first of equals).
- quantize_
activations xas a projection by a quantized weight reads it undermode, a block of 32 values at a time.