Skip to content

models : fix graph splits - #19866

Merged
ggerganov merged 1 commit into
masterfrom
gg/qwem35-fix-graph-splits
Feb 24, 2026
Merged

ggerganov merged 1 commit into
masterfrom
gg/qwem35-fix-graph-splits

Conversation

@ggerganov

@ggerganov ggerganov commented Feb 24, 2026 •

Copy link
Copy Markdown
Member

fix #19860
fix #19864

Ensure the node order of Qwen 3.5 graphs is suitable for multi-GPU systems.

@jacekpoplawski

Copy link
Copy Markdown
Contributor

with this code 27B no longer crashes for me

@github-actions github-actions Bot added the model Model specific label Feb 24, 2026
@mukhma0c

Copy link
Copy Markdown

i had issues running qwen3.5-27b split across 2 gpus where it would crash before it generates anything. this pr fixed it
i am running linux ubuntu
intel i7 10700f
nvidia rtx 3090
nvidia rtx 3070
i was running the model using llama-server with the -ts 85,15 cli argument to split the model across both gpus and it was crashing before this pr. now it runs fine with PP over 700t/s and tg over 20t/s

@ggerganov
ggerganov merged commit 2446419 into master Feb 24, 2026
75 checks passed
@ggerganov
ggerganov deleted the gg/qwem35-fix-graph-splits branch February 24, 2026 22:01
aldehir pushed a commit to aldehir/llama.cpp that referenced this pull request Mar 6, 2026
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
aarcange pushed a commit to aarcange/llama.cpp that referenced this pull request May 20, 2026
Commit 2446419 added ggml_build_forward_expand immediately after
layer normalization to enable multi-GPU graph partitioning. However,
for recurrent linear attention models, this prematurely closed the
graph branch before the internal state updates (convolution and SSM
states) were fully constructed.

This caused the graph engine to schedule state cache writes out of
order or independently, leading to data races or stale reads in the
convolution and SSM states. The bug manifested as intermittent
generation corruption, such as alignment errors in code generation.

This commit moves the ggml_build_forward_expand call to immediately
after the linear attention layer computation for all recurrent
branches. This ensures the entire layer computation, including
internal state updates, is part of the forward graph before being
expanded for partitioning, restoring the correct topological barriers.

This was found and verified with a single GPU only using the
synthmerge_bench. The multi GPU split is untested.

Fixes: 2446419 ("models : fix graph splits (ggml-org#19866)")
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
MrLordCat referenced this pull request in MrLordCat/llama.cpp-rdna-lab Jul 16, 2026
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
aarcange pushed a commit to aarcange/llama.cpp that referenced this pull request Sep 30, 2026
Commit 2446419 added ggml_build_forward_expand immediately after
layer normalization to enable multi-GPU graph partitioning. However,
for recurrent linear attention models, this prematurely closed the
graph branch before the internal state updates (convolution and SSM
states) were fully constructed.

This caused the graph engine to schedule state cache writes out of
order or independently, leading to data races or stale reads in the
convolution and SSM states. The bug manifested as intermittent
generation corruption, such as alignment errors in code generation.

This commit moves the ggml_build_forward_expand call to immediately
after the linear attention layer computation for all recurrent
branches. This ensures the entire layer computation, including
internal state updates, is part of the forward graph before being
expanded for partitioning, restoring the correct topological barriers.

This was found and verified with a single GPU only using the
synthmerge_bench. The multi GPU split is untested.

Fixes: 2446419 ("models : fix graph splits (ggml-org#19866)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

model Model specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eval bug: qwen35 and qwen35moe graph split issues (Severe PP impact, crashes) Eval bug: CUDA error on Qwen3.5-27B

3 participants