Skip to content

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

Merged
ashhart merged 2 commits into
ashhart:mainfrom
jschmied:drafter-format
Oct 18, 2026
Merged

ashhart merged 2 commits into
ashhart:mainfrom
jschmied:drafter-format

Conversation

@jschmied

@jschmied jschmied commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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, serving defaults.
    • validate refuses taps that don't rise or run past the layers, row_bytes that doesn't match taps x hidden x dtype, a drafter width other than the target's, and file names that leave the folder.
    • check compares every adapter field with the loaded target's and names the first that differs.
    • checkRecording reads a recorder .json and refuses one whose taps, row_bytes or dtype differ.
    • parseVocab: draft_vocab.json is size distinct ids below the target's vocab.
  • zig/src/core/drafter_layout.zig: the tensors config.json implies, and Release.open, which reads a folder whole.
    • The release ships target.embed, target.head (the draft vocabulary's rows; none when tied) and target.head_bias (when head_bias).
    • A tensor missing, misshaped, not bf16/f16/f32, or not in the layout is refused.
  • 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:

Kolibri-1 Nemotron 3.5 Lightning (MLX 4-bit)
layers, hidden, vocab 50, 2,560, 128,000 52, 2,688, 131,072
taps 45, 48, 50; normed; bf16; 15,360 bytes 52 (final norm); normed; bf16; 5,376 bytes
embed_scale 1.0 1.0
tied false false
softcap none none
head_bias false false (lm_head.biases is the 4-bit offsets)

Nothing reads a release at serve time yet. That waits on where the shared drafter lives (item 3).

Receipt

  • Environment: TensorFold 46a08c18 (1.0.12) plus this PR's two commits. One DGX Spark (GB10), host tests only.
  • Agreement with lanes/recorder: --record writes each stream's committed rows and tapped features for drafter training; Nemotron CUDA gives its final norm's rows #848: the test parses a .json exactly 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.
  • Our Kolibri drafter checkpoint (josch15366/Kolibri-1-block-drafter @ 4d6cf7be; research only, never shipped) re-exported in this format passes Release.open: its 64 drafter tensors without the unused inp.weight, plus target.embed [128000, 2560] and target.head [60614, 2560], and its 60,614-id vocabulary. Checked on a sparse file; the tensors' bytes are not read.
  • Tests: zig build test 84/84 steps, 1385/1392 tests (7 skipped); main is 1376/1383. zig fmt --check build.zig zig clean. lean_check.py: 517 findings, as on main.
    • Kolibri's and Nemotron's manifests parse, and written back they read the same.
    • 21 manifests outside the format are refused, each naming what is wrong.
    • Six adapter mismatches (tied, softcap, head_bias, embed_scale, layers, vocab) are refused, naming the field.
    • A small release folder opens; a tensor missing, extra or misshaped, a tied head shipped anyway, or a duplicate vocab id is refused.
  • Mutations: each fails the tests:
    • a tap past the layers allowed;
    • equal taps allowed;
    • row bytes sized as bf16 for every dtype;
    • softcap left out of the adapter check;
    • the recording's dtype not compared;
    • a duplicate draft id allowed;
    • an extra tensor allowed;
    • target.head required for a tied head;
    • one spine layer short.
  • Not run, and why: no GPU work, nothing serves a release yet.

#848's .json carries taps, row_bytes and dtype, but not stream or normed. 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

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No serving change.)
  • No precision traded for speed. If the bits change, the description says which sums change and why. (No bits change.)
  • Prompt processing is no slower than the last release. (No serving change.)
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not. (Host tests on Linux aarch64.)
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

Questions

  1. Tap numbering: tap k is the row after k layers, 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 writes it, so the final norm is the layer count. Our Kolibri checkpoint counted from 0 (44, 47, 49 there; 45, 48, 50 here). Keep 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 numbering?
  2. Recorder fields: 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 .json has taps, row_bytes and dtype, not stream or normed; the release states those. Should the recorder write them too?
  3. Top-k per row: lanes/recorder: --record writes each stream's committed rows and tapped features for drafter training; Nemotron CUDA gives its final norm's rows #848 writes .top only for reply rows and only with logprobs (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?
  4. Stored precision: v1 stores bf16, f16 or f32 only. Should FP8 storage of the embedding and head be allowed?
  5. Target identity: check compares the adapter fields, not the target's repo or revision, so an MLX conversion of the same model passes. Should it also compare those?

@jschmied

Copy link
Copy Markdown
Contributor Author

Rebased onto main 46a08c18 (1.0.12), now at 8192fe0d. The only conflict was in core/root.zig imports. The recorder's .json on main still writes the taps, row_bytes and dtype this PR reads; the new fields are ignored. Tests and lint counts in the description are updated.

@ashhart ashhart mentioned this pull request Oct 17, 2026
@ashhart
ashhart merged commit 89a8c30 into ashhart:main Oct 18, 2026
4 checks passed
ashhart added a commit that referenced this pull request Oct 18, 2026
…nst a recording's and its adapter against the target
ashhart added a commit that referenced this pull request Oct 18, 2026
ashhart added a commit that referenced this pull request Oct 18, 2026
…he 27B's K splits (#887), drafter releases (#893, #894), GLM's split check (#899) and Intel Arc (#802)
@ashhart

ashhart commented Oct 18, 2026

Copy link
Copy Markdown
Owner

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 eps and theta, with regressions for overflowing exponents and "inf".

The format states that head row r belongs to draft_vocab[r], including bias and tied-head mappings. Exporters must preserve that order. No serving loader consumes these releases in 1.1.0.

Posted by Ash's AI Assistant Synthena

BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…ed against a recording's and its adapter against the target
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
…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.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
@jschmied
jschmied deleted the drafter-format branch October 23, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants