mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
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#3619
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/1701
Author: @nashcap
Created: 10/9/2026
Status: ❌ Closed
Base:
main← Head:q2-avx1-rung📝 Commits (1)
4b2c04fcpu: q2_avx1 - the Q2_0 rows and the Q8_1 quantizer for CPUs with AVX but no AVX2 (fixes #1699)📊 Changes
6 files changed (+348 additions, -14 deletions)
View changed files
📝
CMakeLists.txt(+9 -1)📝
include/strata/kernels/cpu/expert.hpp(+8 -0)📝
include/strata/kernels/cpu/expert_layout.hpp(+3 -0)📝
src/kernels/cpu/expert_layout.cpp(+11 -2)➕
src/kernels/cpu/q2_avx1.cpp(+294 -0)📝
src/kernels/cpu/q2_bitplane_parity.cpp(+23 -11)📄 Description
Fixes #1699
q2_rows_anyandact_quant_any(expert_layout.cpp) had two rungs - AVX-512 and AVX2 - and theelsebranch checked nothing: an AVX-only CPU (Sandy Bridge through Ivy Bridge Xeons, the #623/#1375 class) was handed AVX2 code and died with SIGILL. On a clean v0.1.41 tree an E5-2470 v2 kills bothpool_tasks_testandq2_bitplane_parityat the first frame (act_quant_q8_1_avx2+123), and any future caller of the dispatchers inherits the trap.The fix
The third rung,
src/kernels/cpu/q2_avx1.cpp, in the containment pattern the repo already uses forkq_avx1.cpp/iq_avx1.cpp: its own translation unit compiled-msse4.2 -mavx -mno-avx2 -mno-fma -mno-f16c(a#errorguard keeps AVX2/FMA/F16C out of the object even on a-march=nativehost), called only behindcpu_avx1_ok() && !cpu_avx2_ok(). The AVX-2 and AVX-512 paths are untouched, so nothing changes on any CPU that has AVX2.maddubs/maddare SSSE3/SSE2), 256-bit float accumulation, software fp16 scale conversion (no F16C).q2_bitplane_paritynow tests the AVX-2 pair where the CPU has AVX2 and the AVX1 pair below it, and skips cleanly (pass) without AVX.Measured on the hardware from the issue
E5-2470 v2 (Ivy Bridge, AVX only), v0.1.41 + this commit:
pool_tasks_test: 168 bitwise comparisons passed (SIGILL before)q2_bitplane_parity: PASS (SIGILL before)iq_multi_parity,router_dot_parity,dequant_s2_parity,expert_layout_test,q8k_quant_parity: unchanged, passIndependent of #1697 (the i-quant AVX1 kernels); either can merge first.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.