[PR #195] Verify window: moe_win_group_kernel's tables in shared memory - as a thread's locals they made every DFlash window launch fail "out of memory" on a V100 at a 400 MiB reserve #389

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

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

State: closed
Merged: Yes


What this changes

moe_win_group_kernel (one thread groups a window's entries by expert slot) kept its four tables - kWinEnt
unsigned long longs and three int arrays, 2,576 bytes - as locals on the thread's stack. The driver reserves a
kernel's stack for every thread the device can hold at a launch (sm_70: 80 SMs x 2,048 threads x 2.6 KB = ~420 MB),
so once the expert pool has taken the free VRAM down to a few hundred MB, every launch of the window's MoE fails with
"out of memory" and the window aborts ("glm window: 84 kernel launch(es) failed"). The tables are in shared memory
now (STACK 0, SHARED 2,576 bytes per cuobjdump); the kernel is otherwise unchanged.

One V100-PCIe-32GB + Ryzen 9 7950X, Maya-S24, the Q4_K_M GLM-5.3-Flash-DFlash2 drafter, STRATA_GLM_RESERVE_MB=400,
three 256-token greedy answers: main - every DFlash window fails (84 failed launches); with this - the drafts run
(93% accepted), plain decode unchanged (24.7 / 26.8 / 27.5 -> 23.9 / 26.8 / 27.5 tok/s, run-to-run noise).

**Original Pull Request:** https://github.com/mw00/project-maya/pull/195 **State:** closed **Merged:** Yes --- ## What this changes moe_win_group_kernel (one thread groups a window's entries by expert slot) kept its four tables - kWinEnt unsigned long longs and three int arrays, 2,576 bytes - as locals on the thread's stack. The driver reserves a kernel's stack for every thread the device can hold at a launch (sm_70: 80 SMs x 2,048 threads x 2.6 KB = ~420 MB), so once the expert pool has taken the free VRAM down to a few hundred MB, every launch of the window's MoE fails with "out of memory" and the window aborts ("glm window: 84 kernel launch(es) failed"). The tables are in shared memory now (STACK 0, SHARED 2,576 bytes per cuobjdump); the kernel is otherwise unchanged. One V100-PCIe-32GB + Ryzen 9 7950X, Maya-S24, the Q4_K_M GLM-5.3-Flash-DFlash2 drafter, STRATA_GLM_RESERVE_MB=400, three 256-token greedy answers: main - every DFlash window fails (84 failed launches); with this - the drafts run (93% accepted), plain decode unchanged (24.7 / 26.8 / 27.5 -> 23.9 / 26.8 / 27.5 tok/s, run-to-run noise).
bsakaguchi 2026-10-29 21:24:56 +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#389
No description provided.