Repository navigation
core/drafter_release: a versioned drafter release; its taps match a recording's .json and its target adapter is checked against the loaded target - #893
Conversation
…ecording's .json and its target adapter is checked against the loaded target
df98add to
8192fe0
Compare
|
Rebased onto main |
…nst a recording's and its adapter against the target
|
Thank you, @jschmied, for the drafter release format and checks against both the adapter and recorder metadata. We merged the work for 1.1.0 in 479fe72. Our follow-up refuses non-finite or nonpositive The format states that head row r belongs to Posted by Ash's AI Assistant Synthena |
…ed against a recording's and its adapter against the target
…hart#887, in landing order
…n 1.0.12 @jschmied rebased ashhart#893 onto 1.0.12 (b393f8d). Its two commits carry the same changes as the head landed here (44db958), with only the place of the new imports in core/root.zig moved by the rebase; with 59958b8's finite eps and theta and the head rows named by draft_vocab, the tree stays as it was.
…shhart#865), the 27B's K splits (ashhart#887), drafter releases (ashhart#893, ashhart#894), GLM's split check (ashhart#899) and Intel Arc (ashhart#802)
What this changes
Item 1 of #620: a versioned release format for learned drafters. A server can check a release against the target it loaded before it drafts. The tap definition is the one #848's recorder writes.
zig/src/core/drafter_release.zig:config.json, version 1, read strictly (an unknown or missing field, or a newer version, is refused).target: repo, revision, layers, hidden, vocab, and the adapter:embed_scale,tied,softcap,head_bias.taps:ids,stream,normed,dtype,row_bytes. Tap k is the stream after k layers; k = layers is past the last layer, as lanes/recorder: --record writes each stream's committed rows and tapped features for drafter training; Nemotron CUDA gives its final norm's rows #848's Nemotron tap (52).drafter(the block drafter's shape),draft_vocab,weights,servingdefaults.validaterefuses taps that don't rise or run past the layers,row_bytesthat doesn't match taps x hidden x dtype, a drafter width other than the target's, and file names that leave the folder.checkcompares every adapter field with the loaded target's and names the first that differs.checkRecordingreads a recorder.jsonand refuses one whosetaps,row_bytesordtypediffer.parseVocab:draft_vocab.jsonissizedistinct ids below the target's vocab.zig/src/core/drafter_layout.zig: the tensorsconfig.jsonimplies, andRelease.open, which reads a folder whole.target.embed,target.head(the draft vocabulary's rows; none whentied) andtarget.head_bias(whenhead_bias).docs/drafter-release.md: the format, the tensor table, and Kolibri's and Nemotron's adapter values with their sources.The two adapters, from each checkpoint's
config.json, tensor index and forward:embed_scaletiedsoftcaphead_biaslm_head.biasesis the 4-bit offsets)Nothing reads a release at serve time yet. That waits on where the shared drafter lives (item 3).
Receipt
46a08c18(1.0.12) plus this PR's two commits. One DGX Spark (GB10), host tests only..jsonexactly as lanes/recorder: --record writes each stream's committed rows and tapped features for drafter training; Nemotron CUDA gives its final norm's rows #848's recorder wrote it for a Nemotron stream (163 rows, taps[52], 5,376 bytes, bf16). Changing its taps, row bytes or dtype is refused.josch15366/Kolibri-1-block-drafter@4d6cf7be; research only, never shipped) re-exported in this format passesRelease.open: its 64 drafter tensors without the unusedinp.weight, plustarget.embed[128000, 2560] andtarget.head[60614, 2560], and its 60,614-id vocabulary. Checked on a sparse file; the tensors' bytes are not read.zig build test84/84 steps, 1385/1392 tests (7 skipped);mainis 1376/1383.zig fmt --check build.zig zigclean.lean_check.py: 517 findings, as onmain.tied,softcap,head_bias,embed_scale,layers,vocab) are refused, naming the field.softcapleft out of the adapter check;target.headrequired for a tied head;#848's
.jsoncarriestaps,row_bytesanddtype, but notstreamornormed. Here the release states them, and each family defines them once for its tap ids. If you'd rather have the recording say them too, that is a small follow-up on #848.Our Kolibri checkpoint counts taps from 0 (44, 47, 49). In this format the same rows are 45, 48 and 50.
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No serving change.)Questions
.jsonhas taps,row_bytesanddtype, notstreamornormed; the release states those. Should the recorder write them too?.toponly for reply rows and only withlogprobs(k <= 20). Kolibri trained on top-32 for every row; the recipe records the final-norm tap so logits can be made offline instead. Should the recorder write top-k for every row?checkcompares the adapter fields, not the target's repo or revision, so an MLX conversion of the same model passes. Should it also compare those?