Files
nvfp4_gguf_quant/README.md
T
zefieandClaude Sonnet 5.5 1e50e4e045 make round-to-grid with refinement the default, add --learned for learned rounding
On Qwen2.5-0.5B, learned rounding matched round-to-grid in perplexity and KL
(22.38 vs 22.37, 0.0920 vs 0.0919) at about six times the quantize time.
--simple is still accepted as a no-op. Docs and man pages updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 19:34:15 -05:00

34 lines
1.6 KiB
Markdown

These scripts require [llama.cpp](https://github.com/ggml-org/llama.cpp) and [Convert-to-Quant](https://github.com/silveroxides/convert_to_quant).
`hf`, the Hugging Face CLI command is also suggested, but not required.
For quantizations or conversions, try:
- `hf_to_nvfp4_gguf` (huggingface structure to GGUF)
- `gguf_to_nvfp4_gguf` (GGUF to GGUF)
- `safetensors_to_nvfp4_gguf` (ComfyUI style safetensors to GGUF (untested))
- `hf_to_nvfp4_safetensors` (huggingface structure to ComfyUI style safetensors)
- `hf_to_nvfp4_hf` (huggingface structure to NVFP4 Hugging Face structure)
- `gguf_to_nvfp4_hf` (GGUF to NVFP4 Hugging Face structure)
For model info, try:
- `hf_info` (huggingface structure)
- `gguf_info` (GGUF structure)
---
Example:
```bash
hf download coder3101/gemma-4-12B-it-heretic --local-dir gemma-4-12B-it-heretic
hf_to_nvfp4_gguf -o gemma-4-12B-it-heretic_nvfp4 gemma-4-12B-it-heretic
```
This would create a NVFP4 GGUF for Ollama/llama.cpp from `https://huggingface.co/coder3101/gemma-4-12B-it-heretic`
The same directory can be quantized to one ComfyUI NVFP4 safetensors file:
`hf_to_nvfp4_safetensors -o gemma-4-12B-it-heretic-NVFP4.safetensors gemma-4-12B-it-heretic`
Conversions between formats without quantization is available in the custom commands with `--no-quant`.
Quantization uses round-to-grid with block-scale and code refinement by default. On Qwen2.5-0.5B this matched convert_to_quant's learned rounding in perplexity and KL at about one sixth of the time. Pass `--learned` to use learned rounding anyway (`--simple` is accepted and is the default). `--no-quant` copies without quantizing.