IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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).

max quantize-report

Prints the per-layer quantization error from a run that set --error-report-dir, and writes the same values to quant_error_report.json in that directory. The command reads only the quant_error.*.max files the run left there, so it needs neither the model nor a GPU.

For example, quantize the MLP down projections on the fly while generating, then print the report:

max generate \
  --model HuggingFaceTB/SmolLM2-135M-Instruct \
  --quantization-format nvfp4 \
  --targets '^language_model\.layers\.\d+\.mlp\.down_proj$' \
  --error-report-dir quant-errors \
  --prompt "The capital of France is"

max quantize-report quant-errors

The table lists each quantized weight, worst relative error first:

layer                                           rel_error    snr_db     max_abs
-------------------------------------------------------------------------------
language_model.layers.26.mlp.down_proj.weight  9.5066e-02     20.44  1.6016e-01

rel_error is the norm of the quantization error divided by the norm of the source weight, snr_db is the signal-to-quantization-noise ratio in decibels, and max_abs is the largest absolute error in any element. When the directory holds no dumps, the command prints No quantization-error dumps found.

Usageโ€‹

max quantize-report [OPTIONS] DIRECTORY

Argumentsโ€‹

  • DIRECTORYโ€‹

    Required argument