Expand description
Which checkpoint tensor fills each weight an authored program declares, and how.
The author names a layer’s weights the same way for every model (an3, Wq3, Qn3, Wo3, fn3, Wg3 …), in
the layout the language reads them: a projection Y = X matmul W holds W as in × out, row-major. A GGUF
checkpoint holds the same projection as out rows of in weights. The binding names the tensor and the view
that turns one into the other:
• a projection is transposed;
• a stacked expert tensor (ffn_gate_exps [d, dff, E]) is already the (E·dff) × d stack the moe sugar
reads, and the embedding table already vocab × d;
• a checkpoint whose rotation pairs neighbouring dimensions (2i, 2i+1 — Llama) has each head’s query and key
rows (and their norm weights) permuted so the pairs fall dims/2 apart, the pairing the rope sugar turns.
Attention scores are unchanged: the same orthogonal permutation multiplies every query and every key.
• a projection that holds several outputs per head (Qwen3.5’s gated attention: each head’s queries, then its
gate) is read a part of every head at a time, and one that stacks several projections (Gated DeltaNet’s
attn_qkv, its convolution kernel) a range of rows at a time.
The rotary tables (RC/RS, Rcos/Rsin) are not weights: rope_tables computes them from the spec. The
carried state — a KV cache, a convolution ring, a delta-rule memory — is not read from the checkpoint at all: it
starts at zero (Source::State).
A weight a spatial program reads as it is stored Q8_0 is two tensors, its int8 values and its block scales
(q8_planes), repacked from the checkpoint’s blocks through the same view. A rotary table’s values are
rotary_values.
Structs§
- Binding
- One declared weight’s source.
- Q8Planes
- A Q8_0 weight as a spatial program reads it (
spatial::passes::from_q8): the int8 values in the layout the program declares the weight,K × Nrow-major, and one scale per 32 rows of each column,K/32 × N. - Rotary
Table - A rotary table’s role: which rotation, a decode step’s caches (
cached) or a forward’s one row, cosines or sines. - Unbound
- Why a declared name has no source.
Enums§
- Host
Table - A table the host computes from the spec rather than reads from the checkpoint.
- Source
- Where a declared name’s values come from.
- View
- How a declared weight is read out of its tensor.
Functions§
- bind
- Where
varis read from, for a model ofspec. - computed_
tables - The host tables beyond the rotary ones that a decode step of
specreads, each once: a row of ones as wide as each head that a layer norms without a weight, a row of ones as wide as the model that spreads a shared expert’s gate across its row, and the cosines and sines of the attention temperature for each head width that takes one. - computed_
values - The values of a host table the spec alone gives (every one but a rotary table, whose frequency factors a checkpoint
may hold): a decode step’s caches of
positionsrows, or a forward’s one row.Nonefor a rotary table, or for a temperature table of a model that has none. - host_
values - The values of the host table
varnames (HostTable::named) for a model ofspec: a decode step’s caches ofpositionsrows, or a forward’s one row (position 0).Nonewhenvarnames no table. - neox_
order v(whole heads ofhead_dim) with each head’s rotateddimsreordered from interleaved pairs to halves — the basis aView::NeoxPairs-bound program’s queries and keys live in.- q8_
planes - The planes of the Q8_0 weight
bbinds, repacked from the checkpoint’s blocks: what a bundle manifest namesq8_0.valuesandq8_0.scales. The view moves each block’s int8 values asvaluesmoves the weights they scale, and a plane block’s scale is the scale of the one checkpoint block its 32 rows come from, sovalues[k][n] · scales[k/32][n]is the weightvaluesreads. Refused: a tensor stored in another format, declared rows that are not whole blocks of 32, and a view that lays a checkpoint block along the declared columns. - rope_
tables - The rotary tables for positions
0..rows: rowpholds the(cos, sin)of each of thedims/2frequencies (Rope::rotation— the checkpoint’s per-frequency factors, its sections, linear and YaRN scaling, the magnitude folded into both). - rotary_
values - The values of the rotary table
varnames (RotaryTable::named) for a model ofspec: a decode step’s caches ofpositionsrows, or a forward’s one row (position 0), of the rotation the name gives, the frequency factors read fromsourcewhen the rotation reads the checkpoint’s (rope_freqs.weight).Nonewhenvarnames no table. - rotation_
of - The rotation layer
lturns by, as its index inrotations—Nonefor a layer that does not rotate. - rotations
- The distinct rotations
spec’s attention layers turn by, in the order of the first layer to turn by each: a program declares one pair of rotary tables per rotation (Gemma’s local and global layers turn by two bases). - stored_
as_ q8_ planes - Whether the weight
bbinds is stored as the two planesq8_planesrepacks — Q8_0, its blocks down its declared rows — read from the checkpoint’s description of the tensor alone, never its bytes. - temperature
- The attention temperature
spec’s layers take — one for the model, as every family that has one sets it. - values
- A declared weight’s values, in the layout the program declares it (
rows × colsrow-major,View::declared).