mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #118] [CLOSED] GLM decode: fetch overlap - the resident experts compute while the PCIe fetch is on the link (opt-in, bit-exact) #351
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#351
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/118
Author: @q8atnight
Created: 10/11/2026
Status: ❌ Closed
Base:
main← Head:pr/fetch-overlap📝 Commits (3)
e37e7c3GLM decode: fetch overlap - a route's PCIe fetches on a side stream while the resident experts compute (STRATA_GLM_FETCH_OVERLAP, bit-exact)9eb294bfetch overlap: the side stream at the highest priority (STRATA_GLM_FETCH_PRIO=0: off); HIP mappingsceda603docs/SETTINGS.md: STRATA_GLM_FETCH_OVERLAP / _BLOCKS / _PRIO📊 Changes
6 files changed (+137 additions, -14 deletions)
View changed files
📝
docs/SETTINGS.md(+1 -0)📝
include/strata/hip_compat/cuda_runtime.h(+2 -0)📝
include/strata/kernels/glm_fast.hpp(+12 -2)📝
src/core/glm_fast_path.cu(+76 -3)📝
src/core/glm_fast_state.hpp(+8 -0)📝
src/kernels/cuda/glm_fast.cu(+38 -9)📄 Description
What
STRATA_GLM_FETCH_OVERLAP=1(off by default). Infast_moe, a route's experts that come over PCIe (moe_fetch) arecopied on a side stream while the experts already in VRAM run their gate/up and down on the main stream. The fetched
ones follow once they have landed.
moe_split_plan(one tiny kernel aftermoe_wait): splits the plan into the resident entries and the fetched ones(
fetch_src != 0), 8 + 8 device pointers.moe_gate_up/moe_downthen run with aMoeDevcopy whoseplan_ptris one half or the other. The kernels already skip an entry whoseplan_ptris 0, so gate/up needs nochange. The shared expert's down rides the first gate/up launch, as before.
moe_downgets an optionalpart_mode. Mode 1 parks each entry's down row values in an 8 x n_embdbuffer and writes nothing. Mode 2 computes its own entries, takes the others' values from the buffer, then runs the
same combine in the same plan order. Two launches give bit for bit what one launch gives. Mode 0 (the default) is
the old kernel path.
STRATA_GLM_FETCH_PRIO=0turns that off). At equal priority the expertkernels' many blocks filled the SMs first and the fetch started late.
STRATA_GLM_FETCH_BLOCKSsets the fetch'sblocks (default a quarter of the SMs).
STRATA_GLM_KDA_GRAPH), where the stream fork would be captured with it.cudaStreamCreateWithPriority,cudaDeviceGetStreamPriorityRange);tools/check_hip_compat.pypasses. Not built or run on AMD here.docs/SETTINGS.md.Exactness
STRATA_GLM_SCORE=64, 1199 scored tokens (README,serve/frontend.py, CHANGELOG, a German paragraph), reference =the unmodified v1.0.34 build: KL 0.000000 (max 0.0000), same top token 100.00 %. The same build run twice gives
the same, so the scoring path is deterministic and the check is exact.
Speed
Maya-M, 2x RTX 3090 (PCIe 4.0 x8 each), Ryzen 9 3950X, 128 GB DDR4-3600,
STRATA_GLM_RAM_RESIDENT=1,--max-context 262144 --kv int8. Harness: one engine start per run, the same 18 calibrate prompts, greedy, thinking off,256 tokens, after 6 warm-up prompts. Every run gets a fresh copy of the usage file. The comparison is per prompt
against interleaved runs without the setting (ratio to the mean of the neighbouring references).
STRATA_GLM_PROFon CUDA0 (layers 0-23): 29.2 → 27.1 ms a token of stream time. The fetch wait still dominates(12.7 ms a token): this box's x8 links are the bottleneck, and the overlap only hides the resident experts' ~2 ms
behind it.
On a box whose links are faster than its expert kernels, the gain should be larger.
Untested here: one GPU, AMD, and Windows. The change is off by default.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.