Repository navigation
quantize : choose quant types to hit a bpw or file size target (upstream #15550) - #156
Merged
Merged
Conversation
…eam ggml-org#15550) Port of ggml-org#15550 (EAddario, still open upstream) at 839a435, which adds --target-bpw, --target-size, --state-file and --target-exclude: llama-quantize picks per-tensor quant types that reach the target at the lowest estimated error, using the activation statistics that ggml-org#14891 writes into GGUF imatrices. Applied as its diff against its upstream base cb7934c, minus the PR's stray uv.lock (first ported to halo-box/llama.cpp as #35, now closed there). In common/imatrix-loader.* the PR's stats loading is merged with ggml-org#14891's n_layer_nextn. In llama-quant.cpp strix's ROCmFPx rules are kept in every tensor category, renamed to the PR's TENSOR_CATEGORY_* enum, and the ROCmFP4 / ROCmFPx fallbacks move into the PR's fallback_type_for(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pwilkin
added this pull request to stack #158
October 8, 2026 19:37
dzannotti
marked this pull request as ready for review
October 9, 2026 20:11
pwilkin
added a commit
that referenced
this pull request
Oct 13, 2026
quantize : choose quant types to hit a bpw or file size target (re-open of #156)
3 of 5 tasks
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.
Stacked on #155, because it needs the GGUF imatrix statistics from upstream ggml-org#14891, which #155 brings in. When #155 is merged and its branch is deleted, GitHub retargets this PR to
master. This replaces halo-box#35, which can't be closed there because that repository is archived.This ports ggml-org#15550 (EAddario, still open upstream) at
839a43500. It adds--target-bpw,--target-size,--state-fileand--target-excludetollama-quantize: for each tensor, it picks the quant type that reaches the target at the lowest estimated error, using the activation statistics in GGUF imatrices.cb7934c52, without the PR's stray 1k-lineuv.lock.common/imatrix-loader.*: the PR's.stats/stats_schemaloading is merged with imatrix: calculate activation-based statistics for new format (GGUF) imatrices ggml-org/llama.cpp#14891'sn_layer_nextn. The schema names and the.statssuffix match whatllama-imatrixwrites.src/llama-quant.cpp: strix's ROCmFPx rules are kept in every tensor category, renamed to the PR'sTENSOR_CATEGORY_*enum. The ROCmFP4 / ROCmFPx fallbacks move into the PR'sfallback_type_for().llama-quant.cppandquantize.cpp. Take upstream's side there and re-apply the ROCmFPx rules.Measured
Qwen3-1.7B, requantized from Q8_0 on Vulkan. The imatrix comes from
docs/(60×512 tokens). Perplexity is measured on held-outtools/+examples/READMEs (60×512 tokens).--target-bpw 5.0262The target is hit exactly. At Q4_K_M's size the quality is the same within the error bars: one earlier run on the halo port came out slightly ahead, this one is level. Reusing
--state-filecuts re-targeting to seconds.🤖 Generated with Claude Code