Repository navigation
refactor(zoo): move the EmbeddingGemma 2 state dict hooks onto the shared weight helpers - #79
Merged
Merged
Conversation
chmjkb
force-pushed
the
@chmjkb/hooks-moonshine-privacy-filter
branch
from
October 28, 2026 09:16
a6e580c to
c2f4e66
Compare
chmjkb
force-pushed
the
@chmjkb/hooks-embeddinggemma2-depthart
branch
2 times, most recently
from
October 28, 2026 10:49
2bc8d21 to
239dbf3
Compare
chmjkb
force-pushed
the
@chmjkb/hooks-moonshine-privacy-filter
branch
from
October 28, 2026 10:49
c2f4e66 to
1930710
Compare
chmjkb
force-pushed
the
@chmjkb/hooks-embeddinggemma2-depthart
branch
from
October 28, 2026 10:58
239dbf3 to
dc28153
Compare
chmjkb
force-pushed
the
@chmjkb/hooks-moonshine-privacy-filter
branch
from
October 28, 2026 10:58
1930710 to
e4659b0
Compare
xxpopielxx
reviewed
Oct 29, 2026
chmjkb
force-pushed
the
@chmjkb/hooks-moonshine-privacy-filter
branch
from
October 30, 2026 11:26
e4659b0 to
52294eb
Compare
chmjkb
force-pushed
the
@chmjkb/hooks-embeddinggemma2-depthart
branch
from
October 30, 2026 11:26
dc28153 to
2bd5993
Compare
Closed
chmjkb
force-pushed
the
@chmjkb/hooks-moonshine-privacy-filter
branch
from
October 30, 2026 12:47
52294eb to
5ada244
Compare
chmjkb
force-pushed
the
@chmjkb/hooks-embeddinggemma2-depthart
branch
from
October 30, 2026 12:47
2bd5993 to
54465a7
Compare
Base automatically changed from
@chmjkb/hooks-moonshine-privacy-filter
to
main
October 30, 2026 12:52
…ight helpers and keep f16 in f16
…ost norms stay f32
…and audio post norms
…so the hook's layer type is covered With only a sliding layer, a hook that read cfg.attention.sliding for every layer still passed. The full layer has its own headDim, so its rope block differs and the test now fails on that mistake.
chmjkb
force-pushed
the
@chmjkb/hooks-embeddinggemma2-depthart
branch
from
October 30, 2026 13:26
54465a7 to
38fa2f7
Compare
xxpopielxx
approved these changes
Oct 30, 2026
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
Moves the EmbeddingGemma 2 state dict hooks onto the shared weight helpers and adds
permuteRows. The last hook migration of phase 1 in #70.permuteRows(t, order): row i of the result is roworder[i]oft, like torcht[order]. Lazy, keeps dtype and byteLength. ThrowsCHECKPOINT_MISMATCHwhenorderis not a permutation.concatRows. The rope reorder ispermuteRowswith aropeOrder(rows, block)index list, replacinginterleaveHeads.qkv_normtiles the permuted norms withconcatRows, plus ones for v. byteLength still counts each norm once.scaleWeight. The vision position table issplitRows+reshapeWeight. The audio convs arereshapeWeight,permuteRowsandtransposeWeight.layer_scalar,relandq_scalestay f32: CPU code and the attention kernel read them as f32.-exp(x)), so it only gets one-line comments saying why each stays f32.Names, shapes and byteLengths reaching the models are unchanged.
Introduces a breaking change?
Type of change
Testing instructions
pnpm typecheck && pnpm lint && pnpm --filter runntime test:unit(941 pass)test/zoo/embeddinggemma2/stateDictHooks.test.ts: all three towers on F32 and F16 synthetic checkpoints, values against hand-worked math including the rope row order.permuteRowscases intest/core/weights/transforms.test.ts.pnpm --filter runntime test:gpu: 1439 passed, 16 expected failures. The zoo leak tests bind random weights, so they don't run these hooks.Related issues
Part of #70. Stacked on #78.
Checklist
Additional notes
scaleWeightkeeps products in f32 (fixed in feat(core): add lazy weight helpers for state dict hooks and move MiniLM onto them #75), so the scaled PLE projection and audio post norms load the same values as onmain.