moe-cache: pick a GPU device explicitly instead of the first non-meta device - #11
Open
ALeXssNdR wants to merge 1 commit into
Open
moe-cache: pick a GPU device explicitly instead of the first non-meta device#11ALeXssNdR wants to merge 1 commit into
ALeXssNdR wants to merge 1 commit into
Conversation
… device The expert-cache init selected the first non-meta entry of the model device list. On hosts where the list starts with the CPU device the cache silently disabled itself with 'no GPU device'. Select the first GPU-typed device instead, and fall back to enumerating every backend registry (including dynamically loaded ones such as libggml-cuda) when the model list has none. Measured on RTX 5080 Laptop 16GB, Ornith-1.5-35B-A3B (qwen35moe) Q4_K_M, -ngl 99 -ncmoe 99 -fa 1, 176 slots (9.8 GiB pack): baseline 56.8 t/s -> 80-92 t/s (+41-62%), single slot count that fits VRAM.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
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.
Problem
On hosts where the model device list starts with the CPU device, the expert cache silently disabled itself with
no GPU device - expert cache disabled, becauseinit_moe_expert_cache()picked the first non-meta device regardless of its type.While investigating I also hit two cases where the model device list contains no GPU entry at all (early loading stages / mmap path), so a registry fallback is included.
Fix
libggml-cuda) and then the default device registryMeasured
RTX 5080 Laptop 16 GB, Ornith-1.5-35B-A3B (
qwen35moe, 41 blocks) Q4_K_M, built with CUDA arch 120:That is +41–62% on the same hardware, bit-identical outputs, with a single slot count that fits VRAM (40 layers × 176 slots ≈ 9.8 GiB).
The routing profile was captured with
llama-moe-trace(512-token code + chat prompts, merged) exactly as documented in the README.Thanks for the great work on this fork — the video walkthrough of the LRU-vs-static tradeoff is excellent.