For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Python class
WeightSource
WeightSource
class max.nn.WeightSource(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases: Enum
Where a quantized weight’s bytes come from.
Orthogonal to QuantFormat. The format says what a weight is
once quantized – its grid, scales and byte layout. The source says how
it got that way, which decides only what the checkpoint holds and who
does the quantizing.
Keeping them apart matters because they are read by different code for different reasons. A kernel asks about the format; a weight loader asks about the source.
CHECKPOINT
CHECKPOINT = 'checkpoint'
Pre-quantized on disk: the checkpoint holds packed data and scales.
QUANTIZE
QUANTIZE = 'quantize'
Native precision on disk, quantized on the fly at first use.