mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2355] [CLOSED] pf_wmma: set the tiles' shared-memory attribute on each card, so the second card of a layer split can launch them #3998
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3998
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2355
Author: @Warabii1248
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:v100-pf-wmma-layer-split📝 Commits (7)
22966ebprefill: Volta runs the prompt experts on FP16 tensor-core tiles, a group per launch (STRATA_PF_WMMA)45f9397pf_wmma_parity: gemm_iq_f16_grouped against a double reference over the FP16 path's weights7fd8375bench/results: V100 prompt experts on FP16 tensor cores (+9.6% / +10.3% prompt speed); docs/NVIDIA_V100.md8750852pf_wmma: IQ4_NL (type 20) WK=128 lane for the down product (K=640); parity casesedf7bdcpf_wmma: take the FP16 prompt path for IQ4_NL down too (mmq_dt == 20)d5fdec0pf_wmma_parity: run on every sm_70+ card in one process, in turn (a layer split launches the tiles on its second card after the first)2cec5c3pf_wmma: set the tiles shared-memory attribute on each card, not once per process (a layer split stopped on its second card: "the WMMA expert tiles could not launch")📊 Changes
10 files changed (+577 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(+185 -0)➕
src/kernels/pf_wmma_parity.cpp(+160 -0)📝
src/prefill/kernels.cu(+16 -0)📝
src/prefill/prefill.cpp(+58 -5)📄 Description
Title
pf_wmma: set the tiles' shared-memory attribute on each card, so the second card of a layer split can launch them
Issue: stacked on #1771 (which carries #1401's FP16 prompt commits). This PR's changes are the last two commits,
d5fdec0and2cec5c3. #1771 no longer merges cleanly into main ated4773e(a conflict insrc/prefill/prefill.cpp); this branch carries that conflict, and its own two commits touch onlysrc/kernels/cuda/iq_kernels.cuandsrc/kernels/pf_wmma_parity.cpp.Summary
gemm_iq_f16_groupedsets the over-48 KiB dynamic shared-memory attribute of its three tile kernels once per process (static bool attr).cudaFuncSetAttributeapplies to the current device only, so on a layer split only the card that launched the tiles first has it.The next card's launch fails,
gemm_iq_f16_groupedreturns false, and the prompt stops withprefill: the WMMA expert tiles could not launch(the engine exits with code 1 and serve restarts it). The measurements in #1401 / #1771 that we found are on one card, where this path is not reached.
The fix keeps the flag per device (the same per-device
[64]shape asexp_mode()in the same file).pf_wmma_paritynow runs its cases on every sm_70+ card in turn within one process, as a layer split does; before the fix every case fails on the second card.What changed
src/kernels/cuda/iq_kernels.cu: set the attribute once per device instead of once per process (static bool attr[64],cudaGetDevice).src/kernels/pf_wmma_parity.cpp: run the cases on each sm_70+ device in turn (cudaSetDevice); the summary line gives the device count.iq_kernels.cuchange is inside the#if !defined(__HIPCC__)block ofgemm_iq_f16_grouped(both HIP builds compile the stubthat returns false, unchanged), and the SYCL build has no
gemm_iq_f16_grouped.HIP builds, without a GPU in ROCm 7.14 containers:
-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906(themixa3607/rocm-gfx906:7.14-completeimage docs/AMD_HIP.md uses;
strataandpf_wmma_parity) and-DSTRATA_ENABLE_HIP=ON -DSTRATA_ENABLE_CUDA=OFF -DCMAKE_HIP_ARCHITECTURES="gfx1100;gfx1201"(rocm/dev-ubuntu-24.04:7.14.1-full;strata) both compile with 0 errors. Not run (no AMD card here). SYCL not built: it does not compile the changed files (it has its owniq_kernelscopy and nopf_wmma_parity).The branch is v0.1.43 (
7695859) with #1771's five commits cherry-picked onto it (#1771 itself is on v0.1.41,fb58e0d; the patches areunchanged, authors kept,
cherry picked fromtrailers) and the two commits above on top. No commit in7695859..a0116b2(mainwhen this branch was made) touchesiq_kernels.cuorpf_wmma_parity.cpp; sincea0116b2, main has changediq_kernels.cu(ated4773ethat file merges without a text conflict; we have not built the branch oned4773e).Effect on default behavior: with one card, that card's attribute is set at the same point as before. On a layer split of two or more cards, the prompt that stopped now runs.
Checks (Tesla V100-PCIE-32GB + Tesla PG500-216 (sm_70, 32 GB), layer split K=24, CUDA 12.9, Linux,
-DSTRATA_EXPERIMENTAL_SM60=ON)How we checked: the parity test before and after the fix, then the engine on the layer split before the fix and, after it, with and without the tiles.
pf_wmma_paritybefore the fix: device 0 8 / 8 ok, device 1 8 / 8 "not launched" (8 failures on 2 devices, exit code 1).After:
0 failures on 2 devices, exit code 0. The second card's errors equal the first card's (e.g. IQ4_NL 2560x640 max |err| 0.000162 of 65.4).setup.py --model IQ3_XXSinstalls (ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF, nothing else changed),--mmap-experts, 256K context, int8 KV,STRATA_SM70_TABLE=1, every expert in VRAM, 170 W power limit.Before the fix, default (
STRATA_PF_WMMAon): the first prompt stops withprefill: the WMMA expert tiles could not launch(0 tokens read; the engine exits with code 1 and serve restarts it).After the fix:
STRATA_PF_WMMA=0against the default, alternating, a fresh engine start per run. After each start, fresh prompts of 26.7K(the first request), 52K (the second) and 104K tokens (the third), nothing reused. Prompt tok/s = prompt tokens / time to the first content token, measured on the client:
STRATA_PF_WMMA=0(3 runs)Every default run is above every
=0run. The third default run is a re-run: in the first attempt the start-up PLE read check measured 9,325 rows/s(the other five starts 33,428-37,238), and 0.1.43's automatic switch moved that run to
--ple-io mmap(385 / 1,115 / 1,075 tok/s; we did not find the cause).That is the PLE read mode, not the tiles, so we re-ran it with
STRATA_PLE_PROBE=0(--ple-io direct, what the check chose on every other start).(In 0.1.43.1 the switch only warns, #2040.)
Extra Notes
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.