Repository navigation
refactor(zoo): move the Moonshine and privacy-filter state dict hooks onto the shared weight helpers - #78
Merged
Conversation
5 of 11 tasks
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/linear-f16-load
branch
2 times, most recently
from
October 28, 2026 10:49
756048a to
b4448d4
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/linear-f16-load
branch
from
October 28, 2026 10:57
b4448d4 to
1505b3e
Compare
chmjkb
force-pushed
the
@chmjkb/hooks-moonshine-privacy-filter
branch
from
October 28, 2026 10:58
1930710 to
e4659b0
Compare
xxpopielxx
approved these changes
Oct 29, 2026
chmjkb
force-pushed
the
@chmjkb/linear-f16-load
branch
from
October 30, 2026 11:26
0e802e6 to
75b704f
Compare
chmjkb
force-pushed
the
@chmjkb/hooks-moonshine-privacy-filter
branch
from
October 30, 2026 11:26
e4659b0 to
52294eb
Compare
…d keep f16 checkpoints in f16
…d say so in the hook
…d weight helpers and keep f16 in f16
… keeps products in f32
chmjkb
force-pushed
the
@chmjkb/hooks-moonshine-privacy-filter
branch
from
October 30, 2026 12:47
52294eb to
5ada244
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
Moves the Moonshine, Moonshine streaming and privacy-filter state dict hooks onto the shared weight helpers, and adds
reshapeWeight.reshapeWeight: changes the shape only. No copy, no conversion; the tensor keeps its dtype and byteLength. Mismatched element counts throwCHECKPOINT_MISMATCH.concatRows+scaleWeight.stackRowsis gone.fuseQkv.gamma + 1stays f32 on purpose (rounding it to f16 would lose precision on devices without shader-f16), as doexp(log_k)and the all-ones CMVN weight.lazyF32/concatRows/column split are gone. Gate/up issplitCols+reshapeWeight,down_projisreshapeWeight. The quantized path is untouched: quantized files skip this hook.test/core/weights/checkpoint.ts.Names, shapes and byteLengths reaching the models are unchanged, so the hosted files load as before. F16 checkpoints now stay f16 through these hooks.
Introduces a breaking change?
Type of change
Testing instructions
pnpm typecheck && pnpm lint && pnpm --filter runntime test:unit(923 pass)test/zoo/{moonshine,moonshine-streaming,privacy-filter}/stateDictHooks.test.ts, each on F32 and F16 synthetic checkpoints, values against hand-worked math.reshapeWeightcases intest/core/weights/transforms.test.ts.pnpm --filter runntime test:gpu: 1439 passed, 16 expected failures.Related issues
Part of #70. Stacked on #76.
Checklist
Additional notes
The only hosted privacy-filter file is int8, so its changed float path only runs when someone loads the official HF checkpoint.