[PR #199] GLM prompt: the KDA recurrence over 4 blocks a head (kda_rec_split, unused until now) - kda_rec 4.71 -> 3.31 s on a 27K prompt #392

Closed
opened 2026-10-29 21:24:57 +07:00 by bsakaguchi · 0 comments
Owner

Original Pull Request: https://github.com/mw00/project-maya/pull/199

State: closed
Merged: Yes


What this changes

kda_rec_kernel runs one block a head through the chunk's tokens: 32 blocks, so most of a V100's 80 SMs wait. The
recurrence's value columns are independent, and kda_rec_split (the prologue and the output gate as parallel kernels,
the recurrence with 32 value columns a block - 4 blocks a head) was already in glm_batch.cu. The prompt path calls it
by default now; STRATA_GLM_KDA_SPLIT=0 the one-block kernel, =8 eight blocks a head, STRATA_GLM_KDA_SPLIT_CHECK=1
(debug) runs both and prints the state's and the output's rel L2 (~1e-7).

One V100-PCIe-32GB, Maya-S24, three 27K prompts, STRATA_GLM_PREFILL_PROF: kda_rec 4.71 -> 3.31 s (-30%; 8 blocks a head
measured slower), stream time 78.6 -> 77.9 s. Decode unchanged.

**Original Pull Request:** https://github.com/mw00/project-maya/pull/199 **State:** closed **Merged:** Yes --- ## What this changes kda_rec_kernel runs one block a head through the chunk's tokens: 32 blocks, so most of a V100's 80 SMs wait. The recurrence's value columns are independent, and kda_rec_split (the prologue and the output gate as parallel kernels, the recurrence with 32 value columns a block - 4 blocks a head) was already in glm_batch.cu. The prompt path calls it by default now; STRATA_GLM_KDA_SPLIT=0 the one-block kernel, =8 eight blocks a head, STRATA_GLM_KDA_SPLIT_CHECK=1 (debug) runs both and prints the state's and the output's rel L2 (~1e-7). One V100-PCIe-32GB, Maya-S24, three 27K prompts, STRATA_GLM_PREFILL_PROF: kda_rec 4.71 -> 3.31 s (-30%; 8 blocks a head measured slower), stream time 78.6 -> 77.9 s. Decode unchanged.
bsakaguchi 2026-10-29 21:24:57 +07:00
Sign in to join this conversation.
No labels
pull-request
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
mw00/project-maya#392
No description provided.