Negative results: 19 MoE-offload optimizations reviewed against current dev — what's already in the tree, what doesn't transfer, what's sub-noise #337
KingIcyCreamProjects
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Short version of a larger review I ran against current dev — each idea was first checked against the code (is it already in the tree?) and then attacked on impact for a single-stream, disk-bound GLM-5.2 config (9950X3D + RTX 5090, int4 experts on NVMe, ~800 ms/token budget at 1.25 tok/s). Posting the negative results so these don't get re-proposed one at a time.
Already in the tree (no need to build):
pilot_prefetchper layer over all draft positions (c/glm.c:3396-3397), andPILOT_REAL=1turns those into real async loads (see [Feature]: Pre-fetching MoE experts #333 for the nuance about the draft forward itself)moe()FASE B (:2965-2970)#ifdef COLI_METAL)grouped_hidden_w4_dual,COLI_CUDA_DUAL_PROJ=1)CACHE_ROUTE) and learned co-activation prefetch (COUPLE)Mechanism doesn't transfer to this router:
PILOT_Kdefault drop to 6 under real loads.Killed by measurements already in the repo:
EXPERT_BUDGETquarantine numbers (MTP acceptance → 0%, 14.7 experts/layer loaded vs topk=8 — more I/O, not less)tier.hLFRU)Real but sub-noise at batch-1 decode (Amdahl): pilot-worker condvar (the 200 µs poll only fires on an empty ring — worst case 0.025% of a token), router top-K heap (~0.1 ms/token, plus a tie-breaking hazard that would silently shift routing), LRU victim heap/CLOCK (the scan is a few L1-hot cache lines guarding an NVMe read 1000× its cost), residency bitmap for
expert_is_resident(per-layer npin is ~6, not the ~469 model-wide total),.qsscale-read coalescing (the three scale tensors are file-contiguous — I checked the shards — but it's 2 syscalls per miss, ~0.1% of the miss's own cost), DSA scratch hoisting (the select block is gatednk > index_topkfrom the model config — 2048 on my GLM-5.2 snapshot — so it never even runs at 96/256-token replays).What survived review as worth someone's time: the
dist_buildfull-vocab qsort per sampled token (measured 5.6–8.0 ms → ~0.78 ms with a partial top-p select; filed separately with an implementation branch) and a pin-vs-ecache hit-telemetry split as the gate for any eviction-policy work including #223 (also filed with a branch).Full writeup with line refs and per-idea verification available if anyone wants it.
Beta Was this translation helpful? Give feedback.
All reactions