Expand description
2026-09-25: Device-resident weight types (QuantizedWeight, DenseWeight, Fp8Weight, PackedQ2Weight) and the WeightQuantFormat tag.
Owner: model-layers (weight loading). Invariants: none beyond the types.
Structs§
- Dense
Weight - 2026-09-25: Device pointer to an unquantized weight: BF16 unless the loader
that built it says otherwise (for example
dense_keep_f32). - Fp8Dense
Weight - 2026-09-25: FP8 E4M3 weight quantized from BF16 at load, with one f32 scale per row.
- Fp8Weight
- 2026-09-25: FP8 E4M3 weight with its scale. The layout of
row_scaledepends onscale_format: - Fp8Weight
Transposed - 2026-09-25: The transpose of a block-scaled
Fp8Weight, built byFp8Weight::transpose_for_gemmfor the prefill GEMM. - Packed
Q2Weight - 2026-09-25: Keep-packed ternary Q2_0 weight: one buffer of raw
block_q2_0blocks ([fp16 d][group/4 bytes of 2-bit codes],value = (code - 1) * d), row-major over[n, k], with the scale inline and no separate scale tensor. Built from aWeightDtype::PackedQ2_0store tensor, which the GGUF loader produces underMETRALE_GGUF_NATIVE_Q2=1. The store owns the buffer; this struct only holds the pointer. - Quantized
Weight - 2026-09-25: 4-bit quantized weight: packed E2M1 data, per-group scales and a host-side per-tensor scale.
Enums§
- Weight
Quant Format - 2026-09-25: The format of a weight buffer in device memory, as opposed to
the on-disk format (
Nvfp4Variant). A kernel call site checks it withWeightQuantFormat::expect, because a kernel cannot tell one layout from another by its pointer.