perf(cuda): add in-place GDN state write#24
Open
dusterbloom wants to merge 1 commit into
Open
Conversation
3e57037 to
9fc7329
Compare
c279bc4 to
f321139
Compare
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.
What
Adds an opt-in in-place final-state write path for the CUDA gated-delta-net (GDN) op.
ggml_gated_delta_net_inplace().op_params[1]so CUDA writes the final recurrent state directly tosrc[5](state) instead of the packed result tensor's final-state slot.ggml_gated_delta_net()behavior is unchanged.lucebox-ggml#26API (ggml_gated_delta_net_set_skip_intermediate).Why
The Lucebox pure-AR decode graph currently needs a downstream copy from the GDN packed result into
the persistent SSM state. Writing the final state directly removes that copy without changing
existing callers.
This is now a single-concern PR. The previous mixed version also included props-check skipping and
launch-wrapper work; that concern is split into #27.
Validation
luce-dflashafter perf(qwen): skip unused GDN intermediate writes #26: base070b7d7d.env CUDACXX=/usr/local/cuda/bin/nvcc cmake -S /tmp/ggml-pr24-inplace -B /tmp/ggml-pr24-inplace/ build-cuda126-sm86 -DGGML_CUDA=ON -DGGML_CCACHE=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES=86cmake --build /tmp/ggml-pr24-inplace/build-cuda126-sm86 --target ggml-cuda -j 8CMAKE_CUDA_ARCHITECTURES=86failed because thisenvironment cannot probe
CUDA_ARCHITECTURES=nativewithout a visible GPU.