cuda: fail closed grouped decode ROUTE to cached mmid - #75
GenerelSchwerz merged 1 commit into
Conversation
Layer-split decode graphs often keep argsort on one device, so the grouped planner cannot certify the expert-id route. Treat ROUTE as a legacy-safe reason and skip binding those groups so cached mul_mat_id can run instead of aborting the graph. Assisted-by: grok-4.6
|
Thanks for reproducing this and keeping the fix narrow. I reviewed the control flow and tested the PR head on a single RTX 5070 Ti: it builds, The fallback looks correct: I cannot independently reproduce the layer-split topology with one GPU. Could you add the exact before/after command and a short log showing both CUDA devices/layer placement, the original I also added a normal-level fallback notice directly to |
|
^^ AI btw. Thank you for contributing to my fork! I appreciate it. |
|
I was able to reproduce and validate this fix on a physical mixed-vendor Windows setup. Environment:
Runtime command used for both before/after tests: llama-server.exe ^
-m "C:\llama-moe-cache-drafting\build-cuda\bin\Release\models\Qwen3.8-Flash-Next-UD-IQ3_XXS-00001-of-00003.gguf" ^
--host 127.0.0.1 ^
--port 8080 ^
--device CUDA0,Vulkan2 ^
-ngl 999 ^
--tensor-split 1,1 ^
-sm layer ^
--moe-expert-cache-size 120 ^
--moe-expert-cache-host-pinned-mb 4096 ^
--load-mode mmap ^
-fit off ^
-c 4000 ^
-np 1 ^
--flash-attn on ^
--jinja ^
-lv 4With PR #76 alone ( After cherry-picking this PR ( and inference completes successfully. I also rebuilt the combined branch cleanly and ran one 1024-token warmup plus three repeated 1024-token requests. All completed without decode/compute errors. Warm generation results:
MoE cache hit rates for those three warm requests were 97.41%, 97.42%, and 97.42%. Observed memory use during generation was approximately:
The host-pin accounting at the fallback point was: So this closes the hardware-validation gap for the same layer-split ROUTE failure on a real CUDA + Vulkan two-GPU system as well. |
|
Merged as a compatibility fix for the layer-split ROUTE failure. When the grouped route cannot be certified, this keeps inference working through the existing cache-aware legacy mul_mat_id path. The GPU expert cache remains active, but the affected graph gives up grouped-decode execution. Grouped-decode fast-path support for layer-split multi-GPU is planned as follow-up work. That needs route validation across device transfers with correct synchronization and lifetime handling; this fallback remains useful for layouts that cannot use the fast path. No timeline is committed yet, and tensor-split expert weights are a separate scope. Thanks for the reproduction and the additional Windows CUDA + Vulkan validation with #76. AI disclosure: Codex assisted with review, merge and this comment under repository-owner direction. |
Overview
Layer-split + MoE expert cache would load and prefill, then abort on the first decode token with:
The grouped planner requires a local
argsortto certify the expert-id route. With--split-mode layer, thatargsortoften lives on one GPU while later layers run on the other, so GPU1 groups failGROUP_REASON_ROUTE. Prefill already used cachedmul_mat_id. Decode treatedROUTEasOUTCOME_ERRORand aborted the whole graph instead of failing closed.This treats
ROUTEas a legacy-safe decode reason (same as materialization / execution / consumer-equivalence) and skips binding those groups so cachedmul_mat_idcan run.Reproduced on dual RTX 5070 Ti with Qwen3.8-Flash-Next UD-IQ3_XXS,
--moe-expert-cache-size 80,--split-mode layer. After the change, decode returns tokens.test-moe-cachepasses.Additional information
The README already says unsupported grouped-decode layouts fail closed to cached
mul_mat_id. This closes that hole for layer-split.This is not tensor-split. Tensor-split of cached expert weights is still unsupported.
Requirements