Skip to content

kolibri1: the published EAGLE-3 drafter behind --drafter on CUDA (don't land yet: 8 streams and cold prompts slower) - #3590

Open
jschmied wants to merge 23 commits into
ashhart:mainfrom
jschmied:kolibri1-drafter-lanes
Open

jschmied wants to merge 23 commits into
ashhart:mainfrom
jschmied:kolibri1-drafter-lanes

Conversation

@jschmied

@jschmied jschmied commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

kolibri1: the published EAGLE-3 drafter behind --drafter on CUDA (don't land yet: 8 streams and cold prompts slower)

Closes the ask in #3491. Head b915f8b57f: three commits on your rebase ae1ae12911 (main e209630f74), no rebase
of mine. The head builds as pushed; this round's GPU check ran on its own binary (md5 669e4881). The older exactness rows ran
on 57b037e491's code plus a local envOff fix (binary 1c88dadd), the speed rows on c4f6cc1c. Main 753fb34a28
binary fb0127ea.

This round (review 7175539791).

  • 3d4082026f: Taps.reserve keeps a new device ring in a local with an errdefer until the host written slice
    is allocated too, then publishes both. Test prepare: a failed host allocation leaves no device allocation behind, the new ring included (counting driver, FailingAllocator failing the first host allocation): red on the old
    reserve (expected 0, found 1), green after.
  • ee80198d9e: keep rolls the tap ring's held rows back to the kept length (Taps.keepTo). Before, after verifying
    four rows and keeping two, features could still hand out the rejected rows; the lane contract in
    drafted_test.zig expects RowsNotHeld there. The drafter only asks for the kept prefix, so no served token
    changed. Test keepTo: after a verify of four rows keeps two, the rejected rows are not handed out; with keepTo
    planted as a no-op it fails by name.
  • b915f8b57f: verify calls Taps.kept after both multi-row branches, rounds.forward (graphed, the default) and
    the eager forward; the graph's launches already hold the tap copies. prepare_features drops the round graphs as it
    drops the step graphs, and the round fingerprint holds tap_rows and the tap count (host test kolibri rounds: naming a drafter's taps changes the fingerprint ...).
  • The envOff type error is gone with your rebase (main reads TENSORFOLD_KOLIBRI_GRAPHS as a setting).

The round before (reviews 7153805873, 7154630205). a006fe9015: the target's tap rows are priced and allocated before
the pool plan (memory refusal section below):

  • Taps.prepare now allocates a prompt chunk's tap rows (8,192 rows) and the ring for every slot a round can name
    (64 x 320 rows on pages) when the drafter names its taps, before the server reads its room to plan the page pool.
    Before, the first calibration forward allocated the ring, after the plan.
  • Drafter.Load.tap_rows (taps.heldRows) carries those rows, so Drafter.admit counts them: 314,572,800 bytes of
    ring plus 125,829,120 of tap rows at the production shapes.

Two rounds before (reviews 7107253665, 7118420875).

  • cb9f870663: reserve zeroes the EAGLE-3 caches right after x.e.reserve, before the step and hold timing passes,
    and again after them (clearCaches).
  • 7a792d46d5: row_costs.time times only the widths the target's slots can take (widthsFor: 16 rows a slot) and
    returns the count, so --parallel 1, 2 and 3 open instead of returning TimingSlots. The early memory check
    takes a Drafter.Load (below) and counts the final allocation before the drafter allocates anything.
  • 57b037e491: the recipe pins the drafter at its full revision with the release's own licence, and gets this
    round's speed rows.

Don't land yet. abba5.py (noise floor from 3 A-vs-A rounds, then 5 rounds of A-B-B-A, one fresh server a run),
main's copy drafts against --drafter: c=1 FASTER +27.9 %, c=4 FASTER +4.1 %, served defaults at c=1 FASTER
+32.1 %, but c=8 SLOWER -1.9 % (5 of 5 rounds, floor 1.4 %) and the cold first token of a 7,900-token prompt
SLOWER -41.8 % (3.64 -> 5.16 s, 5 of 5). Both slow cells come from the drafter's absorb pass (speed section).

What

--drafter DIR loads josch15366/Kolibri-1-EAGLE3-drafter (revision 6430e5dc7453dd4ea57022a4cde46178afe89094,
Apache-2.0 per its model card) on CUDA through the lane core's Drafter/Drafted. It is off unless asked. Every draft is verified by the target, so replies are token for token those without it.

The two published releases predate #893's format v1:

  • taps are 0-based (44/47/49 = format ids 45/48/50);
  • there is no target embed/head in the file;
  • EAGLE-3 names its layer blocks.0.* and stores f32 norms;
  • the block release carries an unused inp.weight.

core/drafter_published.zig reads both into a v1 release.Config under the same validate/check/parseVocab/weight checks. docs/drafter-release.md gains a "Published before version 1" section.

Code sharing:

  • core (host, any backend):
    • drafter_release.zig: eagle3 architecture, most_chain.
    • drafter_layout.zig: Names, checkWeightsNamed.
    • New drafter_published.zig with tests.
  • cuda (backend, any family): new cuda/eagle3.zig. It runs EAGLE-3 absorb (every stream's rows in one pass) and chain (every stream's step in one pass) on the shared operators only: dense_rows, norms, qk_rows, window_attention.decode, act_rows.swiglu, embed_rows, tf_argmax_rows_i32, tf_f32_to_bf16. No new kernels, no .cu changed (git diff a1781885e9..HEAD -- '*.cu' is empty), so the kernel contract does not apply. Fatbins compared head vs main: 115/115 identical.
  • kolibri1 (family):
    • taps.zig: a tap ring per stream, read as Features.
    • forward.zig: tap copies after layers 44/47/49.
    • backend.zig: prepare_features/features.
    • drafter.zig: upload, slots, the vtable.
    • native.zig: open/reserve/refusals.
    • drafter.zig admit: the memory refusal from the release's config, before anything is allocated.
    • drafter.zig timeHolds: the hold pass by streams and depth (Facts.hold_costs).
    • row_costs.zig: round costs for the depth rule, over the widths the served slots hold. It uses lanes.cost_rule.fastest/smooth, as the other families time theirs; the lane core has no shared startup timer.
    • kernels.zig: the 16-row split below.
  • lanes (core, any backend): shared_drafts.zig payPass (above).
  • native (CUDA host, any family with --drafter): cuda_drafted.zig Served.reserve re-reads the drafter's facts.
  • Metal: Kolibri has no Metal family; the core reader and the lane change are backend-neutral.

Graphed rounds: the stale-row case (receipt)

Measured before your rebase, on my local merge with main 82c4e6cce3, whose Kolibri code equals this head's apart from
tests. GB10, --drafter at --parallel 1/2/3, the gate above. Both merge binaries carry a local-only log line with the
round cache's outcome counts, so the receipt shows the graphs replayed and nothing fell back to eager:

binary result round graphs (last count)
merge + this round's fixes (237cfeac) drafted == plain greedy and seeded, N streams == solo, 0 empty, tokens a round 2.06 / 2.07 / 2.10 replayed 1456 / 1257 / 1143, captured 10 / 22 / 33, eager 0
plain merge, no tap update after a graphed round, as ae1ae12911 (2df05105) the first drafted round fails: a round failed (RowsNotHeld), HTTP 500 replayed 0, captured 1, eager 0
the same plain merge with TENSORFOLD_KOLIBRI_GRAPHS=0 (eager rounds, 2df05105) drafted == plain greedy and seeded, N streams == solo, 0 empty, tokens a round 2.07 / 2.07 / 2.06 no round graph used

So only the graphed round lost the ring update. The eager path already had it.

Exactness (GB10, binary 1c88dadd = 57b037e's code + the local envOff fix, main 753fb34 binary fb0127ea)

Every reply is hashed as reasoning_content + content + token ids; an empty reply FAILs. 24 prompts (chat, German,
code), 128 tokens. parity_controls.py on the base server (main, copy drafts) and on the head with --drafter:
CONTROLS: PASS (4 prompts, seeds differ on 4) both.

check result
drafted == plain ("draft": false), greedy / seeded true / true
c=4 == solo, c=8 == solo (greedy), c=8 == solo (seeded) true, true, true
resumed == fresh (multi-turn, prompt cache on vs off) true (12 resumed hits vs 0)
copy-only head == drafted == main (both default paged caches) true, hash 293d716e74b701a6, 24 distinct, 0 empty
--parallel 1, 2, 3 with --drafter: opens, drafted == plain greedy and seeded, N streams == solo true for each; round costs timed over 1/2/3 slots up to 16/32/48 rows; rerun on a006fe9015's code (binary bde0ae6c, tap ring made at open) and on the head b915f8b57f as pushed (binary 669e4881, default round graphs, tokens a round 2.06 / 2.07 / 2.07): true for each
tokens a round, drafted vs plain 2.10 vs 1.008

Host on the GB10 on the head b915f8b57f as pushed (test-kolibri-host check-native-cuda-host test-gradient-serving -Dfixed-cpu): 18/18 steps succeeded, 42/43 tests passed (1 skipped). Earlier: host on b016588cce (the head's code before a comment join) + the local envOff fix (test-kolibri-host check-native-cuda-host test-gradient-serving -Dfixed-cpu): 16/16 steps succeeded, 35/36 tests passed (1 skipped).
Planted controls: the old memory accounting, and a calibration that needs four slots, fail the three new or changed
tests by name.

Refusals (by name, at load, server never serves)

case message
block-drafter release a block-drafter release; Kolibri-1 on CUDA serves eagle3 releases (DrafterArchitectureNotServed)
vocab draft_vocab.json has 32768 ids; config.json says 32767
target the release drafts for Aleph-Alpha/Kolibri-2; the loaded target is Aleph-Alpha/Kolibri-1
layout blocks.0.gate.weight is { 4096, 2560 }; config.json implies { 4608, 2560 }
--drafter-bits 8 the CLI refuses it (invalid choice) before load. Kolibri takes 0 or 4, both bf16 as published. Kolibri's own DrafterBitsUnsupported is therefore not reachable from the CLI.
a stream opened before the drafter TapsAfterStreams
too little device memory DrafterPastMemory: --drafter DIR: needs N GiB of device memory for S streams and a timing slot, the target's taps T GiB and the first stream's window W GiB; the budget leaves M GiB
backend without Kolibri no Kolibri family outside CUDA, so no --drafter path to refuse

The host tests in drafter_published_test.zig cover the layout, target, vocab and v1-not-published refusals in the reader, which runs before anything is allocated.

Memory refusal, counted on the final allocation. Drafter.admit (kolibri1/drafter.zig) takes a Load and runs
before the drafter allocates anything; it takes numbers only (its type is checked in the test), no allocator or device:

  • weights as upload puts them: 348,813,568 bytes; scratch: 70,528,256 bytes (Dims.scratchBytes, the size list
    Eagle3.init allocates from);
  • drafter caches: (S + 1 timing slot) x Dims.streamBytes() (24,253,440 bytes each), where S is what reserve will
    make: every stream's on linear caches; with a fixed --parallel N on pages, N; with auto on pages, 1, since the
    page plan pays each later stream's drafter slot as part of its fixed bytes;
  • on pages, the first stream's target window (pages(window + 16) x pageBytes), which the plan sets aside after;
  • the target's taps for the drafter (a006fe9015): a prompt chunk's tap rows and a ring for every slot
    (taps.heldRows: 8,192 + 64 x (256 + 64) rows on pages, each 3 taps x 2,560 bf16), 440,401,920 bytes.

The first stream's drafter slot and the timing slot, which the server's stream plan does not count, are now allocated
at open, so the room the server reads already excludes them; reserve grows to N + 1 later. Tests:
the drafter's device bytes come from its config alone; one byte short refuses by name, nothing allocated and
DrafterPastMemory: --parallel 8 on pages counts 9 drafter slots and the first window, nothing allocated before (one
byte short refuses; the old one-stream accounting let that budget through), and
DrafterPastMemory: the target's tap ring for 64 paged slots and a prompt chunk's tap rows count, one byte short
(one byte short of 4,299,250,176 refuses, exactly that admits; the same budget without the taps is admitted at
3,858,848,256). Planted control: admit without the tap term fails that test by name (expected error.DrafterPastMemory, found 3858848256). The tap rows and ring are now allocated in prepare_features, inside
--drafter's open, so the room the server reads for the page pool already excludes them; the first calibration
forward finds the ring made.

Speed: main's copy drafts vs --drafter (abba5, each stream count first on fresh servers)

SPEED=speed5.py python3 abba5.py compare OUT main head --rounds 5, one job per stream count. Every run is a fresh
server (page cache dropped before each start, GPU clock cap as always, --parallel 8) that measures only that stream
count: 24 prompts, 256 tokens, greedy, a distinct prompt per stream. A warm-up per arm, a noise floor from 3 A-vs-A
rounds, then 5 rounds of A,B,B,A; a round's value is each arm's mean of two runs. Replies equal across all runs of both
arms in every cell (TOKENS: EQUAL).

streams main tok/s, rounds 1-5 --drafter tok/s, rounds 1-5 gap by round verdict (median, floor, rounds worse) tokens a round
1 51.05 50.98 51.49 51.46 51.42 65.11 65.24 65.85 65.29 65.75 +27.5 +28.0 +27.9 +26.9 +27.9 % FASTER +27.868 %, 0.622 %, 0 of 5 1.073 -> 1.97
4 108.67 108.21 107.94 109.25 109.60 112.44 112.72 112.97 113.72 114.14 +3.5 +4.2 +4.7 +4.1 +4.1 % FASTER +4.141 %, 0.391 %, 0 of 5 1.073 -> 1.63
8 139.25 139.72 138.95 137.50 140.16 136.65 137.19 137.02 134.77 136.80 -1.9 -1.8 -1.4 -2.0 -2.4 % SLOWER -1.866 %, 1.401 %, 5 of 5 1.073 -> 1.66

| 1, served defaults (seed 7+i, 8 prompts) | 52.32 52.26 52.84 52.79 52.70 | 69.63 69.53 69.73 68.83 69.62 | +33.1 +33.0 +32.0 +30.4 +32.1 % | FASTER +32.115 %, 0.789 %, 0 of 5 | |
| cold first token, 7,900-token prompt, s | 3.640 3.637 3.638 3.636 3.637 | 5.160 5.155 5.175 5.159 5.152 | -41.8 -41.7 -42.2 -41.9 -41.6 % | SLOWER -41.766 %, 0.502 %, 5 of 5 | |

Verdict lines as printed: VERDICT c1_tok_s: FASTER (median 27.868%, floor 0.622%, B worse 0 of 5),
VERDICT default_c1_tok_s: FASTER (median 32.115%, floor 0.789%, B worse 0 of 5),
VERDICT ttft_cold_8k_s: SLOWER (median -41.766%, floor 0.502%, B worse 5 of 5), VERDICT c4_tok_s: FASTER (median 4.141%, floor 0.391%, B worse 0 of 5),
VERDICT c8_tok_s: SLOWER (median -1.866%, floor 1.401%, B worse 5 of 5).

The cold prompt (7,899 tokens by the server's own log, 45 of them the cached template head; one nsys round, one token out, head without and with --drafter): GPU
kernel time 3,606 ms vs 5,116 ms. Of the +1,510 ms, tf_dense_rows_32 takes +1,409 ms (236 launches vs 50) and
tf_window_decode_tc +86 ms: the drafter absorbs every prompt row through the row kernels, 32 rows a tile, about
0.19 ms a row. The target's prompt pass is unchanged (qmmf and expert kernels within 4 ms). Short prompts pay the
same rate (a 652-token prompt: 0.37 -> 0.49 s to the first token in the speed runs).

What c=8 shows. Measured on 5e0d06bd81 (7027914287) with holds forced off: a loaded drafter costs 3.9 % at
c=8 through its absorb pass (about 1 ms a round, reading its ~181 MB of weights), and skipping that pass brings it
level with main. This round changed reserve and calibration only, not the absorb path, so that cause stands; the
lazy-absorb/catch-up design sketched in 7063086063 is waiting for your agreement. Both slow cells point at absorb: a
fix for the prompt would absorb only the prompt rows the drafter's attention window can still read, and absorb long
runs through a prefill-shaped GEMM. I have not built either; both change the drafter's state path, so I'd like your
call first.

The 16-row split, and copy-only vs main (three checks, run in the previous rounds on main 699094f705)

nsys over a short c=8 run, before the split. The GPU is busy for the whole wall time in both arms.

per round copy-only drafted
MoE experts 33.8 ms 53.0 ms
target lm_head 3.0 ms 15.4 ms
the whole drafter none about 4 ms
  • Rows 17..32 take dense_rows' 32-row tile. On Kolibri's 128000 x 2560 head that tile runs 5x slower than two 16-row launches (25.2 ms past 32 rows).
  • kernels.zig now launches the router and head in 16-row tiles for 17..64 rows (split_rows = a round). That moved c=8 from -6.2 % to -2.3 %.
  1. Bytes. tile_eq.cu builds the repo's dense_rows.cu and compares the fp32 output bytes of one 32-row launch (main) against the 16-row launches (this branch) at every m in 17..64, on the head (128000 x 2560) and router (384 x 2560) shapes with random bf16. Result: 0 of 48 row counts differ for both shapes. The planted control (one flipped input) is caught for both. The final reply hash == main's stays in the gates above.

  2. Prompt. Prompt chunks (> 64 rows) keep one launch. Cold prompts, max_tokens 1, a fresh first line per request, median of 3, A-B-B-A against main 699094f705 (default paged caches), binary eba82984 (0a0cc7504c, the previous round; this round leaves the copy-only path as it was):

    prompt main (s) head (s) change
    2,319 tokens 1.052 / 1.051 1.049 / 1.059 +0.2 % (ranges overlap)
    8,932 tokens 4.186 / 4.184 4.185 / 4.181 -0.0 %
    28,079 tokens 14.483 / 14.461 14.504 / 14.453 +0.0 % (ranges overlap)
  3. Copy-only, served by default, vs main 699094f705 (same A-B-B-A, 256 tokens, the same replies on all four servers, 244929b4d290cead):

    streams main tok/s head tok/s change pairs slower A/A (main, head)
    1 51.76 / 51.79 51.54 / 51.76 -0.2 % 2 of 2 0.1 %, 0.4 %
    4 120.15 / 120.43 119.40 / 120.07 -0.5 % 2 of 2 0.2 %, 0.6 %
    8 156.41 / 156.84 156.39 / 157.41 +0.2 % 1 of 2 0.3 %, 0.7 %

    Copy-only c=1 and c=4 come out 0.2 % and 0.5 % below main in both pairs. Both are inside the head's own A/A spread (0.4 %, 0.6 %). Copy rounds rarely pass 16 rows, and without --drafter no taps are copied, so the copy-only path rarely differs from main at all. On the old base the same check read -0.6 / -0.2 / +0.5 %.

The lane core change, and its tests

shared_drafts.budgets (zig/src/core/lanes/shared_drafts.zig): payReserved runs under granted_depth as before;
otherwise, when the drafter gave hold_costs, the new payPass sets each head's reserved depth as the hold to price
(its rows and the chances it expects to keep) and calls Rule.payHoldsFor / payHolds. That keeps holds, most
expected tokens a row first, while they raise tokens a ms over the round without them. No new pricing code. With
hold_costs empty (every family but Kolibri's drafter today) the branch is not taken.

  • shared_hold_pass_test.zig (step test-hold-pass-host): four streams, three drafts at 0.8 a depth. A pass of 2 ms
    keeps 3,3,3,3; a pass of 60 ms gives 0,0,0,0 (copy rounds); no hold_costs keeps the legacy 3,3,3,3.
  • cuda_drafted.zig test: a drafter untimed at open and timed at reserve; the served facts carry its step (1.5 ms),
    hold costs and window costs after reserve, and the rest as the drafter set it.
  • Planted controls, both red before green: with payPass disabled the "dearer" test fails (expected 0,0,0,0); with
    the re-read in Served.reserve disabled the cuda_drafted test fails at cuda_drafted.zig:155.

Default path (no --drafter): your GB10 run on 818c7df81a is GREEN. Since then, rebase aside, the default path's code
is the same: payPass needs hold_costs (only Kolibri's drafter sets them), Served.reserve's re-read needs a drafter
(held is null without one), and kolibri1/drafter.zig loads only with --drafter. The copy-only head's replies
equal main's (gate above). This round's speed rows measure against main's own binary; the head's copy-only timing
rows were not re-run.

x86 lane

This round, on the head b915f8b57f as pushed, x86 box, the targeted set for its changed files: 75/75 steps, 512/521
tests passed (9 skipped); check-native-cuda-host compile-cuda-tests 21/21; tools/pr_check.py --base e209630f74 --pr 3590 0 errors (lean 123 vs 123, 0 new); zig fmt --check and git diff --check clean.

Earlier, the full set on d7f1259577 (local, not on the branch: 7a792d46d5's code before the comment join) plus the local envOff fix, x86 box:

step result
-Dfixed-cpu test-host test test-golden test-kernel-contract test-server-security test-pull-security fuzz-cortheon check-release-paths 2455/2455 steps succeeded, 24717/24875 tests passed (158 skipped, 0 failed)
check-native-cuda-host compile-cuda-tests 17/17 steps succeeded
zig fmt --check, git diff --check clean
tools/pr_check.py 1 lean finding: a two-line doc comment in kolibri1/native.zig drafterLoad

The finding is fixed in 7a792d46d5 (one-line comments, same lines otherwise). tools/pr_check.py --base 753fb34a28
on the head: 0 errors, lean 164 vs 165, 0 new; 1 advisory warning (the Unreleased line, which is yours to place).

Not in this PR

  • Serving the block drafter (Kolibri-1-block-drafter, context keys, mask row, spine, predecessor head) is a stacked follow-up. It is not started. Its release is read and checked by core here and refused on CUDA by name.
  • atc overlap: incomplete (ATC 0.9.5 read limits). Shared files with open PRs are only zig/src/core/root.zig, zig/src/cuda/root.zig and zig/tests/fixtures/gradient-serving.tsv (cuda/root.zig re-pinned: cuda.eagle3 exported). No shared code paths. Your rebase put the branch on main e209630f74; I have not rebased.

Proposed CHANGELOG line (you said you will add it; no CHANGELOG commit here):
- kolibri1: \--drafter` serves the published Kolibri-1 EAGLE-3 drafter on CUDA through the lane core (off unless asked; replies unchanged), and a round's router and head launch in 16-row tiles; the lane core prices a drafter's timed hold pass under a legacy cap.`

@ashhart

ashhart commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied, this is careful work. The receipts in the body make it easy to review.

What's good:

  • The drafter only proposes tokens. Every draft is verified by the target, and your gates on b85064572f show drafted == "draft": false (greedy and seeded), c=4/c=8 == solo, and resumed == fresh.
  • The format work is clean. core/drafter_published.zig reads the two published releases (0-based taps, blocks.0.*, f32 norms, the unused inp.weight admitted by name) into a v1 Config. It then runs the same validate/check/parseVocab/weight checks, and the host tests name each refusal.
  • cuda/eagle3.zig uses only shared operators, with no new kernels and no .cu changes.
  • The 16-row split in kolibri1/kernels.zig:169 is byte-equal by construction. dense_rows.cu sums each row in a fixed lane order and shuffle tree whatever the tile (dense_rows.cu:3, :23), and your tile_eq check agrees. The copy-only and prompt tables stay within the A/A spread.
  • Lean count is unchanged at 221. zig fmt --check is clean, and every touched file is under 600 lines (forward.zig 544 after moving its tests to forward_test.zig).

Must fix:

  1. Rebase on current main. Patch 8/9 (docs) no longer applies to README.md: main changed the Flint row right above the Kolibri row (Flint's --drafter), so the Kolibri row's context no longer matches. Your Kolibri line itself is fine.
  2. kolibri1: tree-attention cache offsets are signed, so a cache placed below the origin no longer overflows #3561 has landed on main. This branch still carries its commit (kolibri1: tree-attention cache offsets signed), so please rebase onto main and drop that commit, leaving only the drafter in the diff.
  3. 8 streams. As you say, --drafter is 2.3 % slower than copy drafts at c=8 (155.9 vs 159.6 tok/s). Your proposal to feed Facts.hold_costs from the drafter's timed pass is new lane-core use and needs a maintainer decision. We'll answer it in this thread. Until then, this stays as you marked it: not ready to land.

Optional:

  • openDrafter (kolibri1/native.zig:166) refuses below a fixed 1 GiB. Computing the need from Dims.streamBytes() and the scratch sizes would make the refusal exact.
  • After the rebase, please re-run the exactness gate and the c=1/4/8 speed table at the new head. The speed rows are from d518aef05b, and row_costs.zig changed after that.

We have two small commits of our own ready, with no behaviour change, and will add them on top once the branch is rebased: one moves a comment in native.zig to its own line to fit 120 columns and rewraps one paragraph in docs/drafter-release.md; the other adds your proposed CHANGELOG line under ## Unreleased.

Device check: GB10 (CUDA), exactness and speed with and without --drafter. We will run the device check on our side.

  • Synthena

@jschmied jschmied changed the title kolibri1: the published EAGLE-3 drafter behind --drafter on CUDA (don't land yet: 8 streams 2 % slower) kolibri1: the published EAGLE-3 drafter behind --drafter on CUDA (don't land yet: 8 streams 1.2 % slower) Nov 17, 2026
@jschmied
jschmied force-pushed the kolibri1-drafter-lanes branch from b850645 to 818c7df Compare November 17, 2026 09:41
@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart Thanks. Rebased on main 699094f705; the new head is 818c7df81a. Per item:

Must fix

  1. README: main's Flint row (with --drafter) is kept; the Kolibri line below it is ours. The branch applies cleanly on main.
  2. kolibri1: tree-attention cache offsets are signed, so a cache placed below the origin no longer overflows #3561: its commit (6aee167ed8) is dropped; main has it as 004fba2c87. The diff is the drafter only. The old head b85064572f stays reachable on my side.
  3. 8 streams: still slower, 1.2 % (157.6 -> 155.7 tok/s, both A-B pairs slower). It stays "don't land yet". I built nothing for hold_costs; that is your call.

Optional

  • openDrafter: the fixed 1 GiB is gone. Drafter.admit computes the need from the release's config before anything is allocated: weights 348,813,568 bytes, scratch 70,528,256 (the same size list Eagle3.init allocates from), and (streams + 1 timing slot) x streamBytes() 24,253,440. That is 0.44 GiB with one stream. The refusal keeps its name, DrafterPastMemory. A new host test checks the numbers on the published config, and one byte short refuses by name. admit takes no allocator and no device, and a planted wrong constant fails the test.
  • Re-run after the rebase:
    • Exactness, on the head itself (binary 20f4ef09): drafted == "draft": false greedy and seeded, c=4/c=8 == solo, resumed == fresh, copy-only head == drafted == main. All true, 0 empty. Main now serves with paged caches, so KV_PAGES=0 is gone from the reference.
    • Speed, A-B-B-A, same replies on all four servers (on the same code before three comments were joined into one line): c=1 +29.0 %, c=4 +6.1 %, c=8 -1.2 % (2 of 2 pairs slower). A/A at most 1.0 %. These rows replace the d518aef05b ones in the body and in docs/recipes/kolibri-1.md.
    • Copy-only vs main: c=1 -0.2 %, c=4 -0.5 %, c=8 +0.2 %, each inside the head's own A/A spread (up to 0.7 %). Cold prompts at 2k/8k/28k tokens: +0.2 %, 0.0 %, 0.0 %.
    • Host: test-kolibri-host and test-cuda-host pass, zig fmt --check is clean, and every touched code file is under 600 lines (drafter.zig 372). x86 lane on the head: fmt, gradient-serving, CUDA host compile and pr_check are clean (lean 221 vs 221). The only failures are the known cli_config_test umask ones, as before.

Your two commits can go on top. The fixed-1 GiB line in native.zig is gone, so your comment move there may no longer apply; the new line is 117 columns. The proposed CHANGELOG line is in the body; there is no CHANGELOG commit.

@ashhart

ashhart commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. Our GB10 run on this head (818c7df81a) against main is GREEN for the default path: without --drafter, tokens are equal on every prompt row, and the prefill, sweep and chat cells are all level with main.

On the 8-stream question we owed you: yes, please feed Facts.hold_costs from the drafter's timed pass. The drafter only proposes, and the target verifies every token, so letting the lane core price a drafter round against a copy round changes which draft source a round uses, never the tokens. What we need for landing:

  1. With --drafter, c=1, c=4 and c=8 each no slower than copy drafts on the same head (A-B-B-A as before). At c=8 that means the lane core falls back to copy drafts when the drafter's round costs more.
  2. The same exactness gates as your last run: drafted == "draft": false (greedy and seeded), c=4/c=8 == solo, resumed == fresh.

A faster opt-in path that is slower in any cell doesn't land with us, so (1) is the bar. Once you post those, we'll run the --drafter cells on a GB10 too.

  • Synthena

@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart Thanks. Done; the new head is 68fda81392 (three code commits and one docs commit on 818c7df81a, no rebase,
merges cleanly with main). Still don't land yet: c=8 on a fresh server is 1.6 % slower (details below).

What changed

  • The lane core prices the drafter's round. With limit_shared_drafts and Facts.hold_costs, shared_drafts sets
    each head's reserved depth as the hold and calls Rule.payHoldsFor, the granted path's existing costing. A hold is
    kept only while it beats the round without the drafter's pass. That changes draft sources, never tokens.
  • Kolibri times the hold pass at reserve, by streams and depth: 0.68 / 1.93 ms with one stream, 0.83 / 2.42 ms with 8
    (depth 1 / 2).
  • A bug this turned up: cuda_drafted.wrap read the drafter's facts at open, before Served.reserve timed it. So on
    818c7df81a the rule had no prices at all (TF_SHARED_PRICE_LOG=1: shared_ms= empty, step_ms=0.000). The
    earlier round-cost and limit_shared_drafts commits did nothing while serving. Served.reserve now re-reads the
    drafter's facts after its reserve. Without --drafter that code is not reached.

1. Speed (binary 717d8777 = c83e9b40e2)

A-B-B-A as before: each server runs c=1, then c=4, then c=8. Same replies on all servers, 0 empty.

streams copy tok/s --drafter tok/s change paired slower
1 51.63 / 51.57 67.14 / 66.62 +29.6 % +30.0, +29.2 % 0 of 2
4 119.71 / 119.48 126.71 / 125.95 +5.6 % +5.9, +5.4 % 0 of 2
8 156.68 / 156.48 157.23 / 156.20 +0.1 % +0.35, -0.18 % 1 of 2
8, first on a fresh server 142.58 / 142.49 / 142.37 / 144.05 140.25 / 140.34 / 140.05 / 139.68 -2.0 % median -1.63 % 4 of 4
  • A/A spread: 0.1 / 0.2 / 0.1 %, and 1.2 % in the fresh-server row.
  • The fresh-server row was run A-B-B-A-A-B-B-A with c=8 only, so 5,877 of the 7,021 prompt tokens are not cached.
    In the run as before, c=8 comes after c=1 and c=4 have cached the prompts.
  • The servers' own per-request elapsed sums are about 1.7 % lower with the drafter, but the batch's wall clock is
    longer. I have not found the cause.

2. Exactness (same binary): all true, 0 empty.

  • drafted == "draft": false, greedy and seeded
  • c=4 == solo and c=8 == solo (greedy), seeded c=8 == solo
  • resumed == fresh (12 resumed hits vs 0)
  • copy-only head == main == drafted, hash 68821bb6df05e8d4, the same as on 818c7df81a

Tests

  • Host test test-hold-pass-host: a 2 ms pass keeps 3,3,3,3; a 60 ms pass gives 0,0,0,0 (copy rounds); no
    hold_costs keeps the legacy cap.
  • A cuda_drafted test checks that the served facts carry what the drafter timed at reserve.
  • Both planted controls go red: payPass off, and the re-read off.
  • x86 lane: green, apart from the known cli_config_test umask failures. pr_check: 0 errors.

Default path: your GREEN run on 818c7df81a still covers it. Since then the code without --drafter is unchanged:
the new branch needs hold_costs, and the re-read needs a drafter. Copy-only replies equal main's.

Not run

  • Copy-only timing rows on this head.
  • c=1 and c=4 first on a fresh server.
  • An A/B of the hold price alone: 17 of 383 c=8 rounds dropped the drafter's pass, and most of the c=8 change comes
    from the round costs reaching the rule at all.

The proposed CHANGELOG line is in the body; there is no CHANGELOG commit.

@ashhart

ashhart commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Thank you @jschmied for the hold-cost rule and for re-running the exactness gates. Drafted replies still equal plain replies, and copy-only still matches main.

The bar we set was no slower in any cell. On a fresh server at c=8 your four drafter runs are all slower, by about 1.6% at the median, so that cell is still open. Could you run c=1, c=4 and c=8 first on fresh servers with A-B-B-A, on a head rebased on current main? The two Zig files and the README recipe do not apply at this head.

  • Synthena

@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. The hold-cost plumbing, reserve-time facts and exactness receipts answer those asks. The fresh-server eight-stream slowdown remains open. Please rebase on current main, preserving its test registrations and moved model documentation, then post A-B-B-A runs with one, four and eight streams each first on fresh servers. The same exactness gates still apply.

  • Synthena

@jschmied
jschmied force-pushed the kolibri1-drafter-lanes branch from 68fda81 to 5e0d06b Compare November 19, 2026 07:10
@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart Thanks. Rebased and re-run; the new head is 5e0d06bd81 on main a1781885e9 (merges cleanly with
6db2561b18). Still don't land yet: c=8 is 1.9 % slower, 4 of 4 pairs.

Rebase. The 14 commits are cherry-picked; code unchanged. Main's test registrations are kept in
lane_halt_host.zig and lanes/depth.zig, with ours added after them. The model row is now in
docs/supported-models.md ("EAGLE-3 drafter with --drafter"); README.md is main's.

Speed. Binary a25b535a (a2b65eb471) vs main a1781885e9 (56beeffc, copy drafts). One job per stream count,
each A-B-B-A-A-B-B-A on 8 fresh servers (page cache dropped before each start), running only that count. 24 prompts,
256 tokens, greedy. All 24 servers give the same replies (7b07ae66909cccc2), 0 empty.

streams main tok/s --drafter tok/s paired median slower
1 51.21 51.11 51.25 51.36 65.30 65.09 64.92 65.04 +27.5 +27.4 +26.7 +26.6 % +27.0 % 0 of 4
4 109.03 110.30 109.63 109.35 114.45 113.65 114.85 115.47 +5.0 +3.0 +4.8 +5.6 % +4.9 % 0 of 4
8 141.46 141.66 142.26 142.53 138.05 140.70 139.47 139.97 -2.4 -0.7 -2.0 -1.8 % -1.9 % 4 of 4

A/A spread: 0.5 / 1.2 / 0.8 % (main), 0.6 / 1.6 / 1.9 % (drafter).

The c=8 cause is visible. The servers' own elapsed sums are about 1.4 % lower with the drafter, but the batch
waits on its slowest stream. Per-request elapsed at c=8: main max 15.1 s (std dev 1.7 s), drafter max 18.6 and
20.5 s (std dev 2.9 and 3.1 s). Rounds are shared, so a stream whose drafts rarely land still waits for the larger
drafted round. The depth rule prices tokens a ms over all streams, so it keeps those rounds. A fix would be a
per-stream bound in the lane core (no stream's expected rate below its copy-round rate). That is a core change, so
I would like your call before I build it.

Exactness (same binary): all true, 0 empty.

  • drafted == "draft": false, greedy and seeded
  • c=4 == solo, c=8 == solo (greedy), seeded c=8 == solo
  • resumed == fresh (12 resumed hits vs 0)
  • copy-only head == main == drafted, hash 293d716e74b701a6 (new base; was 68821bb6df05e8d4)

Tests. GB10 host (kolibri, cuda, hold-pass, shared-price-learning, lane-api): 434/434 steps, 0 failed. x86 lane:
green apart from the known cli_config_test umask failures; pr_check 0 errors, lean 221 vs 221.

The body names the new head; the proposed CHANGELOG line is in it, no CHANGELOG commit.

@ashhart

ashhart commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied for the clean rebase keeping lane_halt_host.zig, lanes/depth.zig, and docs/supported-models.md aligned with main, and for the fresh-server runs and per-request latency breakdown at eight streams.

The c=8 regression (-1.9%, 4 of 4 pairs slower) still blocks landing, and your diagnosis makes sense. Please go ahead and add the per-stream rate bound in the lane core so no stream's expected rate drops below its copy-round rate (with host tests for the new guard), then re-run fresh-server A-B-B-A at c=1, c=4, and c=8 alongside the exactness gates on the updated head. Once all three stream counts are at or above copy drafts, we will run the --drafter checks on a GB10.

  • Synthena

@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart Thanks. I built the per-stream bound and measured it. It makes things worse, so I have not pushed it.
Don't land yet. The PR head stays at 5e0d06bd81.

What the bound does (local commit 9df247eef8): payPass keeps the drafter's holds in a round only when every
live stream holds one and each stream's expected tokens per ms, with the pass, are at least its copy round's
(Rule.payHoldsBound in core/lanes/depth.zig). Otherwise the round takes copy drafts. There are two host tests in
test-hold-pass-host (21/21). With the guard planted off, hold pass: bound: a stream left without a hold would wait on the others' pass, so none holds fails by name.

Exactness on that binary (c07935ad): all true, 0 empty. drafted == plain (greedy and seeded), c=4/c=8 == solo,
seeded c=8 == solo, resumed == fresh (12 hits vs 0), and copy-only head == main == drafted. Hash 293d716e74b701a6,
the same as before.

Speed. Fresh servers, A-B-B-A-A-B-B-A, each stream count run alone; A is main a1781885e9 (56beeffc) with copy
drafts. 24 prompts, 256 tokens, and the same replies on every server (7b07ae66909cccc2):

streams main tok/s bound tok/s paired median slower
1 51.44 51.65 51.51 51.55 65.16 65.20 65.52 65.95 +26.7 +26.2 +27.2 +27.9 % +26.9 % 0 of 4
4 110.58 110.17 109.85 109.56 109.62 108.65 107.64 105.77 -0.9 -1.4 -2.0 -3.5 % -1.7 % 4 of 4
8 140.03 139.99 140.61 141.19 136.20 135.38 135.84 136.04 -2.7 -3.3 -3.4 -3.6 % -3.3 % 4 of 4

Without the bound, the current head gives +27.0 / +4.9 / -1.9 %. So the bound costs about 6.6 points at c=4 and
1.4 points at c=8.

Why. The bound does stop most drafting: tokens per round fall from 1.62 to 1.16-1.19 at c=4, and from 1.65 to
1.19-1.20 at c=8 (main: 1.07). Even so, these servers are slower than main. A loaded drafter seems to cost about 3 %
a round even when the round holds nothing. I have not proven this; my suspicion is the absorb pass, which runs every
round. The bound prices a copy round as if that cost were absent, so falling back to copy drafts cannot reach main's
rate.

Next. A fix has to make a copy round under --drafter as cheap as one on main. One way is to skip the absorb on
rounds without holds and catch up before the next hold. I will measure that cost first (the same server with
--drafter and holds forced off), then come back with the design before building it.

Tests on the bound commit. On the GB10 host: 434/434 steps. On x86: fmt 0, and gradient and cuda are green;
host/full fail only cli_config_test (the known umask failure). pr_check raised one lean finding (a two-line doc
comment), which is fixed in 9df247eef8.

@ashhart

ashhart commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied for measuring the bound and keeping the worse experiment off the PR. The rebase, hold-cost plumbing, reserve-time facts and reported exactness checks answer the earlier asks, but the published head still loses at eight streams. Please share the isolated cost measurement with a loaded drafter and no holds, then the proposed absorb/catch-up design before changing that state path. The no-slowdown and exactness gates remain open on the eventual updated head.

  • Synthena

@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart I measured the cost I promised: it is the drafter's absorb pass. Don't land yet. The PR head stays at
5e0d06bd81, and nothing new is pushed.

How. I used a local diagnostic build: PR head plus switches, never pushed. It loads --drafter but asks every
draft at depth 0, so no hold pass runs and every round is a copy round. The drafter still absorbs the kept rows.
Tokens per round are 1.073 on every server, the same as main. Fresh servers, A-B-B-A-A-B-B-A, each stream count run
alone. A is main a1781885e9 (56beeffc). 24 prompts, 256 tokens, and the same replies everywhere
(7b07ae66909cccc2), 0 empty:

streams main tok/s drafter, holds off paired median slower
1 51.46 51.13 51.07 51.24 48.89 49.04 48.75 48.89 -5.0 -4.1 -4.5 -4.6 % -4.6 % 4 of 4
4 109.14 109.20 110.02 110.07 105.08 105.01 104.90 106.73 -3.7 -3.8 -4.7 -3.0 % -3.8 % 4 of 4
8 141.38 142.64 141.45 140.91 135.82 135.85 137.15 135.57 -3.9 -4.8 -3.0 -3.8 % -3.9 % 4 of 4

Where it sits (c=8, two servers per arm, in mirrored order):

arm tok/s vs main
main 140.84 141.45 -
--drafter, holds off 135.66 135.96 -3.8 %
same, absorb skipped 140.99 141.13 -0.1 %
same, absorb and tap copies skipped 141.47 140.65 -0.1 %
head binary, no --drafter 140.86 141.48 0.0 %

nsys on a short c=8 run, same binary, absorb on vs off: +1,512 tf_dense_rows_16 launches (+244 ms), +271
tf_window_decode_tc (+29 ms), and about 27 ms of small kernels. That is about 1.0 ms per round over 271 passes.
Each pass reads the drafter's ~181 MB of weights (fuse, fc, qkv, o, gate_up, down), so it costs about the same
however many rows it takes. The tap copies and the wrapper cost nothing measurable.

Proposed design (not built yet; tokens cannot change, because the target still verifies every draft):

  1. Drafted.draft in the lane core: a depth-0 request no longer absorbs its kept rows. The stream records them as
    owed, as long as the drafter declares a new Facts.lazy_absorb.
  2. When that stream next gets a hold, Drafted absorbs the owed rows first, in the same absorbMany as that round's
    other rows. The chain then starts from the same row and token as with eager absorbing. The drafter's kernels
    compute each row by itself, so its state is bit-equal too.
  3. The target has to keep the owed rows. Kolibri's tap ring holds 256 positions per slot, and the backend would
    report that as a fact. When a stream's owed rows near that limit, Drafted absorbs them anyway, about once every
    180 rounds without a hold.
  4. The drafter times one absorb pass at reserve, as it already times the hold pass. payHolds and the per-stream
    bound add that cost for streams that owe rows, so the bound compares against a real copy round.

Steps 1, 2 and 4 are lane-core changes. Step 3 is a backend fact. The gates would be a host test that eager and
deferred absorbing give the same drafts (also across a ring wrap), the served gates as before, and fresh
A-B-B-A at c=1/4/8.

Expected effect (an estimate, not measured): a round without holds would then cost the same as on main (the
"absorb skipped" row). The bound alone is -1.7 % at c=4 and -3.3 % at c=8, and most of its rounds hold nothing. With
the absorb skipped on those rounds, it should land near +2 % at c=4 and near +0.5 % at c=8, with c=1 unchanged.
Without the bound the gain is small, because only about 4 % of c=8 rounds hold nothing.

Should I build it this way (lazy absorb plus the per-stream bound) and re-run the gates and the fresh c=1/4/8?

@ashhart

ashhart commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied for narrowing the overhead to the drafter's absorb pass: -3.9% at eight streams with holds off, -0.1% with absorb skipped, and level without --drafter. The default path is fine: the 16-row tiling is bit-identical (0/48 differ) and level with main at eight streams.

With --drafter, eight streams still lose (-1.9%, 4 of 4 pairs slower), so we'll keep this unlanded, as your title says. Before you change that state path, could you sketch the absorb/catch-up change here so we can agree on it? Once it's pushed, please re-run fresh-server A-B-B-A at 1, 4 and 8 streams with the exactness checks on the new head, and we'll run the --drafter checks on a GB10.

  • Synthena

@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart, the sketch is in #3590 (comment); in short, for agreement before I touch the state path (nothing is built yet, head stays 2ffa4f9484):

  1. Defer: in the lane core's Drafted.draft, a depth-0 request no longer absorbs its kept rows when the drafter declares a new Facts.lazy_absorb; the stream records owed_from, its first unabsorbed position.
  2. Catch up: when that stream next gets a hold, Drafted absorbs [owed_from, start + kept) first, in the same absorbMany as that round's other rows (one weight read for all of them), then holds. The chain starts from the same row and token as with eager absorbing, and the drafter state is bit-equal, since each row is computed by itself and only the batching changes.
  3. Ring limit: the backend reports how many rows it keeps per stream (Model.feature_rows, 256 for Kolibri's tap ring). When owed rows would pass that minus one view (64), Drafted absorbs them that round anyway, about once every 180 hold-free rounds.
  4. Pricing: the drafter times one absorb pass at reserve, at 1 and 64 rows, as it times the hold pass. payHolds and the per-stream bound add it for streams that owe rows, so a hold-free round is compared against a real copy round.

Steps 1, 2 and 4 are lane core and opt-in by fact; step 3 is a backend fact. Gates: a host test with a fake drafter that eager and deferred absorbing give the same held drafts after N hold-free rounds and across a ring wrap; the served gates as before (drafted == plain, c4/c8 == solo, resumed == fresh); then fresh A-B-B-A at 1, 4 and 8 streams against main. The bound would come back with it, since on its own the deferral saves little (about 4 % of eight-stream rounds hold nothing without the bound).

If that matches what you want, I'll build it on this branch.

@ashhart
ashhart force-pushed the kolibri1-drafter-lanes branch 2 times, most recently from 6946958 to 230d1c9 Compare November 23, 2026 12:47
@ashhart

ashhart commented Nov 23, 2026

Copy link
Copy Markdown
Owner

@jschmied Thanks for the careful Kolibri-1 drafter work and the absorb measurements. One small fix in reserve: the EAGLE-3 caches are allocated, the step and hold timing passes run, and only then are the caches cleared. Those timings therefore read uninitialized device memory, and they feed the depth rule. Could you move the clear to right after x.e.reserve, and keep the existing clear after the timing passes? Tokens should not change, because the caches are cleared before any stream opens. We have not measured how much the timings move.

The red build on this head is not from your code. Our rebase changed the envOff line in backend.zig, and we will fix that on our side.

  • Synthena

@ashhart
ashhart force-pushed the kolibri1-drafter-lanes branch from 230d1c9 to 440b9e3 Compare November 23, 2026 17:15
@ashhart

ashhart commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied for the rebase and the fresh-server speed measurements. The drafter still has three correctness blockers:

  1. zig/src/families/kolibri1/drafter.zig:215-223 calls time and timeHolds immediately after x.e.reserve(streams + 1), but clears the EAGLE-3 caches only afterward. Both timing passes at position 64 therefore read uninitialized K/V and last-output state, and those timings drive draft-depth selection. Please clear immediately after reserve as well as after timing.

  2. zig/src/families/kolibri1/row_costs.zig:53-56 always times a 64-row round and requires its four chains. Since Drafter.reserve calls this unconditionally, configured --parallel 1, 2, or 3 returns TimingSlots instead of opening. Please make calibration use the available slots without requiring four, and add coverage for those three configured stream counts.

  3. The early paged memory check uses kb.m.slots, which is one at this point (forward.zig:93-96), while final reserve allocates N + 1 drafter slots (drafter.zig:215). The subsequent plan also does not include the first stream's new target cache and timing slot in that check. Please account for the final allocation before creating drafter resources, so a tight-budget load gets the promised early DrafterPastMemory refusal rather than exceeding the budget or failing later.

The recipe also gives only abbreviated drafter revision 6430e5dc74 and no drafter weight license. Please pin the full revision and record the upstream release's license rather than relying on TensorFold's license.

After the initialization and allocation fixes, please rerun the c=1/4/8 fresh-server A-B-B-A gate. The current receipt still has c=8 at -1.9%, slower in all four pairs, so the no-slower-cell condition is not met yet.

  • Synthena

@jschmied jschmied changed the title kolibri1: the published EAGLE-3 drafter behind --drafter on CUDA (don't land yet: 8 streams 1.2 % slower) kolibri1: the published EAGLE-3 drafter behind --drafter on CUDA (don't land yet: 8 streams and cold prompts slower) Nov 24, 2026
@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart Thanks. Both reviews are answered on 57b037e491: three commits on your 440b9e33af, no rebase. Don't land
yet
: two served cells with --drafter are slower than main, 8 streams (-1.9 %) and a cold prompt's first token
(-41.8 %).

1. Clear before timing (cb9f870663). reserve now zeroes the EAGLE-3 caches right after x.e.reserve, before
the step and hold timing passes. The clear after them stays.

2. --parallel 1/2/3 (7a792d46d5). row_costs.time times only the widths the target's slots can take, 16 rows
a slot, and returns how many it timed. Host test: calibration times the widths 1, 2 and 3 streams can take, without asking four slots. On the GB10 with --drafter, each of --parallel 1, 2 and 3 opens and times its rounds over
1/2/3 slots (up to 16/32/48 rows). Drafted == plain, greedy and seeded, and N streams == solo.

3. Early memory check (7a792d46d5). Drafter.admit takes a Load and runs before the drafter allocates
anything. The Load counts:

  • every drafter slot reserve will make: N + 1 with a fixed --parallel N on pages, every stream's on linear caches;
  • on pages, the first stream's target window.

The first stream's drafter slot and the timing slot are not in the server's stream plan, so they are now allocated
at open, before the server reads its room. Test by name: DrafterPastMemory: --parallel 8 on pages counts 9 drafter slots and the first window, nothing allocated before. One byte short refuses; the old one-stream accounting let that
budget through. The test also checks admit's type, which takes numbers only. Planted controls (the old accounting,
and a calibration that needs four slots) fail all three tests by name.

4. Recipe (57b037e491). The drafter is pinned at 6430e5dc7453dd4ea57022a4cde46178afe89094 with its
model.safetensors sha256. The licence is the release's own: Apache-2.0 per its model card, with the card's note on
its German training data.

Exactness. Binary 1c88dadd is the head's code plus a local fix of the rebase's envOff line, never pushed.

  • drafted == plain, greedy and seeded: true
  • c=4 == solo and c=8 == solo (greedy), seeded c=8 == solo: true
  • resumed == fresh: true (12 hits vs 0)
  • copy-only head == main == drafted: true, 293d716e74b701a6, 0 empty
  • parity_controls.py on main and on the head: CONTROLS: PASS (4 prompts, seeds differ on 4) both

Speed. abba5.py: a noise floor from 3 rounds of A against A, then 5 rounds of A-B-B-A. Every run is a fresh
server measuring one cell, with main's copy drafts as A. Tokens are equal in every run.

cell verdict
c=1 FASTER +27.9 % (floor 0.6 %, 0 of 5 worse)
c=1, served defaults FASTER +32.1 % (0.8 %, 0 of 5)
c=4 FASTER +4.1 % (0.4 %, 0 of 5)
c=8 SLOWER -1.9 % (1.4 %, 5 of 5)
cold 7,900-token prompt, first token SLOWER -41.8 %, 3.64 -> 5.16 s (0.5 %, 5 of 5)

Why. One nsys round on the cold prompt: of +1.51 s of kernel time, tf_dense_rows_32 takes +1.41 s (236 launches
vs 50). The drafter absorbs every prompt row through the row kernels, 32 rows a tile, about 0.19 ms a row. c=8 is the
same pass once per round, as measured in 7027914287. A fix would absorb only the prompt rows the drafter's window can
still read, run long absorbs as a prefill-shaped GEMM, and defer absorb on hold-free rounds (7063086063). Each of
these changes the drafter's state path, so I haven't built any of them. Should I?

x86 full set: green (0 failed), apart from one lean finding (a two-line comment), fixed in the head; pr_check 0 errors
on the head. The body names the head; there is no CHANGELOG commit.

@ashhart

ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. The cache clears, calibration for one to three streams, slot/window accounting and full drafter pin are present.

One memory gap remains: calibration allocates a 300 MiB tap ring after the page-pool plan, without pricing it. Please include that allocation in admission and add a tight-budget boundary check.

The eight-stream and cold first-token losses still block landing. You have supplied the absorb sketch; its design decision and the graph/tap integration on main are ours.

  • Synthena

@AIFlowML

Copy link
Copy Markdown
Contributor

I replayed the paged admission case on a scratch merge of 57b037e491 into 4c79cfe346, keeping main’s tests and applying the documented envOff fix. On M5 Max, zig build test-kolibri-host test-gradient-serving check-native-cuda-host -Dfixed-cpu -j2 --summary all passed 34 tests with one skip.

For the tap-ring boundary Ash flagged, I extended the existing eight-stream DrafterPastMemory fixture. The paged model's slotCap() is 64 even at --parallel 8. With three taps, 2,560 hidden values and a 256+64 row ring, the production dimensions give 314,572,800 bytes. The existing fixture admits 3,858,848,256 bytes for the drafter and first window. At 4,173,421,055 bytes available, one byte short after adding the ring, Drafter.admit still returns 3,858,848,256 instead of DrafterPastMemory. The test runs without CUDA allocations. That supplies the one-byte-short case for the early check. The subsequent page-pool plan also needs to leave room for the ring before the first calibration forward allocates it.

Igor Lessio - AIFLOW LABS

@ashhart

ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Thank you @jschmied. The cache clears now precede timing, calibration works with one to three configured streams, the full drafter revision and Apache-2.0 provenance are pinned, and tap rows plus the per-slot ring are included in early admission. The rollback fix frees a replaced ring before reallocation.

One startup rollback case remains: zig/src/families/kolibri1/taps.zig:86-88 publishes the new device ring before allocating written. If that host allocation fails, prepare frees the prompt rows but leaves the new ring allocated. Please keep the new ring local with an error guard until both allocations succeed, and add a failing-allocator regression check.

The pushed branch still contains the acknowledged rawText/std.mem.span type error at backend.zig:151-153; the measured binaries used the local type fix. The merge also needs to retain main's round-graph integration and update the tap ring after both eager and graphed multi-row forwards, or default-graph drafted reads can use stale rows.

The performance hold in the title also remains: eight streams are 1.9% slower and a cold 7,900-token prompt's first token is 41.8% slower. These need the agreed absorb work and fresh-server A/B evidence before the hold can be lifted; the admission fix does not change them. Exactness must be checked again on the merged default-graph path.

  • Synthena

@ashhart
ashhart force-pushed the kolibri1-drafter-lanes branch from a006fe9 to ae1ae12 Compare November 26, 2026 13:29
@jschmied

Copy link
Copy Markdown
Contributor Author

@ashhart Thanks. All three asks are in b915f8b57f: three commits on your rebase ae1ae12911, no rebase of mine.
Don't land yet: 8 streams (-1.9 %) and a cold 7,900-token prompt's first token (-41.8 %) are still slower. That is
the separate absorb work, and nothing in this round changes it.

1. Ring rollback (3d4082026f). Taps.reserve keeps the new device ring in a local, with an errdefer, until
the host written slice is allocated too, and then publishes both. Test prepare: a failed host allocation leaves no device allocation behind, the new ring included uses a counting driver and a FailingAllocator that fails the
first host allocation. On the old reserve it fails (expected 0, found 1); with the fix it passes.

2. The type error. Your rebase onto main removed envOff (main reads TENSORFOLD_KOLIBRI_GRAPHS as a setting), so
the rawText line is gone and the head builds as pushed. The GB10 check below ran on the head's own binary.

3. Round graphs (b915f8b57f). ae1ae12911 kept main's round graphs, but only the eager multi-row branch updated
the tap ring:

  • verify now calls Taps.kept after both the graphed and the eager multi-row forward.
  • prepare_features drops the round graphs as it drops the step graphs.
  • The round fingerprint holds tap_rows and the tap count (host test).

Before you rebased, I had prepared the same merge locally (main 82c4e6cce3; its Kolibri code is the same as this
head's, apart from tests). The receipt for the stale-row case comes from there, with --drafter at
--parallel 1/2/3. Both binaries carried a local-only count of the round cache's outcomes:

  • with this fix: drafted == plain (greedy and seeded), N streams == solo, 0 empty, 2.06-2.10 tokens a round; 1,143 to
    1,456 graph replays, 0 eager fallbacks;
  • without it (what ae1ae12911 does): the first drafted round fails with RowsNotHeld (HTTP 500), after 1 capture
    and 0 eager rounds;
  • the same binary with TENSORFOLD_KOLIBRI_GRAPHS=0 passes everything, so only the graphed round lacked the update.

Also fixed (ee80198d9e, from a second review of this round). keep shortened the lane but left the tap ring
holding the verify's rejected rows, so features could hand them out. The lane contract (drafted_test.zig) expects
RowsNotHeld there. keep now calls Taps.keepTo. The drafter asks only for the kept prefix, so no served token
changed. Test keepTo: after a verify of four rows keeps two, the rejected rows are not handed out; with keepTo
planted as a no-op, it fails by name.

Checks on b915f8b57f.

  • GB10 host (test-kolibri-host check-native-cuda-host test-gradient-serving -Dfixed-cpu): 18/18 steps, 42/43
    tests passed (1 skipped).
  • --drafter at --parallel 1/2/3 on the head's own binary (669e4881, default round graphs): opens and times its
    rounds over 1/2/3 slots, drafted == plain (greedy and seeded), N streams == solo, 0 empty, 2.06-2.07 tokens a round.
  • x86 targeted set: 75/75 steps; cuda-host 21/21; pr_check 0 errors; fmt and diff-check clean.

@ashhart

ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thank you @jschmied. The final ring-lifetime fix is in place: the device ring stays guarded until written succeeds, and the failing-allocator regression covers the old leak. keepTo now closes the rejected-row hole, and verify updates taps after both eager and graphed rounds, with round-graph invalidation and fingerprint coverage. The envOff type error is also gone. The earlier admission, zeroing, calibration, hold-cost, revision and licence fixes remain intact.

Two landing conditions remain. First, please implement the agreed absorb work: defer and catch up depth-zero rows in the lane core's Drafted.draft, and trim prompt rows to the readable window and use a prefill-shaped path for long absorbs in Eagle3.absorbMany. Keep the eager/deferred state bit-equal, including across a tap-ring wrap.

Second, on GB10, please run the complete final-head default-graph gate: drafted-equals-plain for greedy and seeded serving, c=4/c=8-equals-solo, resumed-equals-fresh, and exact copy-only/main/drafted hashes with zero empty replies. The fresh-server A-B-B-A speed table must cover c=1, c=4, c=8, c=1 served defaults and the cold 7,900-token prompt. Eight streams are still 1.9% slower and cold first-token latency is still 41.8% slower, so the no-slower-cell bar is not met.

We’ll handle the current-main rebase, preserving main’s new CUDA exports, lifecycle test and gradient-serving pin.

  • Synthena

jschmied and others added 23 commits November 26, 2026 22:15
…ad as format v1 Configs under the same checks

eagle3 joins the format's architectures (one row a pass); drafter_layout names a file's tensors under a published
layout (blocks.N, the target's own embed and head, unused tensors admitted by name).
… lane core's Drafted wrapper

The forward copies the drafter's tapped rows (layers 44/47/49, normed as the next layer reads them) and the backend
hands them out as Features (prepare_features/features); cuda/eagle3.zig runs the drafter's passes on shared operators
only (dense rows, norms, qk rows, window attention, SwiGLU, embedding gather, argmax): no new kernel. Without
--drafter nothing is tapped and no forward changes.
…he depth rule

Absorbs ran one drafter pass per stream, reading the weights once per
stream. absorbMany stages every stream's rows into one pass.

Kolibri reported no window costs, so the depth rule could not trade
drafts against verify rows and drafted at full depth at every stream
count. row_costs.zig times the target's rounds at 1 to 64 rows when the
drafter reserves (lanes.cost_rule's fastest and smooth, as the other
families time theirs) and the drafter passes them as window and lane
costs.
…fts)

The lane core applies the rule's depth cap to a shared round's holds only
under limit_shared_drafts, as Qwen's MTP head and Gemma's drafters set it.
Without it every stream drafted the release's full depth at any stream
count.
dense_rows' 32-row tile runs Kolibri's 128000 x 2560 head about 5x slower
than two 16-row launches on the GB10 (nsys: 15.4 vs 3.0 ms at 17-32 rows,
25.2 ms past 32), and a drafted round at 8 streams verifies about 24 rows.
dense_rows.cu sums each row in one order whatever the tile, so the bits do
not change. Rows past a round (prompt chunks) keep one launch.
…y is allocated

openDrafter refused below a fixed 1 GiB, after the weights were uploaded. Drafter.admit now
computes the need from the config alone: weights as upload puts them, the scratch (sizes shared
with Eagle3.init), and every stream's caches plus the timing slot (Dims.streamBytes). It runs
before the first allocation; DrafterPastMemory keeps its name.
…ds kept only while they beat a copy round

A Drafted model with limit_shared_drafts and Facts.hold_costs (no granted depth) now prices each head's
reserved depth through Rule.payHoldsFor, the granted path's existing costing: the drafter's pass against
the round without it. Draft sources change, never tokens. Host test test-hold-pass-host: a cheap pass keeps
every depth, a dear one falls back to none, no timed pass leaves the legacy cap as it was.
wrap read Drafted.facts when the drafter opened, before Served.reserve timed it, so a drafter that times
at reserve (Kolibri-1's EAGLE-3: step, round costs) reached the lane core untimed: no shared prices at all.
Served.reserve now re-applies the drafter's facts after its reserve (idempotent; no --drafter: untouched).
…_costs)

At reserve, chains of 1, 2, 4 and 8 streams at depth 1 and the serving depth, best of three, on the streams'
slots (zeroed after, before any stream opens); the lane core prices a drafter round with them.
…ses, and again after them

The step and hold timing passes ran on freshly allocated caches, so the costs the depth rule reads came from
uninitialized device memory. reserve now clears the caches right after allocating them, and keeps the clear after
the timing passes. No stream opens before reserve returns, so tokens do not change.
…ry before any drafter allocation

row_costs times only the widths the served streams' slots hold (16 rows a slot), so --parallel 1, 2 and 3 open
instead of returning TimingSlots. The early DrafterPastMemory check now counts what the load will hold: every
drafter slot reserve() makes (with --parallel N on pages: N + 1) and, on pages, the first stream's target window.
The first stream's drafter slot and the timing slot, which the server's stream plan does not count, are allocated
at open, before the server reads its room.
…s own licence; speed rows by abba5, two cells slower
…ate it before the pool plan

The target's tap rows (a prompt chunk's, 8,192 rows) and its ring for every slot a round can name (64 x 320
rows on pages) were allocated by the first calibration forward, after the server had planned the page pool,
and Drafter.admit never counted them. Taps.prepare now allocates both when the drafter names its taps, before
the server reads its room, and Drafter.Load carries their rows so admit refuses by name when they do not fit.
reserve stored the new device ring in t.ring before allocating the host
`written` slice. When that allocation failed, prepare freed the prompt rows
but left the ring allocated until teardown. The ring now stays in a local,
freed by an errdefer, and is published with `written` once both exist.

Test: with a counting driver and a FailingAllocator that fails the first
host allocation, prepare returns OutOfMemory and leaves no live device
allocation; the old reserve fails it (expected 0, found 1).
keep shortened the lane's length but left Taps.written at the end of the
verify, so after verifying four rows and keeping two, features could still
hand out the rejected rows (the lane contract, drafted_test.zig, expects
RowsNotHeld there). keep now calls Taps.keepTo(slot, len), which never
extends what the ring holds. The drafter asks only the kept prefix, so no
served token changed; this closes the contract gap.

Test: after a verify of four rows keeps two, a view of two rows succeeds,
three is RowsNotHeld, and a longer keepTo leaves the held rows alone.
… one does

Main's round graphs (cd00818) replay a decode round of several rows, but
only the eager branch called Taps.kept after the forward. With graphs on (the
default) a drafted round's rows never reached the ring, so the drafter's next
read found stale positions. kept now follows both branches; the graph's
launches already hold the tap copies into tap_rows.

A round graph captured before the drafter named its taps copies none, so
prepare_features drops the round graphs as it drops the step graphs, and the
round fingerprint holds tap_rows and the tap count.
@ashhart
ashhart force-pushed the kolibri1-drafter-lanes branch from b915f8b to f9fbf2c Compare November 26, 2026 22:17
@ashhart

ashhart commented Nov 26, 2026

Copy link
Copy Markdown
Owner

Thanks @jschmied. The ring rollback, rejected-row handling, eager and graphed tap updates, graph invalidation, admission accounting, and provenance fixes are present.

Two agreed pieces are still missing:

  • Depth-zero rows are still absorbed immediately. Please defer them and catch up before the next hold, with an eager-versus-deferred state equality check that includes a tap-ring wrap.
  • Long prompts still absorb every eligible row through decode-shaped passes. Please trim unreadable history and add the prefill-shaped long-absorb path, with byte equality against the existing path.

After those changes, the complete final-head equality and fresh-server speed matrices still need to pass. The supplied results still lose at eight streams and on the cold 7,900-token prompt, and they do not yet cover every final default-graph equality cell.

We will handle the current-main integration, preserving the CUDA exports, lifecycle coverage, and gradient-serving pin.

  • Synthena

This branch has not been deployed

No deployments
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.

3 participants