mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #388] [MERGED] GLM prompt: EXL3 experts' tensor-core path by chunk length, opt-in (MAYA_GLM_EXL3_MMA_ROWS_SHORT) #506
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#506
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/388
Author: @somnergy
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @mw00
Base:
main← Head:pr/glm-exl3-mma-short📝 Commits (1)
40dddb9GLM prompt: EXL3 experts' tensor-core path by chunk length, opt-in (MAYA_GLM_EXL3_MMA_ROWS_SHORT)📊 Changes
5 files changed (+91 additions, -4 deletions)
View changed files
📝
CMakeLists.txt(+3 -2)📝
docs/SETTINGS.md(+1 -0)➕
include/strata/core/exl3_mma_rows.hpp(+34 -0)📝
src/core/glm_prefill.cu(+18 -2)➕
tests/core/exl3_mma_rows_test.cpp(+35 -0)📄 Description
Summary
In an EXL3 pack's prompt path, an expert routed more than
MAYA_GLM_EXL3_MMA_ROWS(64) of a chunk's tokens is rebuilt to FP16 and multiplied by cuBLAS - a fixed cost per expert and chunk - while lighter ones go through the tensor-core kernels, whose cost grows with the rows. In short chunks most experts have tens to a few hundred rows and the rebuild is most of the MoE time; in long chunks the FP16 product is cheaper, so raising the switch for every chunk makes long reads slower.MAYA_GLM_EXL3_MMA_ROWS_SHORT=<rows>[,<max chunk tokens>](off by default) sends experts of up to<rows>rows to the tensor-core kernels in chunks of up to<max chunk tokens>(4096); longer chunks keepMAYA_GLM_EXL3_MMA_ROWS. 91 lines; decode unchanged.Why
Measured under several concurrent Claude Code sessions (agentic coding: long multi-turn conversations, subagents, tool calls) through the Anthropic Messages API with
--parallel 8: most reads are short increments onto restored conversations - in a 45-minute sample, 95% of 319 reads had under 8K new tokens and a third under 512 - so short chunks are where the prompt time goes.Measured
Hardware: 2x NVIDIA RTX PRO 5000 Blackwell 72 GB, each on PCIe 5.0 x8 from its own CPU root port (no fast P2P); Intel Core Ultra 9 285K; 96 GB DDR5; driver 615.71.09, CUDA 13.4. Model: GLM-5.3-Flash EXL3 sc 3.10 bpw, every expert in VRAM, 2-GPU split. Wall time per chunk on each GPU (ms):
Whole reads with
MAYA_GLM_EXL3_MMA_ROWS_SHORT=192(these runs also cut reads into at least 4 chunks, #392), alone / with 3 requests decoding: 4K -15% / -14%, 8K -23% / -21%, 16K -16% / -15%, 2K -6% / -4%; 30K and a cold 60K read (chunks of 7-8K) unchanged. Without #392 a split reads up to 8192 tokens as one chunk, so the gain applies to reads of up to 4096 tokens (the first rows of the table).Recommendation
With EXL3 packs, set
MAYA_GLM_EXL3_MMA_ROWS_SHORT=192: short chunks get 14-24% faster and long chunks keep the default path (192 and 256 are within noise; 128 keeps most of the gain). It does nothing for GGUF / native packs (their prompt experts take MMQ). Leave it off if greedy output must match the setting off bit for bit. One GPU and experts streamed from RAM were not measured.Exactness
Not bit-exact: the tensor-core kernels decode and accumulate in another order than the FP16 rebuild plus cuBLAS. With identical chunking and the switch at 192 rows, greedy tokens differed from the default after 0-22 tokens in 42 of 44 short-chunk reads. A read whose chunks are all longer than
<max chunk tokens>takes the unchanged path: the cold 60K read gave identical tokens.How it was verified
tests/core/exl3_mma_rows_test.cpp(CPU): the parse and the rows by chunk length (the base when off, for long chunks and an unknown length; the setting's rows for short chunks).exl3_mma_rows_testpasses on the box above;tools/check_hip_compat.pyis clean.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.