llama: name fused GDN outputs before callbacks - #24298
Closed
bogdanr wants to merge 1 commit into
Closed
Conversation
bogdanr
force-pushed
the
fix-fgdn-result-names
branch
from
July 5, 2026 23:36
d56d8f9 to
960276d
Compare
Author
|
Hi @CISC, small nudge on this one. I've just rebased it onto latest master so it's clean and ready to go. It fixes a crash when loading hybrid Gated Delta Net models (Gemma E2B) on the CPU path, where the fused GDN check hits an unnamed node and aborts. Would really appreciate a review whenever you get a minute. Thanks! |
Member
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
Name fused GDN result tensors before running the graph callback.
Context
The FGDN support check looks for graph nodes named with the
__fgdn_ar__-<layer>/__fgdn_ch__-<layer>prefix. With Gemma E2B I saw that check hit a generic name (node_47) on the CPU path, which made the support check fail before the fused path could be used.The callback already gets the same name, but this makes the name explicit on the
ggml_gated_delta_netresult before the callback runs.Notes
This did not show a measurable CPU speedup in my local Gemma E2B benchmark, and Vulkan was already enabling the fused path in my setup. The reason for the change is to keep the tensor naming consistent for the support check, not to claim a performance win.
Testing
cmake -S . -B /tmp/llama-pr-build \ -DLLAMA_BUILD_TESTS=OFF \ -DLLAMA_BUILD_EXAMPLES=OFF \ -DLLAMA_BUILD_SERVER=OFF \ -DGGML_VULKAN=OFF \ -DGGML_CUDA=OFF \ -DGGML_METAL=OFF cmake --build /tmp/llama-pr-build --target llama -- -j2I also checked the patch in a local llama-cpp-rs build with Gemma E2B. Fused GDN enabled cleanly there, but I did not observe a meaningful performance change.