[GH-ISSUE #1699] pool_tasks_test and q2_bitplane_parity SIGILL on CPUs without AVX2 (act_quant_any/q2_rows_any have no AVX1 rung) #677

Closed
opened 2026-11-04 01:45:00 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @nashcap on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1699

Repro

Xeon E5-2470 v2 (Ivy Bridge: SSE4.2 + AVX, no AVX2), v0.1.41 (fb58e0d), built with STRATA_ISA_FLOOR=avx and STRATA_BUILD_TESTS=ON:

$ ./pool_tasks_test                       # no args
Illegal instruction (core dumped)
$ STRATA_Q2_BITPLANE=1 ./q2_bitplane_parity
Illegal instruction (core dumped)

Both are registered in CTest (pool_tasks_test CMakeLists:1231, q2_bitplane_parity :1477), so ctest fails on any machine without AVX2.

Where

Program received signal SIGILL, Illegal instruction.
#0 strata::kernels::cpu::act_quant_q8_1_avx2(float const*, int, ActQ&)
#1 main[cold]

Reached through the dispatchers in src/kernels/cpu/expert_layout.cpp (350-358): q2_rows_any and act_quant_any know only two rungs - AVX-512 and AVX2 - and the else branch has no AVX2 check, so an AVX-only CPU is handed AVX2 code:

void act_quant_any(const float* x, int n, ActQ& a) {
    if (cpu_avx512_ok()) act_quant_q8_1(x, n, a);
    else act_quant_q8_1_avx2(x, n, a);          // <- traps on an AVX1 CPU
}

q2_bitplane_parity also calls act_quant_q8_1_avx2 directly (q2_bitplane_parity.cpp:46,85).

Blast radius

The engine itself is safe: a canonical Q2_0 pack on such a CPU exits at cpu_require_expert_support() before any of this runs. So this is test-path only - but it hits exactly the users the ISA-floor work (#394) targets: older Xeons building from source with tests enabled. (Found while testing #1697; that PR does not touch these paths.)

Fix shape

Either gate the two tests like native_expert_parity does (skip with a message when !cpu_avx2_ok()), or give act_quant_any/q2_rows_any a third rung - #1697 adds the AVX1 activation quantizer for Q8_K (q8k_quant_avx1); the permuted Q8_1 ActQ form would need its own AVX1 copy.

Originally created by @nashcap on GitHub (Oct 9, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/1699 ## Repro Xeon E5-2470 v2 (Ivy Bridge: SSE4.2 + AVX, no AVX2), v0.1.41 (fb58e0d), built with `STRATA_ISA_FLOOR=avx` and `STRATA_BUILD_TESTS=ON`: ``` $ ./pool_tasks_test # no args Illegal instruction (core dumped) $ STRATA_Q2_BITPLANE=1 ./q2_bitplane_parity Illegal instruction (core dumped) ``` Both are registered in CTest (`pool_tasks_test` CMakeLists:1231, `q2_bitplane_parity` :1477), so `ctest` fails on any machine without AVX2. ## Where ``` Program received signal SIGILL, Illegal instruction. #0 strata::kernels::cpu::act_quant_q8_1_avx2(float const*, int, ActQ&) #1 main[cold] ``` Reached through the dispatchers in `src/kernels/cpu/expert_layout.cpp` (350-358): `q2_rows_any` and `act_quant_any` know only two rungs - AVX-512 and AVX2 - and the `else` branch has no AVX2 check, so an AVX-only CPU is handed AVX2 code: ```cpp void act_quant_any(const float* x, int n, ActQ& a) { if (cpu_avx512_ok()) act_quant_q8_1(x, n, a); else act_quant_q8_1_avx2(x, n, a); // <- traps on an AVX1 CPU } ``` `q2_bitplane_parity` also calls `act_quant_q8_1_avx2` directly (q2_bitplane_parity.cpp:46,85). ## Blast radius The engine itself is safe: a canonical Q2_0 pack on such a CPU exits at `cpu_require_expert_support()` before any of this runs. So this is test-path only - but it hits exactly the users the ISA-floor work (#394) targets: older Xeons building from source with tests enabled. (Found while testing #1697; that PR does not touch these paths.) ## Fix shape Either gate the two tests like `native_expert_parity` does (skip with a message when `!cpu_avx2_ok()`), or give `act_quant_any`/`q2_rows_any` a third rung - #1697 adds the AVX1 activation quantizer for Q8_K (`q8k_quant_avx1`); the permuted Q8_1 `ActQ` form would need its own AVX1 copy.
Author
Owner

@nashcap commented on GitHub (Oct 9, 2026):

Fix up as #1701: the third rung (q2_avx1.cpp) in the kq_avx1/iq_avx1 containment pattern. On an E5-2470 v2 both tests now pass (pool_tasks_test 168 bitwise comparisons, q2_bitplane_parity PASS).

<!-- gh-comment-id:6078990760 --> @nashcap commented on GitHub (Oct 9, 2026): Fix up as #1701: the third rung (q2_avx1.cpp) in the kq_avx1/iq_avx1 containment pattern. On an E5-2470 v2 both tests now pass (pool_tasks_test 168 bitwise comparisons, q2_bitplane_parity PASS).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#677
No description provided.