mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #207] [CLOSED] E-2 on the AVX-2 path too: prefetch the i-quant expert rows (same switch, CPUs without AVX-512) #2506
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#2506
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/207
Author: @pipeob0
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:gh/avx2-prefetch📝 Commits (1)
5a3c98eE-2 on the AVX-2 path too: prefetch the i-quant expert rows (same switch, CPUs without AVX-512)📊 Changes
1 file changed (+21 additions, -0 deletions)
View changed files
📝
src/kernels/cpu/iq_avx2.cpp(+21 -0)📄 Description
What
df6980dput the software prefetch intoiq_avx512.cpp, so it only reaches CPUs that have AVX-512. The AVX-2 file - which is what a Zen 3, a Haswell or a Skylake-client box actually runs the i-quant expert rows on, see #103 - had none of it. This adds it there, with the same switch, the same default and the same hint:STRATA_IQ_PREFETCHis the distance in bytes,0= off, default2048. No new knob.Three sites, the three loops that stream rows in that file:
row_dot(the i-quant gate/up rows,Fmt32<TY>::bytesper block)row_dot_iq2xs(the IQ2_XS gate/up rows)iq4nl_rows(the IQ4_NL down rows)21 lines added, nothing removed, no change to what is computed.
Measured
Ryzen 7 5700X3D (AVX-2 only, 8 cores), 64 GB DDR4-2666, RTX 5060 Ti, Windows. IQ3_S, 131072 context,
--pcie-frac 0.30,--spec 4, 300 tokens, the same args for every run.ms/roundis the metric, sincetok/smoves with draft acceptance. Runs interleaved, so the thermal drift hits every variant the same way; the comparison below is within the same round, against the same patched binary withSTRATA_IQ_PREFETCH=0.The unpatched binary and the patched one with the prefetch off land within 0.1% of each other in both rounds, so the patch itself costs nothing.
native_expert_parityon the IQ3_S shard: 0 failures with the prefetch on and with it off.The effect is bigger with a cold pool (-2.4% on the round) than warm (-1.3%), which is what you would expect from a prefetch.
Things I checked and did not send
_MM_HINT_T0like the AVX-512 file.iq_avx512.cpp.Caveat
This is 2 rounds of 6 variants, not the sweep you usually ask for: the sign is the same in both rounds and on all three metrics, and the control is clean, but n is 2. Happy to run more rounds on this machine if you want the number firmed up before merging - it is ~25 min per 12 runs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.