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>
This commit is contained in:
zefieandClaude Sonnet 5.5 committed 2026-11-05 19:34:15 -05:00
1 parent 164fa6b4a4
commit 1e50e4e045
16 files changed
+76 -39

No files matched your search

+6 -3
View File
@@ -23,7 +23,7 @@ gguf_to_nvfp4_hf \- convert and quantize GGUF models to NVFP4 Hugging Face forma
[\fB\-\-llama\-cpp\fR \fIPATH\fR]
[\fB\-\-convert\-to\-quant\fR \fIPATH\fR]
[\fB\-\-device\fR \fIDEVICE\fR]
[\fB\-\-simple\fR]
[\fB\-\-learned\fR]
[\fB\-\-optimizer\fR \fIOPT\fR]
[\fB\-\-num\-iter\fR \fIN\fR]
[\fB\-\-lr\fR \fILR\fR]
@@ -57,7 +57,7 @@ GGUF tensor names are reverse-mapped to canonical Hugging Face conventions
and RoPE permutations for Q and K are inverted.
.PP
If the source GGUF contains float or non-NVFP4 weights, 2D weight matrices are quantized
using convert_to_quant's learned rounding (or simple round-to-grid with \fB\-\-simple\fR).
using round-to-grid with block-scale and code refinement (or convert_to_quant's learned rounding with \fB\-\-learned\fR).
If the source GGUF already contains NVFP4 super-blocks, they are unpacked and repacked
into ModelOpt-compatible safetensors without loss of precision.
.PP
@@ -107,8 +107,11 @@ Data type for tensors when \fB\-\-no\-quant\fR is used (default: \fBauto\fR).
.BI \-\-output\-dtype " " {bfloat16,float16}
Data type used for unquantized 2D weights, layer norms, and embeddings (default: \fBbfloat16\fR).
.TP
.B \-\-learned
Use \fBconvert_to_quant\fR's learned rounding instead of the default round-to-grid with block-scale and code refinement. On Qwen2.5-0.5B it matched the default in perplexity and KL and took about six times as long.
.TP
.B \-\-simple
Round weights directly onto the E2M1 grid without iterative learned rounding.
Round onto the E2M1 grid without learned rounding (default; accepted for compatibility).
.SS Optimization & Learning Rate
.TP
.BI \-\-optimizer " " {auto,prodigy,adamw,radam,original}