Repository navigation
Conversation
Merged
6 of 11 tasks
chmjkb
force-pushed
the
@chmjkb/checkpoint-names-tier1
branch
3 times, most recently
from
November 16, 2026 10:11
d6737d9 to
8d5d3a7
Compare
Base automatically changed from
@chmjkb/quant-embeddinggemma2-models
to
main
November 16, 2026 10:14
…vacy-filter's exported scale to it
… like their checkpoints
…weight the encoders read the dtype off
…skill, with an example
chmjkb
force-pushed
the
@chmjkb/checkpoint-names-tier1
branch
from
November 16, 2026 10:15
8d5d3a7 to
89c85f5
Compare
…he whole checkpoint
…BF16 checkpoint's bounds are not read as raw bits Claude-Session: https://claude.ai/code/session_019uvkwiFEsgcU5AJssd6Pjz
chmjkb
marked this pull request as ready for review
November 16, 2026 12:55
6 of 11 tasks
xxpopielxx
requested changes
Nov 17, 2026
| /** Derives what the HF BertModel checkpoint stores differently from the | ||
| * model's parameters, as lazy tensors; nothing is fetched here. Every other | ||
| * tensor binds under its own name, since the modules are named like the | ||
| * checkpoint; the pooler and `position_ids` are left unread. |
Member
There was a problem hiding this comment.
I guess we should still drop the tensors the model never reads (pooler, position_ids, proj_out). The hosted MiniLM and Moonshine Streaming files have them, so every load of a default model logs a warning now.
| // Bind in state-dict (file) order, so each chunk is read once. Module order | ||
| // jumps around the payload and refetches evicted chunks. Keys a transform | ||
| // added sort last; they read nothing new. | ||
| const position = new Map([...sd.tensors.keys()].map((name, i) => [name, i])); |
Member
There was a problem hiding this comment.
Model files download almost twice now: MiniLM f16 fetches 82.5 MB for a 45.4 MB file (45.5 MB on main), because hooks append the fused tensors at the end of the state dict and the loader goes back for chunks it already dropped. Maybe put a derived tensor where its first source sat in the file?
This branch has not been deployed
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
Tier 1 of "modules own their checkpoint layout" (#70): the transformer models in the zoo name their modules exactly like their Hugging Face checkpoints, so their state-dict hooks no longer rename, drop or tie tensors.
loadStateDict({ strict }), PyTorch-style. A tensor in the file that the model doesn't read now gets aconsole.warnlisting it and stays unbound;strict: truethrowsCHECKPOINT_MISMATCHas before. A missing tensor always throws. The progress total counts only bound tensors. No runner passesstrict.RMSNorm.scale→RMSNorm.weight, PyTorch's name. privacy-filter's hostedint8g640file stores the old.scalenames; its detector maps them (renameExportedNormScales).model.encoder.*/model.decoder.*(self_attn,encoder_attn,input_layernorm, ...). The conv stem lives in the encoder as in the checkpoint; Streaming's decoder gets its owndecoder.tsforpos_emb/proj.embeddings.{word_embeddings,position_embeddings,LayerNorm},encoder.layer.N.{attention.{self,output},intermediate,output}.language_model.*,vision_tower.*+embed_vision.*,audio_tower.*+embed_audio.*.Hook files after this, with zero
move()calls left in all four:What's left in them is fusion (q/k/v
concatRows), scale folds, RoPE and conv permutes, and tensors computed on the CPU. Those move into core in tier 2.Introduces a breaking change?
The public API (
create<Task>(),models) is unchanged. Hosted files that carry tensors the model never reads now print one warning per load:embeddings.position_ids,pooler.dense.weight,pooler.dense.biasproj_out.weightRe-exporting those files without the unused tensors removes the warning; that's left for the Hub upload step.
Type of change
Testing instructions
pnpm typecheck && pnpm lint && pnpm format:check && pnpm --filter runntime test:unit(1104 pass)pnpm --filter runntime exec vitest run --project gpu test/zoo test/core/nn test/core/kernels/matmul(427 pass, 3 expected fail that exist on the base too)Checked outside this branch:
int8g640file.Related issues
Part of #70. Stacked on #99.
Checklist
Additional notes
self_attn,LayerNorm); the code-style skill now says so.qkv,kv,qkv_norm,rel,q_scale,pos_x/pos_y) sit under the checkpoint-named parent.