[PR #596] CPU lane: EXL3 rows on an AVX-512 VNNI tier (bit for bit), +5-31% on Ice Lake-SP #616

Open
opened 2026-10-29 21:27:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mw00/project-maya/pull/596
Author: @sbleschke
Created: 10/28/2026
Status: 🔄 Open

Base: main ← Head: avx512-vnni


📝 Commits (1)

  • ecdfcb5 CPU lane: EXL3 rows on an AVX-512 VNNI tier (bit for bit), +5-31% on Ice Lake-SP

📊 Changes

5 files changed (+396 additions, -334 deletions)

View changed files

📝 include/strata/kernels/cpu/exl3_cpu.hpp (+1 -1)
📝 src/kernels/cpu/exl3_cpu.cpp (+101 -324)
➕ src/kernels/cpu/exl3_cpu_avx512.inc (+283 -0)
📝 src/kernels/cpu/exl3_cpu_bench.cpp (+5 -5)
📝 tests/exl3_test.cu (+6 -4)

📄 Description

CPU lane: EXL3 rows on an AVX-512 VNNI tier (bit for bit), +5-31% on Ice Lake-SP

A new tier 3, cpu_avx512_vnni, covers Ice Lake and later Xeons and Zen 4 and later, but not Skylake-SP. It runs the existing AVX-512 EXL3 kernels and takes the byte sums with _mm512_dpbusd_epi32 instead of the BW multiply-add chain.

  • The AVX-512 kernels move into src/kernels/cpu/exl3_cpu_avx512.inc, which is compiled twice (namespaces avx512 and vnni). Each copy gets its target attribute and byte-sum macro, so both tiers share one source.
  • The lane takes the widest tier this CPU supports. STRATA_FORCE_AVX2=1 still forces AVX2. No new settings.
  • exl3_cpu_band_acc_on and exl3_cpu_bench --tiers know about tier 3.
  • tests/exl3_test.cu runs the exact checks on the VNNI tier as well.

Output

Bit for bit. The VNNI tier gives the same results as the AVX-512 tier (and the model):

cpu exact avx512vnni k512 n256 K3.5   0 of 23040 differ from the model  ok
cpu exact avx512vnni k592 n384 K3.5   0 of 34560 differ from the model  ok
cpu exact avx512vnni k592 n256 K2.5   0 of 23040 differ from the model  ok
exl3_test: ok (0 failures, 0 launch errors)

Measurements

Xeon Gold 6314U (Ice Lake-SP, 32C/64T), exl3_cpu_bench --K 3,4 --threads 1,8,64 --tokens 1 --tiers 2,3 --pin, same binary, tier 2 (AVX-512) against tier 3 (VNNI):

K3 tier 2 K3 tier 3 Δ K4 tier 2 K4 tier 3 Δ
hot, 1 thread (M weights/s) 9736 10808 +11% 8208 10846 +32%
cold, 1 thread (experts/s) 355 390 +10% 358 391 +9%
cold, 8 threads (experts/s) 2736 2981 +9% 2398 2621 +9%
cold, 64 threads (experts/s) 6508 7207 +11% 4825 4886 +1% (bandwidth bound)

Scope

  • CPU only: no CUDA or HIP code is touched, and no new CUDA calls are added, so the AMD mapping is unchanged.
  • CPUs without VNNI run the same code as before (tier 2 or lower).
  • Not tested on Zen 4/5 or Sapphire Rapids and later, because I don't have the hardware. Numbers from those would be welcome.

🤖 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/mw00/project-maya/pull/596 **Author:** [@sbleschke](https://github.com/sbleschke) **Created:** 10/28/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `avx512-vnni` --- ### 📝 Commits (1) - [`ecdfcb5`](https://github.com/mw00/project-maya/commit/ecdfcb5ed81872c934e33bd60360f0a86736e4ae) CPU lane: EXL3 rows on an AVX-512 VNNI tier (bit for bit), +5-31% on Ice Lake-SP ### 📊 Changes **5 files changed** (+396 additions, -334 deletions) <details> <summary>View changed files</summary> 📝 `include/strata/kernels/cpu/exl3_cpu.hpp` (+1 -1) 📝 `src/kernels/cpu/exl3_cpu.cpp` (+101 -324) ➕ `src/kernels/cpu/exl3_cpu_avx512.inc` (+283 -0) 📝 `src/kernels/cpu/exl3_cpu_bench.cpp` (+5 -5) 📝 `tests/exl3_test.cu` (+6 -4) </details> ### 📄 Description ## CPU lane: EXL3 rows on an AVX-512 VNNI tier (bit for bit), +5-31% on Ice Lake-SP A new tier 3, `cpu_avx512_vnni`, covers Ice Lake and later Xeons and Zen 4 and later, but not Skylake-SP. It runs the existing AVX-512 EXL3 kernels and takes the byte sums with `_mm512_dpbusd_epi32` instead of the BW multiply-add chain. - The AVX-512 kernels move into `src/kernels/cpu/exl3_cpu_avx512.inc`, which is compiled twice (namespaces `avx512` and `vnni`). Each copy gets its target attribute and byte-sum macro, so both tiers share one source. - The lane takes the widest tier this CPU supports. `STRATA_FORCE_AVX2=1` still forces AVX2. No new settings. - `exl3_cpu_band_acc_on` and `exl3_cpu_bench --tiers` know about tier 3. - `tests/exl3_test.cu` runs the exact checks on the VNNI tier as well. ### Output Bit for bit. The VNNI tier gives the same results as the AVX-512 tier (and the model): ``` cpu exact avx512vnni k512 n256 K3.5 0 of 23040 differ from the model ok cpu exact avx512vnni k592 n384 K3.5 0 of 34560 differ from the model ok cpu exact avx512vnni k592 n256 K2.5 0 of 23040 differ from the model ok exl3_test: ok (0 failures, 0 launch errors) ``` ### Measurements Xeon Gold 6314U (Ice Lake-SP, 32C/64T), `exl3_cpu_bench --K 3,4 --threads 1,8,64 --tokens 1 --tiers 2,3 --pin`, same binary, tier 2 (AVX-512) against tier 3 (VNNI): | | K3 tier 2 | K3 tier 3 | Δ | K4 tier 2 | K4 tier 3 | Δ | |---|---:|---:|---:|---:|---:|---:| | hot, 1 thread (M weights/s) | 9736 | 10808 | **+11%** | 8208 | 10846 | **+32%** | | cold, 1 thread (experts/s) | 355 | 390 | +10% | 358 | 391 | +9% | | cold, 8 threads (experts/s) | 2736 | 2981 | +9% | 2398 | 2621 | +9% | | cold, 64 threads (experts/s) | 6508 | 7207 | +11% | 4825 | 4886 | +1% (bandwidth bound) | ### Scope - CPU only: no CUDA or HIP code is touched, and no new CUDA calls are added, so the AMD mapping is unchanged. - CPUs without VNNI run the same code as before (tier 2 or lower). - Not tested on Zen 4/5 or Sapphire Rapids and later, because I don't have the hardware. Numbers from those would be welcome. 🤖 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 labels
pull-request
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
mw00/project-maya#616
No description provided.