[PR #1415] [CLOSED] cpu: add bit-exact AVX2 singleton expert rows #3438

Closed
opened 2026-11-07 14:41:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1415
Author: @InB4DevOps
Created: 10/7/2026
Status: ❌ Closed

Base: main ← Head: perf/cpu-expert-singleton-exact


📝 Commits (1)

  • 1ba010e cpu: add bit-exact AVX2 singleton expert rows

📊 Changes

7 files changed (+195 additions, -5 deletions)

View changed files

➕ bench/results/2026-10-07-cpu-singleton/README.md (+49 -0)
📝 include/strata/kernels/cpu/iq_avx2.hpp (+5 -0)
📝 src/kernels/cpu/iq_avx2.cpp (+28 -0)
📝 src/kernels/cpu/iq_avx2_parity.cpp (+25 -0)
📝 src/kernels/cpu/iq_avx2_rows.inl (+57 -5)
📝 src/kernels/cpu/native_expert.cpp (+12 -0)
📝 src/kernels/native_expert_parity.cpp (+19 -0)

📄 Description

Summary

  • Add an opt-in AVX2 singleton gate/up path for IQ2_XXS, IQ2_XS, IQ3_XXS and IQ3_S, keeping ggml's floating-point accumulation and reduction order. The default stays unchanged.
  • Check the new path bitwise against ggml in existing synthetic and real-expert parity tests.

Measurements

  • On an RTX 3060 12 GB / i7-12700KF / 62 GB PC, P-core, E-core and non-VNNI CPU parity had 0 differences across 5,120 outputs per format. Real GGUF checks had 0 differences on six tested layers (1,920 outputs per layer).
  • With engine 0.1.40.2 and the IQ3_XXS pack, four unprofiled A/B pairs of a 52-token chat prompt and 512 generated tokens measured 45.28 -> 46.42 tok/s (median paired change +2.45%). Tokens and meaningful state matched in every pair. See bench/results/2026-10-07-cpu-singleton/README.md for methods and microbenchmarks.
  • A separate refactoring-prompt run changed draft acceptance in one pair; no speed claim is made for it.

Validation

  • Built and ran iq_avx2_parity on P-core 2 and E-core 16, including a portable AVX2 build and a non-VNNI run.
  • Ran native_expert_parity on four real IQ3_S and two real IQ3_XXS layers, and an end-to-end A/B against the same binary.

This remains opt-in; performance on other CPUs and packs is not claimed.


🔄 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/1415 **Author:** [@InB4DevOps](https://github.com/InB4DevOps) **Created:** 10/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `perf/cpu-expert-singleton-exact` --- ### 📝 Commits (1) - [`1ba010e`](https://github.com/Niko1221/Strata/commit/1ba010ef36ed6473720115ad05b8af24e408f9d8) cpu: add bit-exact AVX2 singleton expert rows ### 📊 Changes **7 files changed** (+195 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `bench/results/2026-10-07-cpu-singleton/README.md` (+49 -0) 📝 `include/strata/kernels/cpu/iq_avx2.hpp` (+5 -0) 📝 `src/kernels/cpu/iq_avx2.cpp` (+28 -0) 📝 `src/kernels/cpu/iq_avx2_parity.cpp` (+25 -0) 📝 `src/kernels/cpu/iq_avx2_rows.inl` (+57 -5) 📝 `src/kernels/cpu/native_expert.cpp` (+12 -0) 📝 `src/kernels/native_expert_parity.cpp` (+19 -0) </details> ### 📄 Description ## Summary - Add an opt-in AVX2 singleton gate/up path for IQ2_XXS, IQ2_XS, IQ3_XXS and IQ3_S, keeping ggml's floating-point accumulation and reduction order. The default stays unchanged. - Check the new path bitwise against ggml in existing synthetic and real-expert parity tests. ## Measurements - On an RTX 3060 12 GB / i7-12700KF / 62 GB PC, P-core, E-core and non-VNNI CPU parity had 0 differences across 5,120 outputs per format. Real GGUF checks had 0 differences on six tested layers (1,920 outputs per layer). - With engine 0.1.40.2 and the IQ3_XXS pack, four unprofiled A/B pairs of a 52-token chat prompt and 512 generated tokens measured 45.28 -> 46.42 tok/s (median paired change +2.45%). Tokens and meaningful state matched in every pair. See bench/results/2026-10-07-cpu-singleton/README.md for methods and microbenchmarks. - A separate refactoring-prompt run changed draft acceptance in one pair; no speed claim is made for it. ## Validation - Built and ran iq_avx2_parity on P-core 2 and E-core 16, including a portable AVX2 build and a non-VNNI run. - Ran native_expert_parity on four real IQ3_S and two real IQ3_XXS layers, and an end-to-end A/B against the same binary. This remains opt-in; performance on other CPUs and packs is not claimed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:41:29 +07:00
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#3438
No description provided.