Repository navigation
[Benchmark] kq_cpu_bench: i-quant pairs no longer crash (IQ3_S), Q2_0 timed on the CPU pool's path - #3871
Open
Licenser wants to merge 1 commit into
Open
[Benchmark] kq_cpu_bench: i-quant pairs no longer crash (IQ3_S), Q2_0 timed on the CPU pool's path#3871Licenser wants to merge 1 commit into
Licenser wants to merge 1 commit into
Conversation
…hed), and Q2_0 rows on the pool's own path - make_blob quantized its random rows with ggml-cpu's type traits' from_float, which the i-quants do not have: an IQ3_S pair called a null pointer (an access violation on Windows). It now uses ggml_quantize_chunk, with a flat importance matrix where the type needs one. - A Q2_0 gate/up or down is now timed the way the CPU pool runs it (pool.cpp, drain modes 5 and 6): the activations as an ActQ (act_quant_any) and Strata's Q2_0 rows (q2_rows_any), SwiGLU in between - not ggml-cpu's Q2_0 dot, which the engine does not use for these. The pair's header line says when that path is taken. Run: --pairs iq3_s/iq4_nl,iq2_xs/q2_0 on a Threadripper 3960X (one thread: 0.661 and 0.391 ms per expert, the second on the pool's Q2_0 path). Built: CUDA (sm_75), Linux, GCC 15.2. Not built: Windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Licenser
force-pushed
the
kq-cpu-bench-formats
branch
from
October 25, 2026 11:58
2fb22d1 to
b5dadce
Compare
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.
Problem and result
kq_cpu_benchhad two problems with expert formats the engine uses:make_blobquantized its random test rows with ggml-cpu's type traits'from_float,which the i-quants do not have, so an IQ3_S pair called a null pointer: an access violation on Windows, SIGSEGV
(exit 139) on Linux, before the first timing.
The CPU pool runs Q2_0 experts on Strata's own rows instead (
pool.cpp, drain modes 5 and 6), so the benchreported a Q2_0 cost about 2.7x higher than the pool's.
After this change all pairs run, and a Q2_0 matrix is timed the way the pool runs it. Threadripper 3960X, one
thread,
--threads 1 --nt 1 --reps 3:iq3_s/q2_0q2_0/q2_0Related discussion
None. The change only touches the bench tool (
src/kernels/cpu/kq_cpu_bench.cpp); the engine is unchanged.Approach
make_blobquantizes withggml_quantize_chunk, with a flat importance matrix where the type requires one(
ggml_quantize_requires_imatrix). The blobs keep valid scales and the real sizes, as before.ActQ(act_quant_any), Strata's Q2_0rows (
q2_rows_any), SwiGLU in between. The pair's header line says when that path is taken("Q2_0 down on Strata's rows (the pool's path)"). Other formats keep ggml-cpu's dot, as before.
Validation
Passed:
-DCMAKE_BUILD_TYPE=Release), Linux, GCC 15.2, Threadripper3960X:
kq_cpu_bench --pairs iq3_s/q2_0,iq2_xs/q2_0,q2_0/q2_0 --threads 1 --nt 1 --reps 3runs all three pairs,exit 0 (0.573, 0.349 and 0.294 ms per expert per thread).
--pairs q2_0/q2_0alone: 0.272 ms.--pairs iq3_s/q2_0ends with SIGSEGV (exit 139);--pairs q2_0/q2_0: 0.742 ms per expert per thread.--pairs iq3_s/iq4_nl,iq2_xs/q2_0ran, 0.661 and0.391 ms per expert per thread.
Failed:
Not run:
Limits
pool.cpp's current drain modes 5 and 6; if the pool's Q2_0 path changes, the bench has tofollow it.
Used Claude.