Skip to content

quantize: expose NVFP4 as a quantization target#39

Merged
worthant merged 1 commit into
devfrom
feature/nvfp4-quantize
Jul 21, 2026
Merged

quantize: expose NVFP4 as a quantization target#39
worthant merged 1 commit into
devfrom
feature/nvfp4-quantize

Conversation

@worthant

Copy link
Copy Markdown
Member

ggml has full NVFP4 quantization support (quantize_nvfp4, imatrix-aware, dispatched in ggml_quantize_chunk) but the ftype was never wired into llama-quant.cpp / llama-quantize, so the only way to get an NVFP4 GGUF was converting NVIDIA's pre-quantized checkpoints.

  • src/llama-quant.cpp: map LLAMA_FTYPE_MOSTLY_NVFP4 -> GGML_TYPE_NVFP4
  • tools/quantize/quantize.cpp: list NVFP4 in the CLI type table
  • dev-build.yml / release-turboquant.yml: ship llama-quantize in the linux/macos archives (windows already ships it) so downloaded dev builds can produce test quants standalone

Verified locally with the dev-latest binary (b10018-1.0.0, a435955): SmolLM2-135M f16 -> NVFP4 = 259MB -> 88MB (1 tensor fallback, expected for embeddings), coherent generation via llama-cli (198 t/s CPU) and llama-server /v1/chat/completions.

…in archives

ggml already implements quantize_nvfp4 (incl. imatrix) and
ggml_quantize_chunk dispatches it, but neither llama-quant.cpp nor the
quantize tool mapped LLAMA_FTYPE_MOSTLY_NVFP4 to it, so NVFP4 GGUFs
could only be obtained by converting pre-quantized checkpoints. Wire the
ftype through and list NVFP4 in llama-quantize.

Also package llama-quantize into the linux/macos dev and release
archives (windows already ships it via Release\*) so a downloaded dev
build can produce test quants without a local checkout.

Verified locally: SmolLM2-135M f16 -> NVFP4 (259MB -> 88MB), coherent
output via llama-cli and llama-server (dev-latest binary) on CPU.
@worthant
worthant merged commit 56776fe into dev Jul 21, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant