Repository navigation
common : fit: size the MoE cache for -cmoe --moe-cache-mib auto - #380
Open
LeoBorcherding wants to merge 6 commits into
Open
LeoBorcherding wants to merge 6 commits into
LeoBorcherding wants to merge 6 commits into
Conversation
…already fits --cpu-moe already keeps every routed expert in host RAM, the placement auto would choose itself, but the fit returned early with no changes needed and left the free device memory unused. Size the cache there with the same loop as the auto path; other overrides keep the warning.
…cated size The cache caps itself at the size of the host experts, so with a lot of free device memory the requested size overstated the cache several times over; the llama_moe_cache log line right after it gives the real size.
On an iGPU (Strix Halo) the experts kept in host RAM and the device cache come out of the same memory, so sizing the cache from device free memory alone asked for an 80 GB cache on top of 80 GB of host experts and failed to allocate.
The single-device context-reduction return skipped the cache sizing, so -cmoe --moe-cache-mib auto with an automatic context silently kept no cache.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for #251 itself, targeting its branch:
-cmoe --moe-cache-mib autogot no cache because the fit returned atno changes neededbefore the auto sizing ran.5d196fbd6,f06be43af: an override other than a lone--cpu-moenow warns instead of silently sizing nothing.344fc1817: a lone--cpu-moegets the cache sized at that early return. It shares the sizing loop with the existing auto path.3ca685f4b: the log says "cache budget", since the cache caps itself at the host expert size.83c310142: on an integrated GPU, host-resident experts count against the target, since they share RAM with the cache. Without it, GLM-5.3-Flash on Strix Halo failed to allocate a 79924 MiB cache. With it, the cache is 11525 MiB and decodes at 12.5 tok/s.040c1bcf4: the cache is also sized when the fit only succeeds by shrinking the context.Codex is clean on
040c1bcf4(mirror). Measurements on L4, R9700 (Windows), RX 9060 XT and Strix Halo are in the #251 results comment. With the fix,-cmoeauto sizes the same cache as plain auto, and every cache run's greedy output is byte-identical to the all-GPU run.