fix(cuda): support GLM IQ2_XXS routed down projection - #598
Closed
hy-sde wants to merge 1 commit into
Closed
Conversation
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.
Summary
Fix GLM-5.2 all-IQ2_XXS routed-MoE execution on CUDA. This resolves the
cuda GLM prefill failedreproduction reported in #595 for theantirez/GLM-5.2-GGUFIQ2_XXS model with--ssd-streamingon DGX Spark / GB10.This PR is based directly on current
mainand is independent of #592.Root cause
The generic CUDA routed-MoE dispatcher accepted:
Most routed layers in
GLM-5.2-UD-IQ2_XXS_RoutedIQ2XXS_blk78Q2K.ggufuse IQ2_XXS for gate, up, and down. The dispatcher rejected that combination before launching the routed projection, causing GLM prefill to fail.Changes
test-cuda-iq2-routed, a deterministic model-independent numerical test comparing every routed-MoE stage against the scalar CPU IQ2_XXS oracle.Reproduction
Hardware: NVIDIA DGX Spark, GB10 (
sm_121), CUDA backend../ds4 \ --cuda \ -m gguf/GLM-5.2-UD-IQ2_XXS_RoutedIQ2XXS_blk78Q2K.gguf \ --ssd-streaming \ --ctx 8192 \ --temp 0 \ --tokens 4 \ -p 'Reply with exactly: OK'Before this change:
After this change:
The process exited successfully after four non-EOS generation steps.
Numerical verification
The test covers selected-expert routing, route weights, IQ2_XXS gate/up projections, SwiGLU, IQ2_XXS down projection, and expert summation.
Build verification
Both CUDA binaries built successfully.
Fixes #595