Repository navigation
fix(core): take every kernel uniform from cachedUniform so none outlives its executor - #62
Merged
Merged
Conversation
Member
|
LGTM once the stack is rebased. |
xxpopielxx
approved these changes
Oct 26, 2026
chmjkb
force-pushed
the
@chmjkb/leak-fix-kernel-uniforms
branch
2 times, most recently
from
October 26, 2026 10:38
90fc7dc to
55a0df6
Compare
5 of 11 tasks
chmjkb
force-pushed
the
@chmjkb/leak-fix-kernel-uniforms
branch
from
October 26, 2026 10:50
55a0df6 to
b4aeeaa
Compare
chmjkb
force-pushed
the
@chmjkb/leak-fix-kernel-uniforms
branch
from
October 26, 2026 10:52
b4aeeaa to
8570d73
Compare
chmjkb
force-pushed
the
@chmjkb/leak-fix-kernel-uniforms
branch
from
October 26, 2026 10:53
8570d73 to
a429682
Compare
chmjkb
marked this pull request as ready for review
October 26, 2026 10:55
chmjkb
force-pushed
the
@chmjkb/leak-fix-kernel-uniforms
branch
from
October 26, 2026 11:19
a429682 to
77b49d7
Compare
chmjkb
force-pushed
the
@chmjkb/leak-fix-kernel-uniforms
branch
from
October 26, 2026 11:19
77b49d7 to
13f36e1
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.
Description
Closes the kernel uniform leaks #60 found. Stacked on #61.
Eight kernels made their dims uniform with
root.createBuffer(...)inside their handle, so it lived until the device did, pastexecutor.dispose(): attention (batch, rows, rows split), attnDecode (decode, decode split), layerNorm, swigluChunk, conv1d, argmaxDot, gatherRowsFrom and writeRows. They now take it fromcachedUniformand their bind group fromcachedBindGroup, likeattnFlash,ropeand the other kernels already do. The uniforms are per device and keyed by value, so a new executor reuses them instead of making more.attnDecodeHandlenow lists its bind group entries one by one: the shared attention buffers carry asegsthe decode layout has no slot for, whichcreateBindGroupignored andcachedBindGroupwould key on.The leak checks in
eval.gpu.test.tsandzoo/leaks.gpu.test.tsno longer expect any uniform left over.Kernel A/B against #61
pnpm --filter runntime bench:ab kernels -b @chmjkb/gpu-leak-fixes -k attention,reduce,shape,elementwise,conv,matmul: 150 of 150 casessame, max abs(A−B) 0 on every case.Introduces a breaking change?
Type of change
Testing instructions
pnpm --filter runntime exec playwright install chromium(once per machine)pnpm --filter runntime testChecklist