Repository navigation
Replies: 2 comments
|
Second host, same patch (5d16fb7 on f6d944f), same 18 requests at C=1. Card: RTX 3090 Ti (24 GB, PCIe 3.0). CPU side: 2-socket DDR4 with interleaved memory. GLM-5.3 UD-Q2_K_XL,
|
0 replies
|
Three additions to the numbers above. The first corrects the second host; the other two extend the bias results on the first.
Written with Claude Code (Claude Opus 5.5) |
0 replies
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.
I would like to propose an opt-in flag,
--moe-cache-route-bias B(default 0), that addsBto the selection score of experts already in the MoE cache during decode. On GLM-5.3 with a cache holding 5.7% of the routed experts,B = 0.1cut time per token by 34% with the same MMLU-Pro score (343 of 400 in both modes).With exact routing, two thirds of the selected experts miss the cache, and a cached expert that scores just under the k-th selected one still costs a full miss. Only the selection changes: the chosen experts are still weighted by the unbiased router probabilities, and prompts are not biased. With
B = 0nothing is allocated and the graph is unchanged; withB > 0outputs depend on the cache's history, as any residency-aware routing must.The numbers are from v1.0.0 (b1b770d). Master has since moved the MoE cache code out of
llama-graph.cpp(#32157) and changedllama-moe-cache.cpp(#33133), so the patch needs a rebase and a fresh run. #30763 proposed cache-prior reranking on the same cache and was closed by its author an hour after opening, without review, so I am asking here first: is an opt-in, off-by-default flag like this welcome, and would a PR be considered after a rebase and re-measurement?The measurements were run by an AI coding agent under my direction, and I reviewed the method and the numbers. The patch was also written by the agent.
What B is added to
GLM-5.3 routes with a sigmoid gate, so the selection score of expert e is
sigmoid(z_e) + b_e, whereb_eis the model's ownexp_probs_band the gate term runs 0 to 1. In this GGUF the within-layer standard deviation ofexp_probs_bis 0.022 to 0.146, median 0.040.B = 0.1is a tenth of the gate's range and about 2.5 times that median. Biases added to softmax logits in other engines are on a different scale and do not compare.Setup and measurements
GLM-5.3 UD-Q2_K_XL (unsloth, revision 346b3591), one RTX 5090,
-cmoe --moe-cache-mibwith a 13 GiB cache (1,101 slots, 5.7% of routed experts),--moe-cache-cpu-share 0.95, one request at a time, llama.cpp v1.0.0 plus the patch.B = 0vs unpatched v1.0.0, 18 requestsB = 0.1vsB = 0, same 18 requests, pairedB = 0.1vsB = 0Speed only, one 512-token generation per value, time per token relative to
B = 0:From about 0.3 the cache stops following the request. At 0.5, after decode position 256, 98.6% of selected experts come from the ~15 resident per layer. That is close to masking uncached experts outright, which a commenter on FlashML-org/FreeToken#176 reports collapses output at small caches, so I stayed at 0.1.
Limits: one model, one GPU, one host, one request at a time. The same idea in FreeToken, with its own measurements, is written up in FlashML-org/FreeToken#964. I can post the launch line and the per-request tables if useful.
Written with Claude Opus 5.5
All reactions