This repository was archived by the owner on Oct 8, 2026. It is now read-only.
Repository navigation
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. In common/imatrix-loader.* the PR's stats loading is merged with ggml-org#14891's n_layer_nextn. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 7, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #34 because it needs the GGUF imatrix statistics from upstream ggml-org#14891, which #34 brings in. Once #34 is merged and its branch deleted, GitHub retargets this PR to
master.Port of 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 overall bpw or file-size target at the lowest estimated error, using the activation statistics that ggml-org#14891 writes into GGUF imatrices.cb7934c52, as one commit. The PR's stray 1k-lineuv.lockis left out.common/imatrix-loader.*: the PR's.stats/stats_schemaloading is combined with imatrix: calculate activation-based statistics for new format (GGUF) imatrices ggml-org/llama.cpp#14891'sn_layer_nextn. Schema names and the.statstensor suffix match what the mergedllama-imatrixwrites.llama-quant.cpp/quantize.cpp. Take upstream's side there.Measured
Qwen3-1.7B from Q8_0 (
--allow-requantize). The imatrix comes fromdocs/(60×512 tokens). Perplexity is on held-outtools/+examples/READMEs (60×512 tokens), Vulkan:--target-bpw 5.0262--target-bpw 4.9--target-size 900mTargets are hit precisely. At Q4_K_M's exact size the chosen mix loses about 20% less perplexity versus Q8_0 than Q4_K_M does. That is inside the error bars on this small model and calibration set, so treat it as encouraging rather than proven. Reusing
--state-filebrings a re-target down from minutes to 11 s.