mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4728] [Engine] AVX-only CPUs: a native pack's Q2_0 experts still run on ggml-cpu's vec_dot, not on q2_avx1.cpp #2166
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2166
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Keoian on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4728
Area
[Engine] (speed, kernels, models, the server and API)
What do you want to do?
Let a native pack's Q2_0 experts run on Strata's AVX1 Q2_0 rows (
q2_avx1.cpp) on CPUs with AVX but no AVX2, instead of ggml-cpu's Q2_0vec_dot. This only concerns the experimental older-CPU source build (STRATA_ISA_FLOOR=avx); release engines need AVX2 and are not affected.Why I am raising it again. #1824 proposed this and was closed as covered: "The base already has a Q2_0 AVX kernel for CPUs without AVX2 (q2_avx1.cpp, from the #1699 fix)". The kernel is there, but a native pack never reaches it on these CPUs. The gate in
include/strata/kernels/cpu/expert_layout.hppstill admits AVX2 only:So on an AVX-only CPU every native pack's Q2_0 layer takes ggml-cpu's own
vec_dot. That includes ISTA-DASLab's Qwen3.8-Flash-Next Q2_0 and the Q2_0 down projections of the IQ3_XXS pack that #1824 mentions.kq_cpu_benchon main says so itself: its Q2_0 line has no "on Strata's rows (the pool's path)" suffix there.Measured. i7-3770 (Ivy Bridge, AVX, no AVX2), DDR3-1600, GCC 15, built from
870aedd9withSTRATA_ISA_FLOOR=avx.kq_cpu_bench --pairs q2_0/q2_0 --mb 1024 --reps 3, ms per expert per thread at 1 / 3 / 4 tokens:STRATA_Q2_BITPLANE=1vec_dot)cpu_avx1_ok()End to end, on the same CPU with 2x RX 5700 XT 8 GB (gfx1010, layer split 27), Qwen3.8-Flash-Next ISTA-DASLab Q2_0,
--spec 4 --mtp,STRATA_Q2_BITPLANE=1,STRATA_HC_Q8=0, 3 prompts x 2 reps x 2 engine starts in ABBA order, 256 tokens greedy: decode 14.97 tok/s on main against 22.38 with both commits (+49.6%, 11 of 12 pairs faster).Proposed change. Two commits, ready on https://github.com/Keoian/Strata/tree/avx1-q2-native-rows:
q2_native_kernels()also admitscpu_avx1_ok(). A CPU without AVX keeps ggml-cpu.q2_bitplane_paritypasses.On these CPUs the first commit changes bits against ggml-cpu's path, since the AVX1 rows sum floats in their own order. AVX2 CPUs already take Strata's rows. AVX2 / AVX-512 CPUs and the release engines are unchanged.
Would you take this as a pull request? If you want the gate only, the second commit can be left out.
What do you do today instead?
I build the engine from my fork with these two commits.