[GH-ISSUE #3409] [Engine] isa_guard_check fails on Linux builds: tq_rows_avx512 (tq_avx512.cpp) is not in WIDE_PUBLIC / WIDE_OBJECTS #1380

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

Originally created by @Norhiro on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3409

Area

[Engine] (speed, kernels, models, the server and API)

Desktop app, Terminal or source?

Source (START-HERE.bat, setup.sh or a build)

What happened

Expected: isa_guard_check passes when every wide-ISA function is reached only behind a CPU check. Actual: it fails on one such function.
On a CUDA build of 0.2.0-beta with -DSTRATA_BUILD_TESTS=ON -DSTRATA_ISA_FLOOR=avx, ctest isa_guard_check fails:

check_isa_guard: .../libstrata_kernels_cpu.a: 481 functions, 70 hold wide-ISA instructions, 1 not allowed
  VIOLATION strata::kernels::cpu::tq_detail::tq_rows_avx512(int, unsigned char const*, unsigned long, int, strata::kernels::cpu::tq_detail::TqAct const* const*, int, float* (606 wide instructions, first vmovq): wide-ISA code in an unlisted public function

#3358 shows the same violation on a HIP build ("outside the wide-ISA translation units (object tq_avx512.cpp.o)"), mentioned there as a side note.

As far as I can see this is a gap in the list, not an unguarded call. tq_rows_avx512 is reached only through tq_rows(tq_isa(), ...) (tq_cpu.cpp:174). tq_isa() picks TqIsa::avx512 only when tq_isa_ok(TqIsa::avx512) → cpu_avx512_ok(), and tq_rows aborts on an ISA the CPU lacks (tq_cpu.cpp:185). This host has no AVX2. No illegal instruction was seen in the engine or in any other test. All the AVX1/AVX2 parity tests pass: router_dot_parity_avx, iq_avx1_parity, iq_avx2_parity, q8k_quant_parity_avx.

Suggested change (tested here) in tools/check_isa_guard.py:

  • add "tq_rows_avx512" to WIDE_PUBLIC
  • add "tq_avx512.cpp" to WIDE_OBJECTS (so it is also in INIT_FREE_OBJECTS)
  • add "tq_avx2.cpp" to the extra INIT_FREE_OBJECTS. It is compiled above the AVX baseline like nvfp4_avx2.cpp, so a static initialiser there would run on every CPU (#2324).

With these three changes the check reports 0 not allowed on the same library. tq_avx2.cpp currently has no static initialiser, so adding it changes nothing today; it guards against a future one.

Related, also seen here (already listed in #3358): tq_cpu_parity, tq_cpu_parity_avx2 and native_hadamard_test print this ggml has no trellis types (build with STRATA_GGML_DIR = the agention ... fork) and exit as failed. With the default upstream llama.cpp they would read better as skipped (SKIP_RETURN_CODE 77).

Smallest steps or command that reproduce it

cmake -S . -B build-tests -DSTRATA_ENABLE_CUDA=ON -DSTRATA_ISA_FLOOR=avx -DSTRATA_BUILD_TESTS=ON -DCMAKE_CUDA_ARCHITECTURES=86
cmake --build build-tests && cd build-tests && ctest -R isa_guard_check --output-on-failure

Reproduction status

Reproduced locally

Strata version

Strata 0.2.0-beta · engine 0.1.45.3 (source, commit 3d1fb480). main on 2026-10-20 has no tq_rows_avx512 / tq_avx512.cpp in tools/check_isa_guard.py.

Graphics card, memory and system

RTX 3060 12 GB (driver 610.57.04, CUDA 13.3 from the pip wheels, g++ 14.4.1), 2 × Xeon E5-2630 v2 (AVX, no AVX2/FMA), 252 GB DDR3, Fedora 44, binutils objdump.

Originally created by @Norhiro on GitHub (Oct 20, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3409 ### Area [Engine] (speed, kernels, models, the server and API) ### Desktop app, Terminal or source? Source (START-HERE.bat, setup.sh or a build) ### What happened Expected: `isa_guard_check` passes when every wide-ISA function is reached only behind a CPU check. Actual: it fails on one such function. On a CUDA build of 0.2.0-beta with `-DSTRATA_BUILD_TESTS=ON -DSTRATA_ISA_FLOOR=avx`, ctest `isa_guard_check` fails: ``` check_isa_guard: .../libstrata_kernels_cpu.a: 481 functions, 70 hold wide-ISA instructions, 1 not allowed VIOLATION strata::kernels::cpu::tq_detail::tq_rows_avx512(int, unsigned char const*, unsigned long, int, strata::kernels::cpu::tq_detail::TqAct const* const*, int, float* (606 wide instructions, first vmovq): wide-ISA code in an unlisted public function ``` #3358 shows the same violation on a HIP build ("outside the wide-ISA translation units (object tq_avx512.cpp.o)"), mentioned there as a side note. As far as I can see this is a gap in the list, not an unguarded call. `tq_rows_avx512` is reached only through `tq_rows(tq_isa(), ...)` (tq_cpu.cpp:174). `tq_isa()` picks `TqIsa::avx512` only when `tq_isa_ok(TqIsa::avx512)` → `cpu_avx512_ok()`, and `tq_rows` aborts on an ISA the CPU lacks (tq_cpu.cpp:185). This host has no AVX2. No illegal instruction was seen in the engine or in any other test. All the AVX1/AVX2 parity tests pass: `router_dot_parity_avx`, `iq_avx1_parity`, `iq_avx2_parity`, `q8k_quant_parity_avx`. **Suggested change (tested here)** in `tools/check_isa_guard.py`: - add `"tq_rows_avx512"` to `WIDE_PUBLIC` - add `"tq_avx512.cpp"` to `WIDE_OBJECTS` (so it is also in `INIT_FREE_OBJECTS`) - add `"tq_avx2.cpp"` to the extra `INIT_FREE_OBJECTS`. It is compiled above the AVX baseline like `nvfp4_avx2.cpp`, so a static initialiser there would run on every CPU (#2324). With these three changes the check reports `0 not allowed` on the same library. `tq_avx2.cpp` currently has no static initialiser, so adding it changes nothing today; it guards against a future one. **Related, also seen here (already listed in #3358):** `tq_cpu_parity`, `tq_cpu_parity_avx2` and `native_hadamard_test` print `this ggml has no trellis types (build with STRATA_GGML_DIR = the agention ... fork)` and exit as **failed**. With the default upstream llama.cpp they would read better as **skipped** (`SKIP_RETURN_CODE 77`). ### Smallest steps or command that reproduce it ``` cmake -S . -B build-tests -DSTRATA_ENABLE_CUDA=ON -DSTRATA_ISA_FLOOR=avx -DSTRATA_BUILD_TESTS=ON -DCMAKE_CUDA_ARCHITECTURES=86 cmake --build build-tests && cd build-tests && ctest -R isa_guard_check --output-on-failure ``` ### Reproduction status Reproduced locally ### Strata version Strata 0.2.0-beta · engine 0.1.45.3 (source, commit `3d1fb480`). `main` on 2026-10-20 has no `tq_rows_avx512` / `tq_avx512.cpp` in `tools/check_isa_guard.py`. ### Graphics card, memory and system RTX 3060 12 GB (driver 610.57.04, CUDA 13.3 from the pip wheels, g++ 14.4.1), 2 × Xeon E5-2630 v2 (AVX, no AVX2/FMA), 252 GB DDR3, Fedora 44, binutils objdump.
Author
Owner

@Niko1221 commented on GitHub (Oct 29, 2026):

Thank you. Fixed in 0.2.2: the ISA guard knows tq_rows_avx512 and tq_avx512.cpp, so isa_guard_check passes on a normal build.

Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.2

<!-- gh-comment-id:6491909610 --> @Niko1221 commented on GitHub (Oct 29, 2026): Thank you. Fixed in 0.2.2: the ISA guard knows `tq_rows_avx512` and `tq_avx512.cpp`, so `isa_guard_check` passes on a normal build. Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.2
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#1380
No description provided.