[PR #1374] [CLOSED] experts: IQ1_S on GPU/AVX-2, IQ1_S+IQ1_M on AVX-512, and a measured PCIe share #3413

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

📋 Pull Request Information

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

Base: main ← Head: pr-iq1s-v2


📝 Commits (8)

  • e87b2ea kernels: run IQ1_S (GGML type 19) on the GPU and on AVX-2
  • 91ed24e kernels: run IQ1_S and IQ1_M on 512-bit lanes
  • 392bfc5 experts: measure the PCIe share instead of trusting the link alone
  • f368edf prefill: run IQ1_S experts through the MMQ prompt path
  • 96ad434 Merge origin/main into the IQ1_S/AMD branch
  • cbd3695 Merge main (0.1.42) into the IQ1_S/AMD branch
  • f0b09e1 Merge main (0.1.44) into the IQ1_S/AMD branch
  • 5f5237d Merge remote-tracking branch 'origin/main' into pr-iq1s-v2

📊 Changes

21 files changed (+450 additions, -27 deletions)

View changed files

📝 CMakeLists.txt (+1 -1)
📝 README.md (+1 -1)
📝 docs/AMD_HIP.md (+5 -0)
📝 docs/DETAILS.md (+17 -0)
📝 include/strata/artifact/gguf_reader.hpp (+4 -0)
📝 include/strata/kernels/cpu/native_expert.hpp (+2 -2)
📝 include/strata/kernels/iq_kernels.hpp (+1 -1)
📝 src/kernels/cpu/iq_avx2.cpp (+1 -1)
📝 src/kernels/cpu/iq_avx2_rows.inl (+112 -0)
📝 src/kernels/cpu/iq_avx512.cpp (+146 -5)
📝 src/kernels/cpu/native_expert.cpp (+2 -2)
📝 src/kernels/cuda/dequant_bf16.cu (+1 -1)
📝 src/kernels/cuda/iq_kernels.cu (+81 -4)
📝 src/kernels/cuda/native_mmvq.cu (+3 -3)
📝 src/kernels/iq_multi_parity.cpp (+4 -3)
📝 src/kernels/iq_parity.cpp (+1 -1)
📝 src/kernels/native_grouped_parity.cpp (+2 -1)
📝 src/prefill/moe_mmq.cu (+2 -0)
📝 tests/hip/prefill_mmq_parity.cpp (+30 -0)
➕ tools/hip/gfx1100-hipblaslt-100300.txt (+32 -0)

...and 1 more files

📄 Description

Round 2: IQ1_S made first-class across the pipeline, plus a PM-driven PCIe share.

What

  • IQ1_S (type 19) on the GPU and on AVX-2. Unsloth UD-IQ1_S packs did not run at all before: dq_iq1_s, vec_dot_iq1_s_q8_1, Fmt<19>, Split<19>, the grouped kernels, the reader geometry, and the AVX-2 row_dot_iq1s/row_dot_iq1m.
  • IQ1_S + IQ1_M on 512-bit lanes. iq512_supported listed neither, and native_expert.cpp only takes the AVX-2 kernel off an AVX-512 CPU, so AVX-512 CPUs ran both through ggml-cpu single-token — slower than an AVX-2 CPU. No EVEX vpsignb, so the grid sign is vpabsb + a masked subtract.
  • IQ1_S on the MMQ prompt path. IQ1_S was absent from _strata_mmq_types, mmq::supported() and the dispatch switch, so UD-IQ1_S prefill fell back to per-expert dequant→FP16. Added; the mmq-instance-iq1_s.cu already exists in the pinned ggml.
  • The PCIe share measures itself (serve). --pcie-frac was the link probe alone (capped 0.55); the best share also depends on the CPU/GPU and runs both ways. A --serve sweeps the probed share, 0 and 1.0 over its first verify windows, keeps the lowest (CPU pool + GPU wait) per routed expert entry, and holds it. --pcie-frac <value> pins; --pcie-frac auto for the CLI.

Measured

Radeon PRO W7800 (gfx1100, ROCm 7.13), Ryzen 7 3800X, 30 GiB RAM; UD-IQ1_S (67.5 GiB); 600-token prompt, MTP.

before after
UD-IQ1_S loads/answers no yes
decode (this box) 26.5 tok/s (probed share) 40.2 → 75.3 tok/s (measured, held)
prefill 169.7 tok/s 326.8 tok/s (+93%: +16% the other formats, +66% from IQ1_S MMQ alone)
AVX-512 CPU, IQ1_S/IQ1_M gate/up ggml-cpu single-token multi-token AVX-512

The share runs both ways, which is why it is measured: here the GPU taking every miss is fastest, while in the RDNA2 x8 bench --pcie-frac 0 beat the probed 0.39.

Validation

  • HIP gfx1100 + full strata; iq_parity (IQ1_S/IQ1_M dequant rel 0.00e+00), iq_multi_parity, native_expert_parity (IQ1_S 3.1e-08, IQ1_M 4.1e-08 vs ggml-cpu), native_grouped_parity — 0 failures.
  • AVX-512 path under Intel SDE -spr (this Zen 2 cannot run it): rel ~1e-07 vs ggml-cpu, width-invariant, 0 failures.
  • hip_prefill_mmq_parity extended with a synthetic IQ1_S case: rel_l2 0.0038 (limit 0.04), max_abs/ref_rms 0.0145, 0 zero rows.

🔄 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/1374 **Author:** [@Yxmura](https://github.com/Yxmura) **Created:** 10/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr-iq1s-v2` --- ### 📝 Commits (8) - [`e87b2ea`](https://github.com/Niko1221/Strata/commit/e87b2ea6ceadde604d2525f6a6f6cba862d225dc) kernels: run IQ1_S (GGML type 19) on the GPU and on AVX-2 - [`91ed24e`](https://github.com/Niko1221/Strata/commit/91ed24ee6470bb8c281026d8023f5d5247fd0698) kernels: run IQ1_S and IQ1_M on 512-bit lanes - [`392bfc5`](https://github.com/Niko1221/Strata/commit/392bfc527859b5937716888fc40c5686ad7be3c0) experts: measure the PCIe share instead of trusting the link alone - [`f368edf`](https://github.com/Niko1221/Strata/commit/f368edfd831acbdf3cc3e13bb9a601d72a0497b2) prefill: run IQ1_S experts through the MMQ prompt path - [`96ad434`](https://github.com/Niko1221/Strata/commit/96ad4343859dc757b023b03810ee32c6966f24e3) Merge origin/main into the IQ1_S/AMD branch - [`cbd3695`](https://github.com/Niko1221/Strata/commit/cbd369550efa87838aefb0bf5477b3ad949566b8) Merge main (0.1.42) into the IQ1_S/AMD branch - [`f0b09e1`](https://github.com/Niko1221/Strata/commit/f0b09e1a11e0f9a2efaab4c766a69cc9b002699b) Merge main (0.1.44) into the IQ1_S/AMD branch - [`5f5237d`](https://github.com/Niko1221/Strata/commit/5f5237dcfab1e42eea9066195652659dc092f7b7) Merge remote-tracking branch 'origin/main' into pr-iq1s-v2 ### 📊 Changes **21 files changed** (+450 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+1 -1) 📝 `README.md` (+1 -1) 📝 `docs/AMD_HIP.md` (+5 -0) 📝 `docs/DETAILS.md` (+17 -0) 📝 `include/strata/artifact/gguf_reader.hpp` (+4 -0) 📝 `include/strata/kernels/cpu/native_expert.hpp` (+2 -2) 📝 `include/strata/kernels/iq_kernels.hpp` (+1 -1) 📝 `src/kernels/cpu/iq_avx2.cpp` (+1 -1) 📝 `src/kernels/cpu/iq_avx2_rows.inl` (+112 -0) 📝 `src/kernels/cpu/iq_avx512.cpp` (+146 -5) 📝 `src/kernels/cpu/native_expert.cpp` (+2 -2) 📝 `src/kernels/cuda/dequant_bf16.cu` (+1 -1) 📝 `src/kernels/cuda/iq_kernels.cu` (+81 -4) 📝 `src/kernels/cuda/native_mmvq.cu` (+3 -3) 📝 `src/kernels/iq_multi_parity.cpp` (+4 -3) 📝 `src/kernels/iq_parity.cpp` (+1 -1) 📝 `src/kernels/native_grouped_parity.cpp` (+2 -1) 📝 `src/prefill/moe_mmq.cu` (+2 -0) 📝 `tests/hip/prefill_mmq_parity.cpp` (+30 -0) ➕ `tools/hip/gfx1100-hipblaslt-100300.txt` (+32 -0) _...and 1 more files_ </details> ### 📄 Description Round 2: IQ1_S made first-class across the pipeline, plus a PM-driven PCIe share. ## What - **IQ1_S (type 19) on the GPU and on AVX-2.** Unsloth UD-IQ1_S packs did not run at all before: `dq_iq1_s`, `vec_dot_iq1_s_q8_1`, `Fmt<19>`, `Split<19>`, the grouped kernels, the reader geometry, and the AVX-2 `row_dot_iq1s`/`row_dot_iq1m`. - **IQ1_S + IQ1_M on 512-bit lanes.** `iq512_supported` listed neither, and `native_expert.cpp` only takes the AVX-2 kernel off an AVX-512 CPU, so AVX-512 CPUs ran both through ggml-cpu single-token — slower than an AVX-2 CPU. No EVEX `vpsignb`, so the grid sign is `vpabsb` + a masked subtract. - **IQ1_S on the MMQ prompt path.** IQ1_S was absent from `_strata_mmq_types`, `mmq::supported()` and the dispatch switch, so UD-IQ1_S prefill fell back to per-expert dequant→FP16. Added; the `mmq-instance-iq1_s.cu` already exists in the pinned ggml. - **The PCIe share measures itself (serve).** `--pcie-frac` was the link probe alone (capped 0.55); the best share also depends on the CPU/GPU and runs *both* ways. A `--serve` sweeps the probed share, 0 and 1.0 over its first verify windows, keeps the lowest (CPU pool + GPU wait) per routed expert entry, and holds it. `--pcie-frac <value>` pins; `--pcie-frac auto` for the CLI. ## Measured Radeon PRO W7800 (gfx1100, ROCm 7.13), Ryzen 7 3800X, 30 GiB RAM; UD-IQ1_S (67.5 GiB); 600-token prompt, MTP. | | before | after | |---|---|---| | UD-IQ1_S loads/answers | no | yes | | decode (this box) | 26.5 tok/s (probed share) | **40.2 → 75.3 tok/s** (measured, held) | | prefill | 169.7 tok/s | **326.8 tok/s** (+93%: +16% the other formats, **+66% from IQ1_S MMQ alone**) | | AVX-512 CPU, IQ1_S/IQ1_M gate/up | ggml-cpu single-token | multi-token AVX-512 | The share runs both ways, which is why it is measured: here the GPU taking every miss is fastest, while in the [RDNA2 x8 bench](../blob/main/bench/results/2026-10-04-rdna2-helper-pcie-share/README.md) `--pcie-frac 0` beat the probed 0.39. ## Validation - HIP gfx1100 + full `strata`; `iq_parity` (IQ1_S/IQ1_M dequant rel 0.00e+00), `iq_multi_parity`, `native_expert_parity` (IQ1_S 3.1e-08, IQ1_M 4.1e-08 vs ggml-cpu), `native_grouped_parity` — 0 failures. - AVX-512 path under Intel SDE `-spr` (this Zen 2 cannot run it): rel ~1e-07 vs ggml-cpu, width-invariant, 0 failures. - `hip_prefill_mmq_parity` extended with a synthetic IQ1_S case: rel_l2 0.0038 (limit 0.04), max_abs/ref_rms 0.0145, 0 zero rows. --- <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:18 +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#3413
No description provided.