inference/research
verifiedhigh · 0.95updated 2026-10-04

MLX nn/layers/quantized.py (_defaults_for_mode per-mode group sizes and bits)

repo

Fields

id
sources/qzgw-mlx-quantized-layer
Publisher
ml-explore
Kind
repo
Accessed
2026-10-04
notes
The authoritative MLX quantization defaults, verbatim from _defaults_for_mode: mode_defaults = {"affine": (64, 4), "mxfp4": (32, 4), "nvfp4": (16, 4), "mxfp8": (32, 8)}, and 'return group_size or default_group_size, bits or default_bits'. So MLX has FOUR distinct quantization modes each with its own group size, and affine-4bit defaults to 64 while mxfp4 is 32, nvfp4 is 16 and mxfp8 is 32. The docstring example is 'nn.quantize(model, group_size=64, bits=4, mode="affine")'. group_size is Optional[int] = None everywhere in the public API, so every call site may override it. Accessed 2026-10-04.

Notes

The authoritative MLX quantization defaults, verbatim from _defaults_for_mode: mode_defaults = {"affine": (64, 4), "mxfp4": (32, 4), "nvfp4": (16, 4), "mxfp8": (32, 8)}, and 'return group_size or default_group_size, bits or default_bits'. So MLX has FOUR distinct quantization modes each with its own group size, and affine-4bit defaults to 64 while mxfp4 is 32, nvfp4 is 16 and mxfp8 is 32. The docstring example is 'nn.quantize(model, group_size=64, bits=4, mode="affine")'. group_size is Optional[int] = None everywhere in the public API, so every call site may override it. Accessed 2026-10-04.

Cross-references

This record references no other records.