quantize: expose NVFP4 as a quantization target#39
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ggml has full NVFP4 quantization support (
quantize_nvfp4, imatrix-aware, dispatched inggml_quantize_chunk) but the ftype was never wired intollama-quant.cpp/llama-quantize, so the only way to get an NVFP4 GGUF was converting NVIDIA's pre-quantized checkpoints.src/llama-quant.cpp: mapLLAMA_FTYPE_MOSTLY_NVFP4->GGML_TYPE_NVFP4tools/quantize/quantize.cpp: listNVFP4in the CLI type tabledev-build.yml/release-turboquant.yml: shipllama-quantizein the linux/macos archives (windows already ships it) so downloaded dev builds can produce test quants standaloneVerified 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.