mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #262] [MERGED] Volta grouped-WMMA prompt experts for the MoE prefill (STRATA_PF_WMMA, off by default) #433
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#433
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/mw00/project-maya/pull/262
Author: @chenyb999-zhcn
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/20/2026
Merged by: @mw00
Base:
main← Head:wmma-volta-prefill📝 Commits (1)
f538a87Volta grouped-WMMA prompt experts for the MoE prefill (MAYA_PF_WMMA, off by default)📊 Changes
11 files changed (+1007 additions, -25 deletions)
View changed files
📝
CMakeLists.txt(+9 -0)📝
docs/SETTINGS.md(+1 -0)📝
include/strata/kernels/glm_batch.hpp(+2 -0)📝
include/strata/kernels/iq_kernels.hpp(+25 -0)📝
include/strata/prefill/kernels.hpp(+2 -0)📝
src/core/glm_prefill.cu(+78 -3)📝
src/kernels/cuda/glm_batch.cu(+19 -0)📝
src/kernels/cuda/iq_kernels.cu(+442 -16)➕
src/kernels/pf_wmma_parity.cpp(+348 -0)📝
src/prefill/kernels.cu(+12 -0)📝
src/prefill/prefill.cpp(+69 -6)📄 Description
Volta grouped-WMMA prompt experts for the MoE prefill (
STRATA_PF_WMMA)One topic: the prompt path's routed-expert GEMMs (MMQ dp4a on the CUDA cores) gain a grouped WMMA kernel for Volta (sm_70) and newer. Each expert's IQ weights are dequantized to FP16 in shared memory and fed to 16x16x16 FP16 tensor-core tiles with FP32 accumulators. Decode is unchanged.
What it covers and how it stays safe
gemm_iq_f16_grouped_caps) attributes every tile shape's dynamic shared-memory size before any launch; a device that refuses one attribute keeps that shape on MMQ.STRATA_PF_WMMAis off by default; when it is on and the launcher rejects the first shape, the whole path stays on MMQ for the rest of the run (wmma_fell_back), so unsupported devices and formats cost nothing.tools/check_hip_compat.pypasses).Performance measurements (required by CONTRIBUTING)
2x Tesla V100-32GB, Maya-M (
--glm-pack), identical harness both sides: OpenAI/v1/chat/completionsstreaming TTFT to the first content delta, fresh prompts (deterministic per-round shuffles defeat the prefix cache), median of 3 rounds,max_tokens=24. Same binary,STRATA_PF_WMMA=1on vs0off:Decode is unchanged (~50 ms/token both sides), as expected for a prefill-only path. The relative gain shrinks on long prompts because streaming the expert weights over PCIe/RAM takes a larger share of the time, and short prompts are diluted by the fixed server-side overhead (tokenization etc.).
Output changes
The WMMA path rounds weights to FP16 and accumulates in FP32 tensor-core sums, so outputs differ from MMQ's within that rounding, checked against a double reference over the same FP16 weights by the new
pf_wmma_parityctest (max error <= 2e-5 of the matrix's max magnitude; guards, strides, sparse id gathers and an out-of-order weight table are exercised, so a launch reading the wrong half of the table mismatches instead of passing).Notes for reviewers
STRATA_PF_WMMA(default off): documented in docs/SETTINGS.md next toSTRATA_GLM_PREFILL_FUSED(its AMD counterpart). I kept the Strata-side name rather than aSTRATA_GLM_*prefix because it switches both packs' prefill path — happy to rename if you prefer.pf_wmma_parityneeds a GPU with FP16 tensor cores (sm_70+); on machines without one, ctest reports it skipped (SKIP_RETURN_CODE 77).--benchtimes the launch as a captured graph over 8 launches / 7 windows.python tools/check_hip_compat.pypasses locally (exit 0).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.