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

+5 -2
View File
@@ -10,7 +10,7 @@ hf_to_nvfp4_safetensors \- quantize a Hugging Face directory to a ComfyUI NVFP4
[\fB\-\-heur\fR]
[\fB\-\-exclude\-layers\fR \fIREGEX\fR]
[\fB\-\-convert\-to\-quant\fR \fIPATH\fR]
[\fB\-\-simple\fR]
[\fB\-\-learned\fR]
[\fB\-\-optimizer\fR \fIOPT\fR]
[\fB\-\-num\-iter\fR \fIN\fR]
[\fB\-\-lr\fR \fILR\fR]
@@ -79,8 +79,11 @@ Skip layers that convert_to_quant's built-in size heuristic rejects.
Regular expression matching layer or tensor names to leave unquantized in float format.
.SS Quantization & Optimization
.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 onto the E2M1 grid directly without iterative learned rounding.
Round onto the E2M1 grid without learned rounding (default; accepted for compatibility).
.TP
.BI \-\-optimizer " " {auto,prodigy,adamw,radam,original}
Learned-rounding optimizer. \fBauto\fR uses Prodigy when installed, otherwise AdamW (default: \fBauto\fR).