[PR #1771] [CLOSED] prefill: Volta FP16 tensor-core prompt experts, with an IQ4_NL (type 20) down lane #3660

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1771
Author: @G0-0000
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: prefill-fp16-iq4nl


📝 Commits (5)

  • b56d75f prefill: Volta runs the prompt experts on FP16 tensor-core tiles, a group per launch (STRATA_PF_WMMA)
  • d5b5aa7 pf_wmma_parity: gemm_iq_f16_grouped against a double reference over the FP16 path's weights
  • 628fef4 bench/results: V100 prompt experts on FP16 tensor cores (+9.6% / +10.3% prompt speed); docs/NVIDIA_V100.md
  • ea2ecc6 pf_wmma: IQ4_NL (type 20) WK=128 lane for the down product (K=640); parity cases
  • 0742b98 pf_wmma: take the FP16 prompt path for IQ4_NL down too (mmq_dt == 20)

📊 Changes

10 files changed (+566 additions, -6 deletions)

View changed files

📝 CMakeLists.txt (+8 -0)
➕ bench/results/2026-10-07-v100-prompt-experts/README.md (+70 -0)
➕ bench/results/2026-10-07-v100-prompt-experts/ab-runs.jsonl (+72 -0)
📝 docs/NVIDIA_V100.md (+1 -1)
📝 include/strata/kernels/iq_kernels.hpp (+5 -0)
📝 include/strata/prefill/kernels.hpp (+2 -0)
📝 src/kernels/cuda/iq_kernels.cu (+181 -0)
➕ src/kernels/pf_wmma_parity.cpp (+153 -0)
📝 src/prefill/kernels.cu (+16 -0)
📝 src/prefill/prefill.cpp (+58 -5)

📄 Description

Volta (sm_70) runs the prompt experts on FP16 tensor-core tiles, a group per launch (STRATA_PF_WMMA), and this carries an IQ4_NL down lane so UD-IQ4_XS packs can use it.

This also carries #1401's three FP16 commits unchanged (b0a127e, 167cc4c, 4bc57c9 — authorship preserved), since they are unmerged.

The three #1401 commits (NoxestNoz / rewin123):

  • prefill: Volta runs the prompt experts on FP16 tensor-core tiles, a group per launch (STRATA_PF_WMMA).
  • pf_wmma_parity: gemm_iq_f16_grouped against a double reference over the FP16 path's weights.
  • bench/results + docs/NVIDIA_V100.md: V100 prompt experts on FP16 tensor cores (+9.6% / +10.3% prompt speed).

The two commits on top (this pack's contribution):

  • src/kernels/cuda/iq_kernels.cu: a WK=128 IQ4_NL (type 20) dequant lane in gemm_iq_f16_grouped (one thread per row × 64-value half, four block_iq4_nl per 128-value window), plus the host dispatch. The down product has K=640, which the generic WK=256 path cannot tile (640 % 256 != 0); widening the gate alone therefore fails at launch, so the lane is required.
  • src/prefill/prefill.cpp: two gates widened from mmq_dt == 42 to (mmq_dt == 42 || mmq_dt == 20).
  • src/kernels/pf_wmma_parity.cpp: parity cases — IQ4_NL 2560×640 down (the new lane), and IQ4_NL / IQ3_S / IQ4_XS 1280×2560 gate/up.

Motive. UD-IQ4_XS packs (down = IQ4_NL) never take the FP16 prompt path today; their down product falls back to MMQ.

Evidence (V100-SXM2-32GB, UD-IQ4_XS): pf_wmma_parity reports 0 failures, including the new lane. An env-gated trace confirms the 43 IQ4_NL-down layers take the tiles (43 layers × 4 chunks per round). Phase gemm down −24.9% (5/5 rounds), but the expert-weight copy wait grows +17.8% on our streamed setup, so end-to-end is ~flat there. Stated honestly: the win is in the phase, not the total, on a streamed configuration.

Caveats. FP16 activations, not bit-identical to q8_1 — same class as the rest of that path. The sm_60 multi-arch issue discussed in #1401 is not addressed here (we build sm_70).


🔄 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/1771 **Author:** [@G0-0000](https://github.com/G0-0000) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `prefill-fp16-iq4nl` --- ### 📝 Commits (5) - [`b56d75f`](https://github.com/Niko1221/Strata/commit/b56d75f6eef722c39338105cb6c02fb3c345ae3e) prefill: Volta runs the prompt experts on FP16 tensor-core tiles, a group per launch (STRATA_PF_WMMA) - [`d5b5aa7`](https://github.com/Niko1221/Strata/commit/d5b5aa728e22c9b9f8fa08c179f9f8952fdf6302) pf_wmma_parity: gemm_iq_f16_grouped against a double reference over the FP16 path's weights - [`628fef4`](https://github.com/Niko1221/Strata/commit/628fef4c70560ee9d3f3e867475deac49e304de2) bench/results: V100 prompt experts on FP16 tensor cores (+9.6% / +10.3% prompt speed); docs/NVIDIA_V100.md - [`ea2ecc6`](https://github.com/Niko1221/Strata/commit/ea2ecc6e352948f0416f8f348b9d9cfbbeb8a567) pf_wmma: IQ4_NL (type 20) WK=128 lane for the down product (K=640); parity cases - [`0742b98`](https://github.com/Niko1221/Strata/commit/0742b98382cbb96d1954f7328bbe2721b6b30b24) pf_wmma: take the FP16 prompt path for IQ4_NL down too (mmq_dt == 20) ### 📊 Changes **10 files changed** (+566 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+8 -0) ➕ `bench/results/2026-10-07-v100-prompt-experts/README.md` (+70 -0) ➕ `bench/results/2026-10-07-v100-prompt-experts/ab-runs.jsonl` (+72 -0) 📝 `docs/NVIDIA_V100.md` (+1 -1) 📝 `include/strata/kernels/iq_kernels.hpp` (+5 -0) 📝 `include/strata/prefill/kernels.hpp` (+2 -0) 📝 `src/kernels/cuda/iq_kernels.cu` (+181 -0) ➕ `src/kernels/pf_wmma_parity.cpp` (+153 -0) 📝 `src/prefill/kernels.cu` (+16 -0) 📝 `src/prefill/prefill.cpp` (+58 -5) </details> ### 📄 Description Volta (sm_70) runs the prompt experts on FP16 tensor-core tiles, a group per launch (`STRATA_PF_WMMA`), and this carries an IQ4_NL down lane so UD-IQ4_XS packs can use it. This also carries #1401's three FP16 commits unchanged (b0a127e, 167cc4c, 4bc57c9 — authorship preserved), since they are unmerged. **The three #1401 commits** (NoxestNoz / rewin123): - `prefill`: Volta runs the prompt experts on FP16 tensor-core tiles, a group per launch (`STRATA_PF_WMMA`). - `pf_wmma_parity`: `gemm_iq_f16_grouped` against a double reference over the FP16 path's weights. - `bench/results` + `docs/NVIDIA_V100.md`: V100 prompt experts on FP16 tensor cores (+9.6% / +10.3% prompt speed). **The two commits on top** (this pack's contribution): - `src/kernels/cuda/iq_kernels.cu`: a WK=128 IQ4_NL (type 20) dequant lane in `gemm_iq_f16_grouped` (one thread per row × 64-value half, four `block_iq4_nl` per 128-value window), plus the host dispatch. The down product has K=640, which the generic WK=256 path cannot tile (`640 % 256 != 0`); widening the gate alone therefore fails at launch, so the lane is required. - `src/prefill/prefill.cpp`: two gates widened from `mmq_dt == 42` to `(mmq_dt == 42 || mmq_dt == 20)`. - `src/kernels/pf_wmma_parity.cpp`: parity cases — IQ4_NL 2560×640 down (the new lane), and IQ4_NL / IQ3_S / IQ4_XS 1280×2560 gate/up. **Motive.** UD-IQ4_XS packs (down = IQ4_NL) never take the FP16 prompt path today; their down product falls back to MMQ. **Evidence** (V100-SXM2-32GB, UD-IQ4_XS): `pf_wmma_parity` reports **0 failures**, including the new lane. An env-gated trace confirms the 43 IQ4_NL-down layers take the tiles (43 layers × 4 chunks per round). Phase `gemm down` **−24.9%** (5/5 rounds), but the expert-weight copy wait grows **+17.8%** on our streamed setup, so end-to-end is **~flat** there. Stated honestly: the win is in the phase, not the total, on a streamed configuration. **Caveats.** FP16 activations, not bit-identical to q8_1 — same class as the rest of that path. The sm_60 multi-arch issue discussed in #1401 is not addressed here (we build sm_70). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29:53 +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#3660
No description provided.