[PR #215] GLM prompt: the shared expert in sub-batches of 2048 on CUDA - a 27K prompt -1.2% #399

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

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

State: closed
Merged: Yes


What this changes

With STRATA_GLM_PREFILL_SUB unset, the prompt path's shared expert ran sub-batches of kSub (256), and each sub-batch dequantizes its three matrices to FP16 again (105 times a layer on a 27K prompt). On CUDA it now runs sub-batches of 2048 (kShSub); STRATA_GLM_PREFILL_SH_SUB=<n> overrides, STRATA_GLM_PREFILL_SUB still sets every sub-batch, and HIP keeps kSub. The chunk's carve sizes the MoE buffers for it.

Measured

One V100-PCIe-32GB, Maya-S24, a 27K prompt with STRATA_GLM_PREFILL_SUB unset (the mixers pick 2048 themselves), two rounds each started below 60 C, STRATA_GLM_PREFILL_PROF=1:

GPU time shexp
main (shared expert 256) 79.4 / 80.1 s 2.96 / 2.98 s
this PR (2048) 78.6 / 78.9 s 1.55 / 1.55 s

The shared expert's arithmetic per token is unchanged (only how many tokens a dequantized copy serves).

Note: an earlier measurement I mentioned elsewhere ("PREFILL_SUB unset is 4x slower") was a test-harness artifact - the harness passed the literal string "unset" through the environment, which the engine clamps to sub-batches of 16. With the variable really unset, main runs these prompts in ~79 s.

**Original Pull Request:** https://github.com/mw00/project-maya/pull/215 **State:** closed **Merged:** Yes --- ## What this changes With `STRATA_GLM_PREFILL_SUB` unset, the prompt path's shared expert ran sub-batches of `kSub` (256), and each sub-batch dequantizes its three matrices to FP16 again (105 times a layer on a 27K prompt). On CUDA it now runs sub-batches of 2048 (`kShSub`); `STRATA_GLM_PREFILL_SH_SUB=<n>` overrides, `STRATA_GLM_PREFILL_SUB` still sets every sub-batch, and HIP keeps `kSub`. The chunk's carve sizes the MoE buffers for it. ## Measured One V100-PCIe-32GB, Maya-S24, a 27K prompt with `STRATA_GLM_PREFILL_SUB` unset (the mixers pick 2048 themselves), two rounds each started below 60 C, `STRATA_GLM_PREFILL_PROF=1`: | | GPU time | shexp | |---|---|---| | main (shared expert 256) | 79.4 / 80.1 s | 2.96 / 2.98 s | | this PR (2048) | 78.6 / 78.9 s | 1.55 / 1.55 s | The shared expert's arithmetic per token is unchanged (only how many tokens a dequantized copy serves). Note: an earlier measurement I mentioned elsewhere ("PREFILL_SUB unset is 4x slower") was a test-harness artifact - the harness passed the literal string "unset" through the environment, which the engine clamps to sub-batches of 16. With the variable really unset, main runs these prompts in ~79 s.
bsakaguchi 2026-10-29 21:25:02 +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#399
No description provided.