[PR #4970] [Engine] dsv41: build ds4_gguf_cpu.cpp's AVX-VNNI tier only where CMake's check passes (GCC 11 + binutils 2.35 on RHEL/Alma/Rocky 9 stopped at vpdpbusd) #5273

Open
opened 2026-11-07 16:33:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4970
Author: @yazun
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/dsv41-avxvnni-probe


📝 Commits (1)

  • a00cb1a [Engine] dsv41: build ds4_gguf_cpu.cpp's AVX-VNNI tier only where CMake's check passes (GCC 11 + binutils 2.35 on RHEL/Alma/Rocky 9 stopped at vpdpbusd)

📊 Changes

2 files changed (+10 additions, -3 deletions)

View changed files

📝 CMakeLists.txt (+5 -2)
📝 src/dsv41/ds4_gguf_cpu.cpp (+5 -1)

📄 Description

Problem and result

strata-dsv41 does not build with the stock compiler of RHEL / Alma / Rocky 9 (GCC 11.4.1, binutils 2.35.2):

FAILED: CMakeFiles/strata-dsv41.dir/src/dsv41/ds4_gguf_cpu.cpp.o
/tmp/ccGXY7B8.s:3702: Error: unsupported instruction `vpdpbusd'

src/dsv41/ds4_gguf_cpu.cpp turns its AVX-VNNI tier on from the compiler version alone (GCC 11 or newer). GCC 11
accepts the AVX-VNNI intrinsics, but binutils older than 2.36 cannot assemble the VEX vpdpbusd.

After this change the file builds on that compiler without the AVX-VNNI tier. The AVX2, AVX-512 and AVX-512 VNNI
tiers stay. Where the compiler can build the tier, nothing changes.

None needed. This is a focused build fix. I searched for "AVX-VNNI", "vpdpbusd", "binutils", "Rocky 9",
"AlmaLinux" and "ds4_gguf_cpu" and found no issue or PR about this failure.

#4951 (an AVX-VNNI path for NVFP4 rows) edits the lines next to this one in CMakeLists.txt, at the same
STRATA_AVXVNNI property. Whichever PR lands second may need a one-line merge.

Approach

CMake already checks whether the compiler can build AVX-VNNI: STRATA_HAVE_AVXVNNI_INTRINSICS. That check failed in
this configure. CMake passes the answer to q2_avx2.cpp and iq_avx2.cpp as STRATA_AVXVNNI, but not to
ds4_gguf_cpu.cpp.

  • CMakeLists.txt adds src/dsv41/ds4_gguf_cpu.cpp to the same set_property(... COMPILE_DEFINITIONS ${_strata_avxvnni}).
  • ds4_gguf_cpu.cpp turns on MX_AVXVNNI only when the compiler is new enough and
    !defined(STRATA_AVXVNNI) || STRATA_AVXVNNI.
  • A build that does not set the define (metal/CMakeLists.txt) uses the compiler version, as before.

Compatibility: where the check passes, ds4_gguf_cpu.cpp.o and the linked strata-dsv41 are byte-identical to the
build before the change (below).

Validation

Environment:

Machine AlmaLinux 9.3, AMD EPYC 9354 (Zen 4: AVX-512 VNNI, no AVX-VNNI), NVIDIA A100 80GB PCIe, driver 595.58.03, CUDA 13.2
Code a00cb1a1 (this branch) on c62d5e3a (main)
Configure -G Ninja -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_DSV41=ON -DSTRATA_NATIVE_EXPERTS=ON -DCMAKE_CUDA_ARCHITECTURES=native -DSTRATA_GGML_DIR=third_party/llama.cpp, target strata-dsv41

Passed:

  • GCC 11.4.1 + binutils 2.35.2, before the change: the build fails at ds4_gguf_cpu.cpp.o with the error above
    (reproduced).
  • GCC 11.4.1 + binutils 2.35.2, after the change:
    • Configure reports STRATA_HAVE_AVXVNNI_INTRINSICS - Failed, and the file gets -DSTRATA_AVXVNNI=0.
    • All 179 build steps pass.
    • nm shows no mx_avxvnni:: symbols and 8 mx_avx512vnni:: symbols.
    • strata-dsv41 --version runs, and cuobjdump lists sm_80.
  • gcc-toolset-12 (GCC 12.2.1 + binutils 2.38), where the check passes:
    • Built before and after the change. The file gets -DSTRATA_AVXVNNI=1.
    • ds4_gguf_cpu.cpp.o and the linked strata-dsv41 are byte-identical to the build before the change (cmp).
  • tests/dsv41/ds4_mx_bench.cpp, built by hand with GCC 11.4.1 against the changed file:
    • Build: g++ -O3 -std=c++20 -DSTRATA_AVXVNNI=0 -Iinclude tests/dsv41/ds4_mx_bench.cpp src/dsv41/ds4_gguf_cpu.cpp src/dsv41/vendor/exl3_cpu.cpp -lpthread
    • Run: --threads 1,8 --T 1,4,8 --experts 8 --secs 0.2
    • The CPU tiers are scalar avx2 avx512 avx512vnni, and the measured pick is avx512vnni.
    • The avx2, avx512 and avx512vnni tiers are bit-identical to scalar for gate and down rows.

Failed:

None observed.

Not run:

  • HIP: this machine has no ROCm. HIP builds compile this file with the host compiler too, so the change applies
    there.
  • Windows (MSVC, clang-cl): not built. Under MSVC the CMake check already runs with /arch:AVX2, and it already
    decides q2_avx2.cpp and iq_avx2.cpp there.
  • A CPU with AVX-VNNI (Alder Lake and later, Zen 5): not run. Where the check passes the object is byte-identical, so
    the tier is unchanged.
  • No model was loaded and no engine test ran on the GPU. The change is on the CPU side and only at compile time.

Limits

  • If the CMake check fails for any other reason, this file is now built without the AVX-VNNI tier. q2_avx2.cpp and
    iq_avx2.cpp already behave that way.
  • Users on RHEL-family 9 can already build with gcc-toolset-12 or newer, which brings newer binutils. This change
    makes the stock compiler work too.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/4970 **Author:** [@yazun](https://github.com/yazun) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/dsv41-avxvnni-probe` --- ### 📝 Commits (1) - [`a00cb1a`](https://github.com/Niko1221/Strata/commit/a00cb1a11e96f9b6f46811556bc1623f2ea18ea6) [Engine] dsv41: build ds4_gguf_cpu.cpp's AVX-VNNI tier only where CMake's check passes (GCC 11 + binutils 2.35 on RHEL/Alma/Rocky 9 stopped at vpdpbusd) ### 📊 Changes **2 files changed** (+10 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+5 -2) 📝 `src/dsv41/ds4_gguf_cpu.cpp` (+5 -1) </details> ### 📄 Description ## Problem and result `strata-dsv41` does not build with the stock compiler of RHEL / Alma / Rocky 9 (GCC 11.4.1, binutils 2.35.2): ```text FAILED: CMakeFiles/strata-dsv41.dir/src/dsv41/ds4_gguf_cpu.cpp.o /tmp/ccGXY7B8.s:3702: Error: unsupported instruction `vpdpbusd' ``` `src/dsv41/ds4_gguf_cpu.cpp` turns its AVX-VNNI tier on from the compiler version alone (GCC 11 or newer). GCC 11 accepts the AVX-VNNI intrinsics, but binutils older than 2.36 cannot assemble the VEX `vpdpbusd`. After this change the file builds on that compiler without the AVX-VNNI tier. The AVX2, AVX-512 and AVX-512 VNNI tiers stay. Where the compiler can build the tier, nothing changes. ## Related discussion None needed. This is a focused build fix. I searched for "AVX-VNNI", "vpdpbusd", "binutils", "Rocky 9", "AlmaLinux" and "ds4_gguf_cpu" and found no issue or PR about this failure. #4951 (an AVX-VNNI path for NVFP4 rows) edits the lines next to this one in `CMakeLists.txt`, at the same `STRATA_AVXVNNI` property. Whichever PR lands second may need a one-line merge. ## Approach CMake already checks whether the compiler can build AVX-VNNI: `STRATA_HAVE_AVXVNNI_INTRINSICS`. That check failed in this configure. CMake passes the answer to `q2_avx2.cpp` and `iq_avx2.cpp` as `STRATA_AVXVNNI`, but not to `ds4_gguf_cpu.cpp`. - `CMakeLists.txt` adds `src/dsv41/ds4_gguf_cpu.cpp` to the same `set_property(... COMPILE_DEFINITIONS ${_strata_avxvnni})`. - `ds4_gguf_cpu.cpp` turns on `MX_AVXVNNI` only when the compiler is new enough **and** `!defined(STRATA_AVXVNNI) || STRATA_AVXVNNI`. - A build that does not set the define (`metal/CMakeLists.txt`) uses the compiler version, as before. Compatibility: where the check passes, `ds4_gguf_cpu.cpp.o` and the linked `strata-dsv41` are byte-identical to the build before the change (below). ## Validation Environment: | | | |---|---| | Machine | AlmaLinux 9.3, AMD EPYC 9354 (Zen 4: AVX-512 VNNI, no AVX-VNNI), NVIDIA A100 80GB PCIe, driver 595.58.03, CUDA 13.2 | | Code | `a00cb1a1` (this branch) on `c62d5e3a` (main) | | Configure | `-G Ninja -DCMAKE_BUILD_TYPE=Release -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_DSV41=ON -DSTRATA_NATIVE_EXPERTS=ON -DCMAKE_CUDA_ARCHITECTURES=native -DSTRATA_GGML_DIR=third_party/llama.cpp`, target `strata-dsv41` | **Passed:** - **GCC 11.4.1 + binutils 2.35.2, before the change:** the build fails at `ds4_gguf_cpu.cpp.o` with the error above (reproduced). - **GCC 11.4.1 + binutils 2.35.2, after the change:** - Configure reports `STRATA_HAVE_AVXVNNI_INTRINSICS - Failed`, and the file gets `-DSTRATA_AVXVNNI=0`. - All 179 build steps pass. - `nm` shows no `mx_avxvnni::` symbols and 8 `mx_avx512vnni::` symbols. - `strata-dsv41 --version` runs, and `cuobjdump` lists `sm_80`. - **gcc-toolset-12 (GCC 12.2.1 + binutils 2.38), where the check passes:** - Built before and after the change. The file gets `-DSTRATA_AVXVNNI=1`. - `ds4_gguf_cpu.cpp.o` and the linked `strata-dsv41` are byte-identical to the build before the change (`cmp`). - **`tests/dsv41/ds4_mx_bench.cpp`, built by hand with GCC 11.4.1 against the changed file:** - Build: `g++ -O3 -std=c++20 -DSTRATA_AVXVNNI=0 -Iinclude tests/dsv41/ds4_mx_bench.cpp src/dsv41/ds4_gguf_cpu.cpp src/dsv41/vendor/exl3_cpu.cpp -lpthread` - Run: `--threads 1,8 --T 1,4,8 --experts 8 --secs 0.2` - The CPU tiers are `scalar avx2 avx512 avx512vnni`, and the measured pick is `avx512vnni`. - The avx2, avx512 and avx512vnni tiers are bit-identical to scalar for gate and down rows. **Failed:** None observed. **Not run:** - HIP: this machine has no ROCm. HIP builds compile this file with the host compiler too, so the change applies there. - Windows (MSVC, clang-cl): not built. Under MSVC the CMake check already runs with `/arch:AVX2`, and it already decides `q2_avx2.cpp` and `iq_avx2.cpp` there. - A CPU with AVX-VNNI (Alder Lake and later, Zen 5): not run. Where the check passes the object is byte-identical, so the tier is unchanged. - No model was loaded and no engine test ran on the GPU. The change is on the CPU side and only at compile time. ## Limits - If the CMake check fails for any other reason, this file is now built without the AVX-VNNI tier. `q2_avx2.cpp` and `iq_avx2.cpp` already behave that way. - Users on RHEL-family 9 can already build with `gcc-toolset-12` or newer, which brings newer binutils. This change makes the stock compiler work too. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5273
No description provided.