Repository navigation
quantize : choose quant types to hit a bpw or file size target (re-open of #156) - #170
Merged
pwilkin merged 1 commit intoOct 13, 2026
Conversation
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.
Re-opens #156, which was reverted in #168 together with the upstream sync it depends on.
Stacked on 169 (the re-opened sync). Merge that one first; this PR's diff is #156 only.
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