From 630378dc05aaca3d60eb3081b4a6cefba52abb52 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:58:05 +0800 Subject: [PATCH 01/22] inkling2 metal: a verify window keeps its convolution histories in place, and every stream's keep shares one command buffer --- zig/src/families/inkling2/metal/backend.zig | 18 ++-- zig/src/families/inkling2/metal/forward.zig | 10 +- .../families/inkling2/metal/runtime_test.zig | 48 ++++++++++ zig/src/families/inkling2/metal/state.zig | 91 ++++++++----------- 4 files changed, 102 insertions(+), 65 deletions(-) diff --git a/zig/src/families/inkling2/metal/backend.zig b/zig/src/families/inkling2/metal/backend.zig index 9e792c97619..efdb277a6fb 100644 --- a/zig/src/families/inkling2/metal/backend.zig +++ b/zig/src/families/inkling2/metal/backend.zig @@ -415,7 +415,7 @@ pub const Metal = struct { var ids: [st.batch_rows]u32 = undefined; var total: usize = 0; var begun: usize = 0; - errdefer for (segments[0..begun]) |seg| seg.cache.rollback(self.model.queue) catch {}; + errdefer for (segments[0..begun]) |seg| seg.cache.rollback(); for (windows, out, 0..) |w, o, i| { const rows = w.rows(); if (rows == 0 or rows > st.window_rows or total + rows > st.batch_rows or w.parents != null or w.held != 0 or o.sampled.len != rows or o.drafts.len != rows - 1 or w.positions.len != rows) return error.UnsupportedInklingWindow; @@ -429,7 +429,7 @@ pub const Metal = struct { total += rows; } for (segments[0..windows.len]) |seg| { - try seg.cache.begin(self.model.queue, seg.rows); + try seg.cache.begin(seg.rows); begun += 1; } const generation = if (self.prepared) self.nextTapGeneration() else 0; @@ -453,13 +453,17 @@ pub const Metal = struct { fn keepFn(ptr: *anyopaque, windows: []const be.Window, paths: []const []const u32) !void { const self = cast(ptr); - if (windows.len != paths.len) return error.InvalidInklingWindows; - for (windows, paths) |w, path| { + if (windows.len != paths.len or windows.len > st.batch_rows) return error.InvalidInklingWindows; + var caches: [st.batch_rows]*st.Cache = undefined; + var accepted: [st.batch_rows]usize = undefined; + for (windows, paths, 0..) |w, path, i| { const cache = try self.cacheOf(w.stream); - for (path, 0..) |r, i| if (r != i) return error.UnsupportedInklingTree; + for (path, 0..) |r, j| if (r != j) return error.UnsupportedInklingTree; if (path.len == 0 or path.len > w.rows() or cache.pending == null or cache.pending.? != w.rows()) return error.UnsupportedInklingWindow; - try cache.commit(self.model.queue, path.len); + caches[i] = cache; + accepted[i] = path.len; } + try st.commit(self.model.queue, caches[0..windows.len], accepted[0..windows.len]); } fn draftFn(ptr: *anyopaque, requests: []const be.DraftRequest) !void { @@ -475,7 +479,7 @@ pub const Metal = struct { const self = cast(ptr); if (self.caches.fetchRemove(stream)) |entry| { const cache = entry.value; - if (cache.pending != null) cache.rollback(self.model.queue) catch |err| std.log.err("inkling2_loop rollback at release: {s}", .{@errorName(err)}); + if (cache.pending != null) cache.rollback(); self.held -= st.cacheBytes(cache.capacity); cache.deinit(); self.gpa.destroy(cache); diff --git a/zig/src/families/inkling2/metal/forward.zig b/zig/src/families/inkling2/metal/forward.zig index d48c920f87e..d027edd3ebd 100644 --- a/zig/src/families/inkling2/metal/forward.zig +++ b/zig/src/families/inkling2/metal/forward.zig @@ -403,10 +403,14 @@ fn visit(m: *const Model, e: mtl.ComputeEncoder, s: *state.Scratch, v: *const la if (v.cache_slot == 5) copyBf16(m, e, at(s.p, 0), at(s.prelude, 0), rows * state.hidden); } +/// A cache with a window open keeps its histories: `state.commit` takes them from the rows the window keeps. fn commitFullHistories(m: *const Model, e: mtl.ComputeEncoder, s: *state.Scratch, segments: []const Segment) void { - for (segments) |seg| for (0..state.visit_slots) |slot| for (0..state.conv_states) |cs| { - copyBf16(m, e, staged(s, seg.cache, seg.rows, slot, cs, seg.rows), seg.cache.history(slot, cs), 3 * state.convWidth(cs)); - }; + for (segments) |seg| { + if (seg.cache.pending != null) continue; + for (0..state.visit_slots) |slot| for (0..state.conv_states) |cs| { + copyBf16(m, e, staged(s, seg.cache, seg.rows, slot, cs, seg.rows), seg.cache.history(slot, cs), 3 * state.convWidth(cs)); + }; + } } pub fn run(m: *const Model, s: *state.Scratch, cache: *state.Cache, ids: []const u32, options: Options) !void { diff --git a/zig/src/families/inkling2/metal/runtime_test.zig b/zig/src/families/inkling2/metal/runtime_test.zig index 127fa5b31cb..c4286efee4d 100644 --- a/zig/src/families/inkling2/metal/runtime_test.zig +++ b/zig/src/families/inkling2/metal/runtime_test.zig @@ -224,3 +224,51 @@ test "A snapshot restores each head's live rows into a cache of another capacity try moveLive(queue, &to, got, rows, false); try std.testing.expect(std.mem.eql(u8, want.slice(u8, size), got.slice(u8, size))); } + +fn blit(queue: mtl.Queue, from: mtl.Buffer, to: mtl.Buffer, bytes: usize) !void { + const pool = mtl.objc.Pool.push(); + defer pool.pop(); + const cb = queue.commandBuffer(); + const e = cb.blit(); + e.copy(from, 0, to, 0, bytes); + e.end(); + cb.commit(); + cb.wait(); + if (cb.failure() != null) return error.GpuFailed; +} + +test "A commit gives each open window the histories of its kept rows, with no saved copy" { + const device = mtl.Device.init() catch return error.SkipZigTest; + const queue = try device.queue(); + defer queue.deinit(); + const p = schedule(); + var full = try state.Cache.init(device, 64, &p); + defer full.deinit(); + var cut = try state.Cache.init(device, 64, &p); + defer cut.deinit(); + const staged = try device.buffer(state.taps_bytes, mtl.ResourceOptions.shared); + defer staged.deinit(); + const got = try device.buffer(state.conv_bytes, mtl.ResourceOptions.shared); + defer got.deinit(); + var prng = std.Random.DefaultPrng.init(11); + prng.random().bytes(staged.slice(u8, state.taps_bytes)); + const rows = 8; + const kept = [_]usize{ rows, 3 }; + const caches = [_]*state.Cache{ &full, &cut }; + for (caches) |c| { + try blit(queue, staged, c.taps, state.taps_bytes); + try c.begin(rows); + } + try std.testing.expectError(error.Inkling2CacheTransaction, state.commit(queue, &caches, &.{ rows, rows + 1 })); + try state.commit(queue, &caches, &kept); + for (caches, kept) |c, n| { + try std.testing.expectEqual(n, c.len); + try std.testing.expectEqual(@as(?usize, null), c.pending); + try blit(queue, c.conv, got, state.conv_bytes); + for (0..state.visit_slots) |slot| for (0..state.conv_states) |cs| { + const len = 3 * state.convWidth(cs) * 2; + const want = staged.slice(u8, state.taps_bytes)[state.convByteOffset(slot, cs, n, state.stage_rows)..][0..len]; + try std.testing.expectEqualSlices(u8, want, got.slice(u8, state.conv_bytes)[state.convByteOffset(slot, cs, 0, 3)..][0..len]); + }; + } +} diff --git a/zig/src/families/inkling2/metal/state.zig b/zig/src/families/inkling2/metal/state.zig index 8514c17a802..2466fb29066 100644 --- a/zig/src/families/inkling2/metal/state.zig +++ b/zig/src/families/inkling2/metal/state.zig @@ -53,7 +53,7 @@ pub fn kvBytes(capacity: usize) usize { } pub fn cacheBytes(capacity: usize) usize { - return kvBytes(capacity) + conv_bytes + taps_bytes + conv_bytes + vocabulary * 4; + return kvBytes(capacity) + conv_bytes + taps_bytes + vocabulary * 4; } pub fn convWidth(state: usize) usize { @@ -92,7 +92,6 @@ pub const Cache = struct { kv: mtl.Buffer, conv: mtl.Buffer, taps: mtl.Buffer, - backup: mtl.Buffer, logits: mtl.Buffer, tap: Tap = .{}, /// A stepped prompt chunk's rows, good until the next forward. @@ -113,7 +112,6 @@ pub const Cache = struct { .kv = undefined, .conv = undefined, .taps = undefined, - .backup = undefined, .logits = undefined, .key_at = undefined, .value_at = undefined, @@ -139,8 +137,6 @@ pub const Cache = struct { errdefer out.conv.deinit(); out.taps = try device.buffer(taps_bytes, mtl.ResourceOptions.private); errdefer out.taps.deinit(); - out.backup = try device.buffer(conv_bytes, mtl.ResourceOptions.private); - errdefer out.backup.deinit(); out.logits = try device.buffer(vocabulary * 4, mtl.ResourceOptions.shared); errdefer out.logits.deinit(); const queue = try device.queue(); @@ -161,7 +157,7 @@ pub const Cache = struct { } pub fn setResident(c: *Cache, hook: ?mtl.ResidencySet.Follow) void { - const buffers = [_]mtl.Buffer{ c.kv, c.conv, c.taps, c.backup, c.logits }; + const buffers = [_]mtl.Buffer{ c.kv, c.conv, c.taps, c.logits }; if (c.follow) |f| { for (buffers) |b| f.leave(f.ctx, b); if (c.last_tap) |b| f.leave(f.ctx, b); @@ -200,46 +196,14 @@ pub const Cache = struct { return layer; } - /// Save all four pre-window three-tap histories before KV/conv speculation. - pub fn begin(c: *Cache, queue: mtl.Queue, rows: usize) !void { + /// Open a window of `rows`: its forward stages their taps and leaves the histories for `commit`. + pub fn begin(c: *Cache, rows: usize) !void { if (c.pending != null or rows == 0 or rows > window_rows or c.len + rows > c.capacity) return error.Inkling2CacheTransaction; - try copyGpu(queue, c.conv, 0, c.backup, 0, conv_bytes, "begin"); c.pending = rows; } - /// Commit accepted rows: staged taps select the new state; rejected KV positions are overwritten on replay. - pub fn commit(c: *Cache, queue: mtl.Queue, accepted: usize) !void { - const rows = c.pending orelse return error.Inkling2NoTransaction; - if (accepted > rows) return error.Inkling2CacheTransaction; - if (accepted < rows) { - const pool = mtl.objc.Pool.push(); - defer pool.pop(); - const cb = queue.commandBuffer(); - const e = cb.blit(); - e.copy(c.backup, 0, c.conv, 0, conv_bytes); - for (0..visit_slots) |slot| for (0..conv_states) |state| { - const bytes = 3 * convWidth(state) * 2; - e.copy(c.taps, convByteOffset(slot, state, accepted, stage_rows), c.conv, convByteOffset(slot, state, 0, 3), bytes); - }; - e.end(); - cb.commit(); - cb.wait(); - if (cb.failure()) |msg| { - std.log.err("inkling2_loop cache commit: {s}", .{msg}); - return error.GpuFailed; - } - } - const start = c.len; - c.len += accepted; - if (c.tap.buf != null and c.tap.start == start) { - c.tap.rows = accepted; - } else c.tap = .{}; - c.pending = null; - } - - pub fn rollback(c: *Cache, queue: mtl.Queue) !void { - _ = c.pending orelse return error.Inkling2NoTransaction; - try copyGpu(queue, c.backup, 0, c.conv, 0, conv_bytes, "rollback"); + /// Drop an open window: its forward wrote no history, and its KV positions are overwritten on replay. + pub fn rollback(c: *Cache) void { c.pending = null; c.tap = .{}; } @@ -248,7 +212,6 @@ pub const Cache = struct { c.setResident(null); c.logits.deinit(); if (c.last_tap) |b| b.deinit(); - c.backup.deinit(); c.taps.deinit(); c.conv.deinit(); c.kv.deinit(); @@ -256,18 +219,36 @@ pub const Cache = struct { } }; -fn copyGpu(queue: mtl.Queue, from: mtl.Buffer, from_off: usize, to: mtl.Buffer, to_off: usize, bytes: usize, comptime what: []const u8) !void { - const pool = mtl.objc.Pool.push(); - defer pool.pop(); - const cb = queue.commandBuffer(); - const e = cb.blit(); - e.copy(from, from_off, to, to_off, bytes); - e.end(); - cb.commit(); - cb.wait(); - if (cb.failure()) |msg| { - std.log.err("inkling2_loop cache {s}: {s}", .{ what, msg }); - return error.GpuFailed; +/// Keep the first `accepted` rows of each cache's open window, all in one command buffer: the three staged taps +/// that end at a window's last kept row are its new histories. Rejected KV positions are overwritten on replay. +pub fn commit(queue: mtl.Queue, caches: []const *Cache, accepted: []const usize) !void { + for (caches, accepted) |c, kept| { + const rows = c.pending orelse return error.Inkling2NoTransaction; + if (kept > rows) return error.Inkling2CacheTransaction; + } + { + const pool = mtl.objc.Pool.push(); + defer pool.pop(); + const cb = queue.commandBuffer(); + const e = cb.blit(); + for (caches, accepted) |c, kept| for (0..visit_slots) |slot| for (0..conv_states) |state| { + e.copy(c.taps, convByteOffset(slot, state, kept, stage_rows), c.conv, convByteOffset(slot, state, 0, 3), 3 * convWidth(state) * 2); + }; + e.end(); + cb.commit(); + cb.wait(); + if (cb.failure()) |msg| { + std.log.err("inkling2_loop cache commit: {s}", .{msg}); + return error.GpuFailed; + } + } + for (caches, accepted) |c, kept| { + const start = c.len; + c.len += kept; + if (c.tap.buf != null and c.tap.start == start) { + c.tap.rows = kept; + } else c.tap = .{}; + c.pending = null; } } From a99fc85de65b83a13f9347db8418320fa1c1964a Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Mon, 23 Nov 2026 19:58:05 +0800 Subject: [PATCH 02/22] changelog: card 234's first DSpark hold lever, not yet measured --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md new file mode 100644 index 00000000000..9505937b462 --- /dev/null +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -0,0 +1,4 @@ +# Inkling 2 Mini on Metal: a DSpark round stops saving its convolution histories + +- A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. +- Not yet measured: no Mac GPU window was open in this step. A device test covers the kept histories of a full and a cut window; the real-checkpoint serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and the control/candidate/control bench on the M5 Ultra are still due before any speed is claimed against #4618's 123 / 281. From 4ccf35583ea8b0a7d73d6072e6337da65dd5e948 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Mon, 23 Nov 2026 21:03:51 +0800 Subject: [PATCH 03/22] changelog: record candidate float64 Metal gate --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index 9505937b462..d3d10167fd5 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -1,4 +1,4 @@ # Inkling 2 Mini on Metal: a DSpark round stops saving its convolution histories - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. -- Not yet measured: no Mac GPU window was open in this step. A device test covers the kept histories of a full and a cut window; the real-checkpoint serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and the control/candidate/control bench on the M5 Ultra are still due before any speed is claimed against #4618's 123 / 281. +- The official-checkpoint Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ; 6 tests passed in `zig build test-inkling2-metal-float64`). The hold lever remains unmeasured: no Mac GPU window was open. A device test covers the kept histories of a full and a cut window; the real-checkpoint DSpark serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and control/candidate/control benchmarks on the M5 Ultra are still due before any speed is claimed against #4618's 123 / 281. From 064c35718d81581d3213cc84dc9c5f5deb4f8477 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Mon, 23 Nov 2026 21:09:21 +0800 Subject: [PATCH 04/22] changelog: card 234's real-checkpoint DSpark exactness session, speed still unclaimed --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index d3d10167fd5..3bc8d244354 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -1,4 +1,5 @@ # Inkling 2 Mini on Metal: a DSpark round stops saving its convolution histories - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. -- The official-checkpoint Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ; 6 tests passed in `zig build test-inkling2-metal-float64`). The hold lever remains unmeasured: no Mac GPU window was open. A device test covers the kept histories of a full and a cut window; the real-checkpoint DSpark serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and control/candidate/control benchmarks on the M5 Ultra are still due before any speed is claimed against #4618's 123 / 281. +- Exactness on the official checkpoint, M5 Ultra: the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 179 and 143 drafts accepted. +- Speed is not claimed. That session read 123.3 tok/s at one stream and 285.5 total at four on code (card 210: 120.7 / 279.6; #4618: 123 / 281), but it was one rep outside a Mac GPU window, with the voice server on the same GPU and no control beside it. The ceiling, control/candidate/control medians of three, 45K prefill, the real-checkpoint serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and the 1-and-64-stream receipt against MLX/#4618 wait for a window. From 74190318d3c33c53e40433ec4a9db3544e68bab3 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Mon, 23 Nov 2026 23:45:37 +0800 Subject: [PATCH 05/22] changelog: card 234's exactness re-run on the merged base, speed still unclaimed --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index 3bc8d244354..9f7f9629a21 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -1,5 +1,5 @@ # Inkling 2 Mini on Metal: a DSpark round stops saving its convolution histories - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. -- Exactness on the official checkpoint, M5 Ultra: the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 179 and 143 drafts accepted. -- Speed is not claimed. That session read 123.3 tok/s at one stream and 285.5 total at four on code (card 210: 120.7 / 279.6; #4618: 123 / 281), but it was one rep outside a Mac GPU window, with the voice server on the same GPU and no control beside it. The ceiling, control/candidate/control medians of three, 45K prefill, the real-checkpoint serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and the 1-and-64-stream receipt against MLX/#4618 wait for a window. +- Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. +- Speed is not claimed. That session read 123.2 tok/s at one stream and 283.5 total at four on code (card 210: 120.7 / 279.6; #4618: 123 / 281), but it was one rep outside a Mac GPU window, with the voice server on the same GPU and no control beside it. The ceiling, control/candidate/control medians of three, 45K prefill, the real-checkpoint serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and the 1-and-64-stream receipt against MLX/#4618 wait for a window. From 5fac5112556275782a14e4535d0492eba9b92646 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Mon, 23 Nov 2026 23:51:59 +0800 Subject: [PATCH 06/22] changelog: card 234's 64-stream DSpark exactness check, speed still unclaimed --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index 9f7f9629a21..59a289c3752 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -2,4 +2,5 @@ - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. +- 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): one session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. - Speed is not claimed. That session read 123.2 tok/s at one stream and 283.5 total at four on code (card 210: 120.7 / 279.6; #4618: 123 / 281), but it was one rep outside a Mac GPU window, with the voice server on the same GPU and no control beside it. The ceiling, control/candidate/control medians of three, 45K prefill, the real-checkpoint serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and the 1-and-64-stream receipt against MLX/#4618 wait for a window. From bce1cdb727001c2016a0ead01a04991610aa6cd2 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 02:40:59 +0800 Subject: [PATCH 07/22] receipts: card 234's Mac window run of the DSpark hold lever --- .../inkling-2-mini-metal-234/README.md | 53 +++++++++++++++++++ .../inkling-2-mini-metal-234/cells.jsonl | 36 +++++++++++++ .../inkling-2-mini-metal-234/prefill45k.txt | 4 ++ docs/receipts/inkling-2-mini-metal-234/run.sh | 19 +++++++ 4 files changed, 112 insertions(+) create mode 100644 docs/receipts/inkling-2-mini-metal-234/README.md create mode 100644 docs/receipts/inkling-2-mini-metal-234/cells.jsonl create mode 100644 docs/receipts/inkling-2-mini-metal-234/prefill45k.txt create mode 100755 docs/receipts/inkling-2-mini-metal-234/run.sh diff --git a/docs/receipts/inkling-2-mini-metal-234/README.md b/docs/receipts/inkling-2-mini-metal-234/README.md new file mode 100644 index 00000000000..2fc2d40fa58 --- /dev/null +++ b/docs/receipts/inkling-2-mini-metal-234/README.md @@ -0,0 +1,53 @@ +# Inkling 2 Mini on Metal, M5 Ultra: card 234's receipt + +Apple M5 Ultra, 256 GB, macOS 27.0, the official checkpoint with its own `mtp.safetensors` as the DSpark drafter, +`tensorfold-native` from `zig build native -Doptimize=ReleaseFast`, `--context 65536`. The Desk's Mac GPU window, +24 Nov 02:02-02:38 HKT, one lock held for the whole sequence (`run.sh`); the load average at each step is in its line +below, since other cards' CPU work kept running. + +Control: card 210's tip `781eeab52`. Candidate: `630378dc0` on that base (a verify window keeps its convolution +histories in place; every stream's keep shares one command buffer). + +## Ceiling + +A plain step reads about 5.6 GB: 8 of 128 experts (5.1 MB each) in 48 layer passes (24 layers, the 12 core ones three +times) is 1.96 GB, the other layer weights 2.7 GB over the same passes, the bf16 LM head 0.93 GB. Card 210's 16.1 ms +plain step is 350 GB/s; the M5 Ultra's bandwidth was not measured in this window, so the percentage of ceiling is not +claimed. DSpark's bar is the hold: a round costs 1.74 plain steps at one stream and 2.24 at four. + +## DSpark hold lever + +`bench.sh` (card 210's): medians of three reps, `--levels 1,4 --tokens 256 --temperatures 0 --alone --serial`. + +| tok/s (code / chat) | control | candidate | control | candidate | #4618 | +|---|---|---|---|---|---| +| 1 stream | 118.9 / 96.8 | 120.2 / 93.3 | 122.2 / 45.6* | 118.0 / 95.3 | 123 | +| 4 streams | 275.7 / 227.7 | **282.7 / 233.6** | 274.9 / 190.3* | **285.7 / 235.7** | 281 | +| 4-stream round, code | 39.3 ms | 38.5 ms | 39.4 ms | 37.9 ms | | + +\* reps 81/32/46 and 112/190/216: disturbed, not used. + +- At four streams the lever is kept: code beats both controls by 2.5-3.9% and #4618's 281 by 0.6-1.7%, chat beats the + clean control by 2.6-3.5%, a round is 1 ms shorter at the same 2.81 tokens. +- At one stream it is inside noise (118.0-120.2 against 118.9-122.2) and under #4618's 123: not beaten. It passes + Strata v0.2.19's 108.9-114.5 on M5 Max on code (another chip: a deployment comparison). +- Plain, candidate: 61.1 / 62.6 at one stream, 223.7 / 224.1 at four, as card 210's 61.0-62.3 / 216-221. The plain + control beside it was disturbed (reps 188/173/171, 50/51/51) and is not used. +- Every cell: 0 failed requests, every concurrent reply equal to its run alone (12 of 12), drafted equal to plain. + +## Prefill at 45K + +`prefill.sh` with the drafter on: **2,365 tok/s** median (2,164-2,368), first token in 19.5-21.3 s; card 210 read +2,439 without the drafter. Each repeat equals its fresh reply but reads 0 cached tokens with `--drafter`, where card +210's plain session read 46,080: the drafter session does not reuse the prompt cache. + +## Engines at 1 and 64 streams: void + +Card 235's `engines.sh` ran next (02:12-02:38), when the load average rose from 35 to 72: TensorFold's own one-stream +code cell fell to 100.2 (99-117) from 118-120 minutes earlier, and oMLX's code cells streamed each reply in one chunk +after 13 s, so they are unmeasured. No engine comparison is claimed from it; card 235 owns that receipt. + +## Files + +`cells.jsonl`: every cell (medians, reps, round, `alone`, `serial`); `prefill45k.txt`; `run.sh` reproduces the +sequence. diff --git a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl new file mode 100644 index 00000000000..945329b85c1 --- /dev/null +++ b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl @@ -0,0 +1,36 @@ +{"label": "ctrl1ds", "prompt": "code", "streams": 1, "aggregate_tps": 118.9, "reps": [118.9, 118.5, 119.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.325, "round_gap_p50_ms": 28.622, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 182, "plain_drafted": 0}} +{"label": "ctrl1ds", "prompt": "code", "streams": 4, "aggregate_tps": 275.7, "reps": [274.9, 276.3, 275.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 39.34, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 182, "plain_drafted": 0}} +{"label": "ctrl1ds", "prompt": "chat", "streams": 1, "aggregate_tps": 96.8, "reps": [97.4, 96.8, 90.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.485, "round_gap_p50_ms": 26.532, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 151, "plain_drafted": 0}} +{"label": "ctrl1ds", "prompt": "chat", "streams": 4, "aggregate_tps": 227.7, "reps": [227.7, 227.1, 227.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 39.138, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 151, "plain_drafted": 0}} +{"label": "cand1ds", "prompt": "code", "streams": 1, "aggregate_tps": 120.2, "reps": [120.2, 120.1, 121.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.282, "round_gap_p50_ms": 27.699, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 178, "plain_drafted": 0}} +{"label": "cand1ds", "prompt": "code", "streams": 4, "aggregate_tps": 282.7, "reps": [281.9, 282.9, 282.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 38.491, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 178, "plain_drafted": 0}} +{"label": "cand1ds", "prompt": "chat", "streams": 1, "aggregate_tps": 93.3, "reps": [96.4, 91.5, 93.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.415, "round_gap_p50_ms": 26.069, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 146, "plain_drafted": 0}} +{"label": "cand1ds", "prompt": "chat", "streams": 4, "aggregate_tps": 233.6, "reps": [233.2, 233.9, 233.6], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 38.246, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 146, "plain_drafted": 0}} +{"label": "ctrl2ds", "prompt": "code", "streams": 1, "aggregate_tps": 122.2, "reps": [122.2, 122.4, 121.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.413, "round_gap_p50_ms": 29.052, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 176, "plain_drafted": 0}} +{"label": "ctrl2ds", "prompt": "code", "streams": 4, "aggregate_tps": 274.9, "reps": [278.2, 274.9, 268.0], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 39.374, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 176, "plain_drafted": 0}} +{"label": "ctrl2ds", "prompt": "chat", "streams": 1, "aggregate_tps": 45.6, "reps": [81.4, 32.0, 45.6], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.462, "round_gap_p50_ms": 63.779, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 146, "plain_drafted": 0}} +{"label": "ctrl2ds", "prompt": "chat", "streams": 4, "aggregate_tps": 190.3, "reps": [111.9, 190.3, 216.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 42.106, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 146, "plain_drafted": 0}} +{"label": "cand2ds", "prompt": "code", "streams": 1, "aggregate_tps": 118.0, "reps": [109.4, 118.0, 118.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.977, "round_gap_p50_ms": 24.99, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 182, "plain_drafted": 0}} +{"label": "cand2ds", "prompt": "code", "streams": 4, "aggregate_tps": 285.7, "reps": [276.8, 285.7, 286.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 37.877, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 182, "plain_drafted": 0}} +{"label": "cand2ds", "prompt": "chat", "streams": 1, "aggregate_tps": 95.3, "reps": [95.3, 93.2, 95.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.438, "round_gap_p50_ms": 25.907, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 143, "plain_drafted": 0}} +{"label": "cand2ds", "prompt": "chat", "streams": 4, "aggregate_tps": 235.7, "reps": [236.0, 235.7, 234.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 37.938, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 143, "plain_drafted": 0}} +{"label": "candplain", "prompt": "code", "streams": 1, "aggregate_tps": 61.1, "reps": [60.9, 61.1, 61.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.195, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "candplain", "prompt": "code", "streams": 4, "aggregate_tps": 223.7, "reps": [218.0, 224.1, 223.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 17.075, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "candplain", "prompt": "chat", "streams": 1, "aggregate_tps": 62.6, "reps": [61.3, 62.6, 62.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.067, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "candplain", "prompt": "chat", "streams": 4, "aggregate_tps": 224.1, "reps": [224.1, 222.8, 225.0], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 17.304, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "ctrlplain", "prompt": "code", "streams": 1, "aggregate_tps": 59.4, "reps": [61.9, 57.8, 59.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.049, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "ctrlplain", "prompt": "code", "streams": 4, "aggregate_tps": 172.8, "reps": [188.5, 172.8, 171.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 18.917, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "ctrlplain", "prompt": "chat", "streams": 1, "aggregate_tps": 50.5, "reps": [50.1, 50.5, 50.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.69, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "ctrlplain", "prompt": "chat", "streams": 4, "aggregate_tps": 214.6, "reps": [191.9, 214.6, 216.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 17.848, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "tensorfold", "prompt": "code", "streams": 1, "aggregate_tps": 100.2, "reps": [99.1, 100.2, 116.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.325, "round_gap_p50_ms": 28.955, "alone": null, "serial": null} +{"label": "tensorfold", "prompt": "code", "streams": 4, "aggregate_tps": 267.9, "reps": [274.3, 267.9, 257.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 39.726, "alone": null, "serial": null} +{"label": "tensorfold", "prompt": "code", "streams": 64, "aggregate_tps": 152.7, "reps": [259.3, 151.4, 152.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 101.291, "alone": null, "serial": null} +{"label": "tensorfold", "prompt": "chat", "streams": 1, "aggregate_tps": 49.0, "reps": [49.0, 57.2, 47.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.51, "round_gap_p50_ms": 36.214, "alone": null, "serial": null} +{"label": "tensorfold", "prompt": "chat", "streams": 4, "aggregate_tps": 94.2, "reps": [94.2, 87.8, 167.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 72.952, "alone": null, "serial": null} +{"label": "tensorfold", "prompt": "chat", "streams": 64, "aggregate_tps": 141.4, "reps": [196.0, 127.4, 141.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 87.113, "alone": null, "serial": null} +{"label": "omlx", "prompt": "code", "streams": 1, "aggregate_tps": 0.0, "reps": [0.0, 0.0, 0.0], "failed": 0, "unmeasured": 3, "tokens_per_round": null, "round_gap_p50_ms": null, "alone": null, "serial": null} +{"label": "omlx", "prompt": "code", "streams": 4, "aggregate_tps": 0.0, "reps": [0.0, 0.0, 0.0], "failed": 0, "unmeasured": 12, "tokens_per_round": null, "round_gap_p50_ms": null, "alone": null, "serial": null} +{"label": "omlx", "prompt": "code", "streams": 64, "aggregate_tps": 0.0, "reps": [0.0, 0.0, 0.0], "failed": 0, "unmeasured": 192, "tokens_per_round": null, "round_gap_p50_ms": null, "alone": null, "serial": null} +{"label": "omlx", "prompt": "chat", "streams": 1, "aggregate_tps": 38.4, "reps": [38.4, 38.0, 38.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 5.689, "round_gap_p50_ms": 145.232, "alone": null, "serial": null} +{"label": "omlx", "prompt": "chat", "streams": 4, "aggregate_tps": 66.2, "reps": [62.5, 66.2, 74.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.004, "round_gap_p50_ms": 102.562, "alone": null, "serial": null} +{"label": "omlx", "prompt": "chat", "streams": 64, "aggregate_tps": 225.6, "reps": [251.8, 221.4, 225.6], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.796, "round_gap_p50_ms": 183.643, "alone": null, "serial": null} diff --git a/docs/receipts/inkling-2-mini-metal-234/prefill45k.txt b/docs/receipts/inkling-2-mini-metal-234/prefill45k.txt new file mode 100644 index 00000000000..7dc2c7a0eee --- /dev/null +++ b/docs/receipts/inkling-2-mini-metal-234/prefill45k.txt @@ -0,0 +1,4 @@ +prompt 46221 ttft 19.51s prefill 2368 tok/s; again ttft 19.47s cached 0 same True +prompt 46190 ttft 19.53s prefill 2365 tok/s; again ttft 20.06s cached 0 same True +prompt 46155 ttft 21.33s prefill 2164 tok/s; again ttft 20.97s cached 0 same True +median prefill 2365 tok/s diff --git a/docs/receipts/inkling-2-mini-metal-234/run.sh b/docs/receipts/inkling-2-mini-metal-234/run.sh new file mode 100755 index 00000000000..3f987e07d92 --- /dev/null +++ b/docs/receipts/inkling-2-mini-metal-234/run.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# run.sh CONTROL_TREE: card 234's window sequence under one lock. CONTROL_TREE is a checkout of the control commit with +# its own `zig build native -Doptimize=ReleaseFast`; this tree is the candidate. ENGINES names card 235's engines.sh. +# Run it as `lockf -k /tmp/tensorfold-model.lock run.sh CONTROL_TREE`. +set -uo pipefail +ctrl=$1 +wt=$(git -C "$(dirname "$0")" rev-parse --show-toplevel) +model=${MODEL:-$HOME/models/Inkling-2-Mini} +r=docs/receipts/inkling-2-mini-metal-210 +step() { echo "== $1 $(date +%T) load: $(sysctl -n vm.loadavg)"; } +step ctrl1ds; "$ctrl/$r/bench.sh" ctrl1ds --drafter "$model" +step cand1ds; "$wt/$r/bench.sh" cand1ds --drafter "$model" +step ctrl2ds; "$ctrl/$r/bench.sh" ctrl2ds --drafter "$model" +step cand2ds; "$wt/$r/bench.sh" cand2ds --drafter "$model" +step candplain; "$wt/$r/bench.sh" candplain +step ctrlplain; "$ctrl/$r/bench.sh" ctrlplain +step prefill; "$wt/$r/prefill.sh" candprefill --drafter "$model" +step engines; "$ENGINES" "$wt/zig-out/native/bin/tensorfold-native" +step done From b5f3d2dbeb09c7b0d36b27f137eae37d66c86d85 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 02:40:59 +0800 Subject: [PATCH 08/22] changelog: card 234's measured DSpark hold lever --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index 59a289c3752..980d227bac7 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -3,4 +3,4 @@ - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. - 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): one session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. -- Speed is not claimed. That session read 123.2 tok/s at one stream and 283.5 total at four on code (card 210: 120.7 / 279.6; #4618: 123 / 281), but it was one rep outside a Mac GPU window, with the voice server on the same GPU and no control beside it. The ceiling, control/candidate/control medians of three, 45K prefill, the real-checkpoint serving tests (`TF_INKLING2_METAL_DIR`, `TF_INKLING2_DSPARK_DIR`) and the 1-and-64-stream receipt against MLX/#4618 wait for a window. +- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9, past #4618's 281; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2, under #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The 1-and-64-stream receipt against oMLX in that window was disturbed by host load and is void. From ac528e76777ded7f3bda7c559e14550c2cbcda6a Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 03:11:58 +0800 Subject: [PATCH 09/22] receipts: card 234's 1 and 64-stream receipt against oMLX --- .../inkling-2-mini-metal-234/README.md | 18 ++++++++++++++---- .../inkling-2-mini-metal-234/cells.jsonl | 12 ++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/receipts/inkling-2-mini-metal-234/README.md b/docs/receipts/inkling-2-mini-metal-234/README.md index 2fc2d40fa58..2dbdec6c47a 100644 --- a/docs/receipts/inkling-2-mini-metal-234/README.md +++ b/docs/receipts/inkling-2-mini-metal-234/README.md @@ -41,11 +41,21 @@ claimed. DSpark's bar is the hold: a round costs 1.74 plain steps at one stream 2,439 without the drafter. Each repeat equals its fresh reply but reads 0 cached tokens with `--drafter`, where card 210's plain session read 46,080: the drafter session does not reuse the prompt cache. -## Engines at 1 and 64 streams: void +## Engines at 1 and 64 streams -Card 235's `engines.sh` ran next (02:12-02:38), when the load average rose from 35 to 72: TensorFold's own one-stream -code cell fell to 100.2 (99-117) from 118-120 minutes earlier, and oMLX's code cells streamed each reply in one chunk -after 13 s, so they are unmeasured. No engine comparison is claimed from it; card 235 owns that receipt. +Card 235's `engines.sh` (TensorFold with DSpark, then oMLX's own 4-bit MTP build `Inkling-2-Mini-oQ4e-mtp`, the +fastest other engine on this Mac), run twice: 02:12-02:38 (load 35 rising to 72) and 02:46-03:11 (load 38-48). Both +ran under other cards' CPU load, so their absolute numbers sit under the clean cells above. oMLX streams each code reply +in one chunk after 13 s, so its code cells are unmeasured in both runs, as in card 235's own; the comparison is on chat. + +| chat, tok/s total | TensorFold, run 1 / 2 | oMLX, run 1 / 2 | +|---|---|---| +| 1 stream | **49.0 / 48.0** | 38.4 / 24.8 | +| 64 streams | 141.4 / 154.8 | **225.6 / 203.3** | + +- One stream: TensorFold leads in both runs. 64 streams: oMLX leads by 31-60%; TensorFold is not the fastest here. +- TensorFold's code cells (no oMLX number to set against): 100.2 / 115.8 at one stream, 152.7 / 203.8 at 64. +- 0 failed requests in every cell of both engines. ## Files diff --git a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl index 945329b85c1..e283c2a4c84 100644 --- a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl +++ b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl @@ -34,3 +34,15 @@ {"label": "omlx", "prompt": "chat", "streams": 1, "aggregate_tps": 38.4, "reps": [38.4, 38.0, 38.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 5.689, "round_gap_p50_ms": 145.232, "alone": null, "serial": null} {"label": "omlx", "prompt": "chat", "streams": 4, "aggregate_tps": 66.2, "reps": [62.5, 66.2, 74.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.004, "round_gap_p50_ms": 102.562, "alone": null, "serial": null} {"label": "omlx", "prompt": "chat", "streams": 64, "aggregate_tps": 225.6, "reps": [251.8, 221.4, 225.6], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.796, "round_gap_p50_ms": 183.643, "alone": null, "serial": null} +{"label": "tensorfold-2", "prompt": "code", "streams": 1, "aggregate_tps": 115.8, "reps": [112.0, 115.8, 118.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.459, "round_gap_p50_ms": 30.367} +{"label": "tensorfold-2", "prompt": "code", "streams": 4, "aggregate_tps": 216.5, "reps": [217.2, 183.4, 216.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 43.814} +{"label": "tensorfold-2", "prompt": "code", "streams": 64, "aggregate_tps": 203.8, "reps": [253.9, 177.8, 203.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 91.378} +{"label": "tensorfold-2", "prompt": "chat", "streams": 1, "aggregate_tps": 48.0, "reps": [48.0, 50.7, 34.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.415, "round_gap_p50_ms": 64.141} +{"label": "tensorfold-2", "prompt": "chat", "streams": 4, "aggregate_tps": 86.6, "reps": [72.2, 86.6, 163.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 77.491} +{"label": "tensorfold-2", "prompt": "chat", "streams": 64, "aggregate_tps": 154.8, "reps": [176.3, 154.8, 142.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 92.897} +{"label": "omlx-2", "prompt": "code", "streams": 1, "aggregate_tps": 0.0, "reps": [0.0, 0.0, 0.0], "failed": 0, "unmeasured": 3, "tokens_per_round": null, "round_gap_p50_ms": null} +{"label": "omlx-2", "prompt": "code", "streams": 4, "aggregate_tps": 0.0, "reps": [0.0, 0.0, 0.0], "failed": 0, "unmeasured": 12, "tokens_per_round": null, "round_gap_p50_ms": null} +{"label": "omlx-2", "prompt": "code", "streams": 64, "aggregate_tps": 0.0, "reps": [0.0, 0.0, 0.0], "failed": 0, "unmeasured": 192, "tokens_per_round": null, "round_gap_p50_ms": null} +{"label": "omlx-2", "prompt": "chat", "streams": 1, "aggregate_tps": 24.8, "reps": [23.5, 24.8, 40.0], "failed": 0, "unmeasured": 0, "tokens_per_round": 5.02, "round_gap_p50_ms": 172.387} +{"label": "omlx-2", "prompt": "chat", "streams": 4, "aggregate_tps": 35.6, "reps": [43.2, 35.6, 26.1], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.004, "round_gap_p50_ms": 165.604} +{"label": "omlx-2", "prompt": "chat", "streams": 64, "aggregate_tps": 203.3, "reps": [157.0, 206.6, 203.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.796, "round_gap_p50_ms": 215.899} From 844ae1a23951e528ee3269c2f85c01e3c25dd6c8 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 03:11:58 +0800 Subject: [PATCH 10/22] changelog: card 234's receipt against oMLX --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index 980d227bac7..6db362947fc 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -3,4 +3,4 @@ - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. - 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): one session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. -- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9, past #4618's 281; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2, under #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The 1-and-64-stream receipt against oMLX in that window was disturbed by host load and is void. +- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9, past #4618's 281; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2, under #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. Against oMLX's 4-bit MTP build on the same Mac, two loaded runs on the chat prompt: TensorFold leads at one stream (49.0 / 48.0 against 38.4 / 24.8 tok/s), oMLX at 64 (225.6 / 203.3 against 141.4 / 154.8). From 29ff045050884bafdca5f211be64985369315c75 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 03:56:54 +0800 Subject: [PATCH 11/22] receipts: card 234's measured bandwidth ceiling and 64-lane receipt against oMLX --- .../inkling-2-mini-metal-234/README.md | 33 +++++++++++-------- .../inkling-2-mini-metal-234/bandwidth.py | 27 +++++++++++++++ .../inkling-2-mini-metal-234/cells.jsonl | 6 ++++ .../inkling-2-mini-metal-234/engines.sh | 16 +++++++++ docs/receipts/inkling-2-mini-metal-234/run.sh | 8 ++--- 5 files changed, 72 insertions(+), 18 deletions(-) create mode 100644 docs/receipts/inkling-2-mini-metal-234/bandwidth.py create mode 100755 docs/receipts/inkling-2-mini-metal-234/engines.sh diff --git a/docs/receipts/inkling-2-mini-metal-234/README.md b/docs/receipts/inkling-2-mini-metal-234/README.md index 2dbdec6c47a..82e24b79076 100644 --- a/docs/receipts/inkling-2-mini-metal-234/README.md +++ b/docs/receipts/inkling-2-mini-metal-234/README.md @@ -11,9 +11,12 @@ histories in place; every stream's keep shares one command buffer). ## Ceiling A plain step reads about 5.6 GB: 8 of 128 experts (5.1 MB each) in 48 layer passes (24 layers, the 12 core ones three -times) is 1.96 GB, the other layer weights 2.7 GB over the same passes, the bf16 LM head 0.93 GB. Card 210's 16.1 ms -plain step is 350 GB/s; the M5 Ultra's bandwidth was not measured in this window, so the percentage of ceiling is not -claimed. DSpark's bar is the hold: a round costs 1.74 plain steps at one stream and 2.24 at four. +times) is 1.96 GB, the other layer weights 2.7 GB over the same passes, the bf16 LM head 0.93 GB. `bandwidth.py` +measured this GPU at 744-951 GB/s reading, 573-991 adding and 388-966 copying over 4 GiB arrays (three runs, 03:46, +load 51-55), so ~900 GB/s: a plain step's floor is 6.2 ms, 161 tok/s, and at a practical 75% of it 120 tok/s. The +16.1 ms plain step (62 tok/s) is 38% of the floor and 52% of the practical ceiling; DSpark at one stream, 3.33 tokens a +28.2 ms round, is 22% of its 3.33 × 161 bound. Bytes do not set the step: its dependent chain of kernels does, so the +hold lever cuts launches and waits, not reads. ## DSpark hold lever @@ -43,21 +46,23 @@ claimed. DSpark's bar is the hold: a round costs 1.74 plain steps at one stream ## Engines at 1 and 64 streams -Card 235's `engines.sh` (TensorFold with DSpark, then oMLX's own 4-bit MTP build `Inkling-2-Mini-oQ4e-mtp`, the -fastest other engine on this Mac), run twice: 02:12-02:38 (load 35 rising to 72) and 02:46-03:11 (load 38-48). Both -ran under other cards' CPU load, so their absolute numbers sit under the clean cells above. oMLX streams each code reply -in one chunk after 13 s, so its code cells are unmeasured in both runs, as in card 235's own; the comparison is on chat. +oMLX's own 4-bit MTP build `Inkling-2-Mini-oQ4e-mtp`, the fastest other engine on this Mac, from card 235's +`engines.sh`; TensorFold from `engines.sh` here, DSpark on 64 lanes. Card 235's script started TensorFold on its +default 8 lanes, so at 64 streams 56 requests queued (168 of 192 waited 10-55 s) and read 141.4 / 154.8; that is fixed +here, and no request queued. All runs were under other cards' CPU load (35-77). oMLX streams each code reply in one +chunk after 13 s, so its code cells are unmeasured in every run, card 235's too; the comparison is on chat. -| chat, tok/s total | TensorFold, run 1 / 2 | oMLX, run 1 / 2 | +| chat, tok/s total | TensorFold, 64 lanes (03:47-03:53) | oMLX (02:25 / 03:00) | |---|---|---| -| 1 stream | **49.0 / 48.0** | 38.4 / 24.8 | -| 64 streams | 141.4 / 154.8 | **225.6 / 203.3** | +| 1 stream | **90.2** (89.5-91.5) | 38.4 / 24.8 | +| 64 streams | **306.6** (229.4-311.2) | 225.6 / 203.3 | -- One stream: TensorFold leads in both runs. 64 streams: oMLX leads by 31-60%; TensorFold is not the fastest here. -- TensorFold's code cells (no oMLX number to set against): 100.2 / 115.8 at one stream, 152.7 / 203.8 at 64. +- TensorFold leads at both: 2.3× at one stream, 1.36-1.51× at 64. +- TensorFold's code cells in the same session: 115.4 at one stream (96.5-117.7), 239.8 at four (194.3-273.5, load + 60-77, under the clean 282.7-285.7 above), 399.1 at 64 (309.3-456.4). - 0 failed requests in every cell of both engines. ## Files -`cells.jsonl`: every cell (medians, reps, round, `alone`, `serial`); `prefill45k.txt`; `run.sh` reproduces the -sequence. +`cells.jsonl`: every cell (medians, reps, round, `alone`, `serial`); `prefill45k.txt`; `bandwidth.py` measures the +ceiling's bandwidth; `engines.sh` runs TensorFold's receipt cells; `run.sh` reproduces the sequence. diff --git a/docs/receipts/inkling-2-mini-metal-234/bandwidth.py b/docs/receipts/inkling-2-mini-metal-234/bandwidth.py new file mode 100644 index 00000000000..27b326b56ba --- /dev/null +++ b/docs/receipts/inkling-2-mini-metal-234/bandwidth.py @@ -0,0 +1,27 @@ +# bandwidth.py: the GPU's streaming bandwidth over 4 GiB arrays, medians of six timed passes. Run it with an MLX Python +# (oMLX's venv has one) under `lockf -k /tmp/tensorfold-model.lock`. +import statistics +import time + +import mlx.core as mx + +n = 1 << 30 +a = mx.random.uniform(shape=(n,)) +b = mx.random.uniform(shape=(n,)) +mx.eval(a, b) + + +def rate(fn, bytes_moved, reps=7): + ts = [] + for _ in range(reps): + mx.synchronize() + t = time.perf_counter() + mx.eval(fn()) + mx.synchronize() + ts.append(time.perf_counter() - t) + return bytes_moved / statistics.median(ts[1:]) / 1e9 + + +print(f"read (sum) {rate(lambda: a.sum(), 4 * n):.0f} GB/s") +print(f"add (2R+1W) {rate(lambda: a + b, 12 * n):.0f} GB/s") +print(f"copy (1R+1W) {rate(lambda: a * 1.0, 8 * n):.0f} GB/s") diff --git a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl index e283c2a4c84..da3fe9e2ea5 100644 --- a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl +++ b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl @@ -46,3 +46,9 @@ {"label": "omlx-2", "prompt": "chat", "streams": 1, "aggregate_tps": 24.8, "reps": [23.5, 24.8, 40.0], "failed": 0, "unmeasured": 0, "tokens_per_round": 5.02, "round_gap_p50_ms": 172.387} {"label": "omlx-2", "prompt": "chat", "streams": 4, "aggregate_tps": 35.6, "reps": [43.2, 35.6, 26.1], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.004, "round_gap_p50_ms": 165.604} {"label": "omlx-2", "prompt": "chat", "streams": 64, "aggregate_tps": 203.3, "reps": [157.0, 206.6, 203.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.796, "round_gap_p50_ms": 215.899} +{"label": "tensorfold64", "prompt": "code", "streams": 1, "aggregate_tps": 115.4, "reps": [96.5, 117.7, 115.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.368, "round_gap_p50_ms": 29.145} +{"label": "tensorfold64", "prompt": "code", "streams": 4, "aggregate_tps": 239.8, "reps": [239.8, 273.5, 194.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 39.687} +{"label": "tensorfold64", "prompt": "code", "streams": 64, "aggregate_tps": 399.1, "reps": [456.4, 399.1, 309.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 121.998} +{"label": "tensorfold64", "prompt": "chat", "streams": 1, "aggregate_tps": 90.2, "reps": [89.5, 90.2, 91.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.438, "round_gap_p50_ms": 28.002} +{"label": "tensorfold64", "prompt": "chat", "streams": 4, "aggregate_tps": 221.8, "reps": [221.8, 186.3, 224.1], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 39.692} +{"label": "tensorfold64", "prompt": "chat", "streams": 64, "aggregate_tps": 306.6, "reps": [229.4, 306.6, 311.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.02, "round_gap_p50_ms": 163.319} diff --git a/docs/receipts/inkling-2-mini-metal-234/engines.sh b/docs/receipts/inkling-2-mini-metal-234/engines.sh new file mode 100755 index 00000000000..660092c8bdf --- /dev/null +++ b/docs/receipts/inkling-2-mini-metal-234/engines.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# engines.sh: TensorFold with DSpark at 1, 4 and 64 streams, greedy, 3 reps, on 64 lanes (the default 8 queues the rest). +# Card 235's engines.sh runs oMLX the same way. Run it under `lockf -k /tmp/tensorfold-model.lock`. +set -euo pipefail +wt=$(git -C "$(dirname "$0")" rev-parse --show-toplevel) +model=${MODEL:-$HOME/models/Inkling-2-Mini} +out=${OUT:-/tmp/ink2-bench} +mkdir -p "$out" +[ -e /Users/Shared/agent-work/mac-gpu-window ] || { echo "no Mac GPU window" >&2; exit 3; } +"$wt/zig-out/native/bin/tensorfold-native" serve "$model" --port 18234 --context 65536 --parallel 64 --drafter "$model" \ + >"$out/tensorfold64.server.log" 2>&1 & +pid=$! +trap 'kill -INT $pid 2>/dev/null; wait $pid 2>/dev/null' EXIT +for _ in $(seq 300); do curl -sf http://127.0.0.1:18234/v1/models >/dev/null && break; sleep 1; done +/opt/homebrew/bin/python3.13 "$wt/tools/bench_concurrent.py" http://127.0.0.1:18234 Inkling-2-Mini \ + --levels 1,4,64 --reps 3 --tokens 256 --temperatures 0 --label tensorfold64 --output "$out/tensorfold64.json" 2>&1 | cut -c1-120 diff --git a/docs/receipts/inkling-2-mini-metal-234/run.sh b/docs/receipts/inkling-2-mini-metal-234/run.sh index 3f987e07d92..ff1e8755d89 100755 --- a/docs/receipts/inkling-2-mini-metal-234/run.sh +++ b/docs/receipts/inkling-2-mini-metal-234/run.sh @@ -1,8 +1,8 @@ #!/bin/bash # run.sh CONTROL_TREE: card 234's window sequence under one lock. CONTROL_TREE is a checkout of the control commit with -# its own `zig build native -Doptimize=ReleaseFast`; this tree is the candidate. ENGINES names card 235's engines.sh. -# Run it as `lockf -k /tmp/tensorfold-model.lock run.sh CONTROL_TREE`. -set -uo pipefail +# its own `zig build native -Doptimize=ReleaseFast`; this tree is the candidate. oMLX's cells come from card 235's +# engines.sh. Run it as `lockf -k /tmp/tensorfold-model.lock run.sh CONTROL_TREE`. +set -euo pipefail ctrl=$1 wt=$(git -C "$(dirname "$0")" rev-parse --show-toplevel) model=${MODEL:-$HOME/models/Inkling-2-Mini} @@ -15,5 +15,5 @@ step cand2ds; "$wt/$r/bench.sh" cand2ds --drafter "$model" step candplain; "$wt/$r/bench.sh" candplain step ctrlplain; "$ctrl/$r/bench.sh" ctrlplain step prefill; "$wt/$r/prefill.sh" candprefill --drafter "$model" -step engines; "$ENGINES" "$wt/zig-out/native/bin/tensorfold-native" +step engines; "$wt/docs/receipts/inkling-2-mini-metal-234/engines.sh" step done From 66bb3d1d133156742c3c00d61078e74424e0d690 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 03:56:54 +0800 Subject: [PATCH 12/22] changelog: card 234's ceiling and 64-lane receipt --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index 6db362947fc..bb4bc60006e 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -3,4 +3,4 @@ - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. - 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): one session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. -- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9, past #4618's 281; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2, under #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. Against oMLX's 4-bit MTP build on the same Mac, two loaded runs on the chat prompt: TensorFold leads at one stream (49.0 / 48.0 against 38.4 / 24.8 tok/s), oMLX at 64 (225.6 / 203.3 against 141.4 / 154.8). +- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9, past #4618's 281; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2, under #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured ~900 GB/s, so a plain step's floor is 161 tok/s and the 62 measured is 38% of it. Against oMLX's 4-bit MTP build on the same Mac, chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). From 9022541dfd7807caa6240638e556376dc85fd2f7 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 05:06:59 +0800 Subject: [PATCH 13/22] receipts: card 234's plain control/candidate/control and bandwidth timings --- .../inkling-2-mini-metal-234/README.md | 33 ++++++++++++++----- .../inkling-2-mini-metal-234/bandwidth.py | 11 ++++--- .../inkling-2-mini-metal-234/cells.jsonl | 12 +++++++ 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/docs/receipts/inkling-2-mini-metal-234/README.md b/docs/receipts/inkling-2-mini-metal-234/README.md index 82e24b79076..97f68943a2f 100644 --- a/docs/receipts/inkling-2-mini-metal-234/README.md +++ b/docs/receipts/inkling-2-mini-metal-234/README.md @@ -11,12 +11,19 @@ histories in place; every stream's keep shares one command buffer). ## Ceiling A plain step reads about 5.6 GB: 8 of 128 experts (5.1 MB each) in 48 layer passes (24 layers, the 12 core ones three -times) is 1.96 GB, the other layer weights 2.7 GB over the same passes, the bf16 LM head 0.93 GB. `bandwidth.py` -measured this GPU at 744-951 GB/s reading, 573-991 adding and 388-966 copying over 4 GiB arrays (three runs, 03:46, -load 51-55), so ~900 GB/s: a plain step's floor is 6.2 ms, 161 tok/s, and at a practical 75% of it 120 tok/s. The -16.1 ms plain step (62 tok/s) is 38% of the floor and 52% of the practical ceiling; DSpark at one stream, 3.33 tokens a -28.2 ms round, is 22% of its 3.33 × 161 bound. Bytes do not set the step: its dependent chain of kernels does, so the -hold lever cuts launches and waits, not reads. +times) is 1.96 GB, the other layer weights 2.7 GB over the same passes, the bf16 LM head 0.93 GB. `bandwidth.py` over +4 GiB arrays, six timed passes each, at 05:04 (load 123, the GPU otherwise idle): + +| pass | GB/s (median) | ms a pass | +|---|---|---| +| read (sum) | 1,021 | 4.20 4.14 4.15 5.59 4.22 4.26 | +| add (2R+1W) | 1,029 | 13.18 12.89 12.52 12.53 12.45 12.36 | +| copy (1R+1W) | 1,004 | 8.48 8.55 8.53 8.59 8.56 8.56 | + +Three earlier runs at 03:46, beside other cards' GPU work, read 388-991 and are not used. At 1,020 GB/s a plain step's +floor is 5.5 ms, 182 tok/s, and at a practical 75% of it 137 tok/s. The 16.1 ms plain step (62 tok/s) is 34% of the +floor; DSpark at one stream, 3.33 tokens a 28.2 ms round, is 20% of its 3.33 × 182 bound. Bytes do not set the step: +its dependent chain of kernels does, so the hold lever cuts launches and waits, not reads. ## DSpark hold lever @@ -34,8 +41,18 @@ hold lever cuts launches and waits, not reads. clean control by 2.6-3.5%, a round is 1 ms shorter at the same 2.81 tokens. - At one stream it is inside noise (118.0-120.2 against 118.9-122.2) and under #4618's 123: not beaten. It passes Strata v0.2.19's 108.9-114.5 on M5 Max on code (another chip: a deployment comparison). -- Plain, candidate: 61.1 / 62.6 at one stream, 223.7 / 224.1 at four, as card 210's 61.0-62.3 / 216-221. The plain - control beside it was disturbed (reps 188/173/171, 50/51/51) and is not used. +- Plain, 05:00-05:04, control / candidate / control with the load average at 80, 90 and 127: + + | plain, tok/s (code / chat) | control | candidate | control | + |---|---|---|---| + | 1 stream | 51.9 / 55.5 | 52.0 / 60.1 | 60.4 / 50.4 | + | 4 streams | 205.0 / 169.7 | 159.0 / 179.1 | 204.9 / 155.7 | + | round p50, 1 / 4 streams, code | 16.9 / 18.2 ms | 16.7 / 18.3 ms | 16.4 / 18.1 ms | + + Host load moved single reps by up to 40% (control code at four streams: 205.0, 127.2, 209.5), so the medians cannot + separate the builds; the per-round time, which the load does not reach, can: it is equal within 0.5 ms at both + stream counts, as the lever only touches the drafted path. The earlier candidate cells (61.1 / 62.6 and 223.7 / 224.1 + at load 9) match card 210's 61.0-62.3 / 216-221. - Every cell: 0 failed requests, every concurrent reply equal to its run alone (12 of 12), drafted equal to plain. ## Prefill at 45K diff --git a/docs/receipts/inkling-2-mini-metal-234/bandwidth.py b/docs/receipts/inkling-2-mini-metal-234/bandwidth.py index 27b326b56ba..18a4b8a2c25 100644 --- a/docs/receipts/inkling-2-mini-metal-234/bandwidth.py +++ b/docs/receipts/inkling-2-mini-metal-234/bandwidth.py @@ -11,7 +11,7 @@ mx.eval(a, b) -def rate(fn, bytes_moved, reps=7): +def report(name, fn, bytes_moved, reps=7): ts = [] for _ in range(reps): mx.synchronize() @@ -19,9 +19,10 @@ def rate(fn, bytes_moved, reps=7): mx.eval(fn()) mx.synchronize() ts.append(time.perf_counter() - t) - return bytes_moved / statistics.median(ts[1:]) / 1e9 + ms = " ".join(f"{t * 1e3:.2f}" for t in ts[1:]) + print(f"{name:13s}{bytes_moved / statistics.median(ts[1:]) / 1e9:5.0f} GB/s ms: {ms}") -print(f"read (sum) {rate(lambda: a.sum(), 4 * n):.0f} GB/s") -print(f"add (2R+1W) {rate(lambda: a + b, 12 * n):.0f} GB/s") -print(f"copy (1R+1W) {rate(lambda: a * 1.0, 8 * n):.0f} GB/s") +report("read (sum)", lambda: a.sum(), 4 * n) +report("add (2R+1W)", lambda: a + b, 12 * n) +report("copy (1R+1W)", lambda: a * 1.0, 8 * n) diff --git a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl index da3fe9e2ea5..35c695c1a2b 100644 --- a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl +++ b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl @@ -52,3 +52,15 @@ {"label": "tensorfold64", "prompt": "chat", "streams": 1, "aggregate_tps": 90.2, "reps": [89.5, 90.2, 91.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.438, "round_gap_p50_ms": 28.002} {"label": "tensorfold64", "prompt": "chat", "streams": 4, "aggregate_tps": 221.8, "reps": [221.8, 186.3, 224.1], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 39.692} {"label": "tensorfold64", "prompt": "chat", "streams": 64, "aggregate_tps": 306.6, "reps": [229.4, 306.6, 311.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.02, "round_gap_p50_ms": 163.319} +{"label": "ctrl1plain", "prompt": "code", "streams": 1, "aggregate_tps": 51.9, "reps": [43.5, 60.1, 51.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.94, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "ctrl1plain", "prompt": "code", "streams": 4, "aggregate_tps": 205.0, "reps": [205.0, 127.2, 209.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 18.184, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "ctrl1plain", "prompt": "chat", "streams": 1, "aggregate_tps": 55.5, "reps": [55.5, 47.3, 55.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.635, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "ctrl1plain", "prompt": "chat", "streams": 4, "aggregate_tps": 169.7, "reps": [174.8, 169.7, 133.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 18.309, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "cand1plain", "prompt": "code", "streams": 1, "aggregate_tps": 52.0, "reps": [52.0, 59.6, 50.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.713, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "cand1plain", "prompt": "code", "streams": 4, "aggregate_tps": 159.0, "reps": [165.3, 159.0, 157.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 18.259, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "cand1plain", "prompt": "chat", "streams": 1, "aggregate_tps": 60.1, "reps": [48.9, 60.1, 60.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.661, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "cand1plain", "prompt": "chat", "streams": 4, "aggregate_tps": 179.1, "reps": [170.7, 191.4, 179.1], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 18.248, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "ctrl2plain", "prompt": "code", "streams": 1, "aggregate_tps": 60.4, "reps": [60.4, 60.5, 60.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.434, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "ctrl2plain", "prompt": "code", "streams": 4, "aggregate_tps": 204.9, "reps": [204.9, 139.8, 208.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 18.114, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "ctrl2plain", "prompt": "chat", "streams": 1, "aggregate_tps": 50.4, "reps": [29.8, 50.4, 54.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.78, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "ctrl2plain", "prompt": "chat", "streams": 4, "aggregate_tps": 155.7, "reps": [159.3, 148.4, 155.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 18.68, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} From 1038e2d4b0970ee28abcc929cea58e5c7654cedc Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 05:06:59 +0800 Subject: [PATCH 14/22] changelog: card 234's measured bandwidth and plain rounds --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index bb4bc60006e..f907787426c 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -3,4 +3,4 @@ - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. - 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): one session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. -- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9, past #4618's 281; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2, under #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured ~900 GB/s, so a plain step's floor is 161 tok/s and the 62 measured is 38% of it. Against oMLX's 4-bit MTP build on the same Mac, chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). +- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9, past #4618's 281; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2, under #4618's 123. Plain rounds are equal to the controls' within 0.5 ms at one and four streams. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). From f9d67456c9804a37a10b634bd297834c6edec053 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 05:24:04 +0800 Subject: [PATCH 15/22] receipts: card 234 states the one-stream bar is not reached, no #4618 claim --- .../234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 2 +- docs/receipts/inkling-2-mini-metal-234/README.md | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index f907787426c..cc22504e7b7 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -3,4 +3,4 @@ - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. - 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): one session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. -- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9, past #4618's 281; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2, under #4618's 123. Plain rounds are equal to the controls' within 0.5 ms at one and four streams. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). +- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2. Bar not reached: one stream reads 118.0-120.2 tok/s at `1038e2d4` against #4618's 123. Plain rounds are equal to the controls' within 0.5 ms at one and four streams. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). diff --git a/docs/receipts/inkling-2-mini-metal-234/README.md b/docs/receipts/inkling-2-mini-metal-234/README.md index 97f68943a2f..cec168adf38 100644 --- a/docs/receipts/inkling-2-mini-metal-234/README.md +++ b/docs/receipts/inkling-2-mini-metal-234/README.md @@ -37,10 +37,11 @@ its dependent chain of kernels does, so the hold lever cuts launches and waits, \* reps 81/32/46 and 112/190/216: disturbed, not used. -- At four streams the lever is kept: code beats both controls by 2.5-3.9% and #4618's 281 by 0.6-1.7%, chat beats the - clean control by 2.6-3.5%, a round is 1 ms shorter at the same 2.81 tokens. -- At one stream it is inside noise (118.0-120.2 against 118.9-122.2) and under #4618's 123: not beaten. It passes - Strata v0.2.19's 108.9-114.5 on M5 Max on code (another chip: a deployment comparison). +- At four streams the lever is kept: code is 2.5-3.9% over both controls, chat 2.6-3.5% over the clean control, a + round is 1 ms shorter at the same 2.81 tokens. #4618 reads 281 there. +- At one stream it is inside noise (118.0-120.2 against 118.9-122.2). Bar not reached: one stream reads 118.0-120.2 + tok/s at `1038e2d4` against #4618's 123. Strata v0.2.19 reads 108.9-114.5 on M5 Max, another chip: a deployment + comparison, not a chip one. - Plain, 05:00-05:04, control / candidate / control with the load average at 80, 90 and 127: | plain, tok/s (code / chat) | control | candidate | control | @@ -74,7 +75,7 @@ chunk after 13 s, so its code cells are unmeasured in every run, card 235's too; | 1 stream | **90.2** (89.5-91.5) | 38.4 / 24.8 | | 64 streams | **306.6** (229.4-311.2) | 225.6 / 203.3 | -- TensorFold leads at both: 2.3× at one stream, 1.36-1.51× at 64. +- TensorFold leads at both against oMLX's 4-bit build: 2.3× at one stream, 1.36-1.51× at 64. - TensorFold's code cells in the same session: 115.4 at one stream (96.5-117.7), 239.8 at four (194.3-273.5, load 60-77, under the clean 282.7-285.7 above), 399.1 at 64 (309.3-456.4). - 0 failed requests in every cell of both engines. From fd362e7baee5bc72eab502c58c0002b5bb33b7e5 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 10:32:59 +0800 Subject: [PATCH 16/22] inkling2 metal: a verify that fails after its forward rolls back to an untouched cache, beside a planted stale history --- .../families/inkling2/metal/serving_test.zig | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/zig/src/families/inkling2/metal/serving_test.zig b/zig/src/families/inkling2/metal/serving_test.zig index d84b47b4982..113cacf3c32 100644 --- a/zig/src/families/inkling2/metal/serving_test.zig +++ b/zig/src/families/inkling2/metal/serving_test.zig @@ -248,6 +248,56 @@ fn transactions(dir: []const u8, drafter_dir: []const u8, ids: []const u32, want try std.testing.expectEqualSlices(u8, &want.continuation_tap, &(try featureRow(target_b, &s, ids.len + 15))); } +/// A stream's next-row logits as the cache holds them, for a bitwise comparison. +fn nextLogits(target: *backend.Metal, s: *lanes.Stream) []const u8 { + return target.caches.get(s).?.logits.slice(u8, st.vocabulary * 4); +} + +test "Mini Metal: a verify that fails after its forward rolls back to a cache the next decode cannot tell apart" { + const dir = try checkpoint(); + const ids = prompt(64, 9); + const model = try Model.load(gpa, io, dir); + defer model.deinit(); + const target = try backend.Metal.init(gpa, model, .{ .capacity = context, .streams = 3, .budget = 3 * st.cacheBytes(context) }); + defer target.deinit(); + const b = target.backend(); + var streams: [3]lanes.Stream = undefined; + for (&streams, [_][]const u8{ "clean", "failed", "stale" }) |*s, id| { + s.* = try lanes.Stream.init(gpa, .{ .id = id, .prompt = &ids, .max_new = made, .drafts = true }); + try b.prefill(s); + } + defer for (&streams) |*s| { + b.release(s); + s.deinit(gpa); + }; + const clean, const failed, const stale = .{ &streams[0], &streams[1], &streams[2] }; + const first = try b.read(try b.first(clean, ids.len)); + const wrong = (first + 1) % model.config.text.unpadded_vocab; + + // Every row's mask is empty: the draw fails after the forward has staged the window's taps on the GPU. + const drafts = [_]u32{ wrong, wrong, wrong }; + const positions = [_]u64{ ids.len + 1, ids.len + 2, ids.len + 3, ids.len + 4 }; + const masks = try gpa.alloc(u32, positions.len * ((model.config.text.vocab + 31) / 32)); + defer gpa.free(masks); + @memset(masks, 0); + const window = [_]lanes.backend.Window{.{ .stream = failed, .pending = wrong, .held = 0, .tokens = &drafts, .parents = null, .positions = &positions, .masks = masks }}; + var sampled: [4]u32 = undefined; + var echo: [3]u32 = undefined; + var out = [_]lanes.backend.Verified{.{ .sampled = &sampled, .drafts = &echo }}; + try std.testing.expectError(error.InklingEmptyTokenMask, b.verify(&window, &out)); + + // The planted control: a forward outside any window writes its histories, and only the length is wound back. + const stale_cache = target.caches.get(stale).?; + _ = try b.queue(stale, .{ .value = wrong }, ids.len + 1); + stale_cache.len -= 1; + + _ = try b.queue(clean, .{ .value = first }, ids.len + 1); + _ = try b.queue(failed, .{ .value = first }, ids.len + 1); + _ = try b.queue(stale, .{ .value = first }, ids.len + 1); + try std.testing.expectEqualSlices(u8, nextLogits(target, clean), nextLogits(target, failed)); + try std.testing.expect(!std.mem.eql(u8, nextLogits(target, clean), nextLogits(target, stale))); +} + test "Mini Metal serving matches the host reference token for token" { const dir = try checkpoint(); const ids = prompt(history, 1); From ea3f266573a9aa01bb96bc6ed450b068d1393488 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 10:32:59 +0800 Subject: [PATCH 17/22] receipts: card 234's run.sh runs the plain controls and bandwidth; plain parity and the competitor named as measured --- .../receipts/inkling-2-mini-metal-234/README.md | 17 ++++++++++------- docs/receipts/inkling-2-mini-metal-234/run.sh | 8 ++++++-- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/docs/receipts/inkling-2-mini-metal-234/README.md b/docs/receipts/inkling-2-mini-metal-234/README.md index cec168adf38..84a96e595c2 100644 --- a/docs/receipts/inkling-2-mini-metal-234/README.md +++ b/docs/receipts/inkling-2-mini-metal-234/README.md @@ -50,10 +50,11 @@ its dependent chain of kernels does, so the hold lever cuts launches and waits, | 4 streams | 205.0 / 169.7 | 159.0 / 179.1 | 204.9 / 155.7 | | round p50, 1 / 4 streams, code | 16.9 / 18.2 ms | 16.7 / 18.3 ms | 16.4 / 18.1 ms | - Host load moved single reps by up to 40% (control code at four streams: 205.0, 127.2, 209.5), so the medians cannot - separate the builds; the per-round time, which the load does not reach, can: it is equal within 0.5 ms at both - stream counts, as the lever only touches the drafted path. The earlier candidate cells (61.1 / 62.6 and 223.7 / 224.1 - at load 9) match card 210's 61.0-62.3 / 216-221. + Host load moved single reps by up to 40% (control code at four streams: 205.0, 127.2, 209.5), so these medians do + not establish throughput parity between the builds; the lever only touches the drafted path, and the per-round p50 + above is a hint, not a throughput result. A repeat of these three cells under stable load is pending the next Mac + GPU window. The earlier candidate cells (61.1 / 62.6 and 223.7 / 224.1 at load 9) match card 210's 61.0-62.3 / + 216-221. - Every cell: 0 failed requests, every concurrent reply equal to its run alone (12 of 12), drafted equal to plain. ## Prefill at 45K @@ -64,7 +65,8 @@ its dependent chain of kernels does, so the hold lever cuts launches and waits, ## Engines at 1 and 64 streams -oMLX's own 4-bit MTP build `Inkling-2-Mini-oQ4e-mtp`, the fastest other engine on this Mac, from card 235's +oMLX's own 4-bit MTP build `Inkling-2-Mini-oQ4e-mtp`, the fastest measured competitor (Strata and llama.cpp were not +measured on this Mac, and the oMLX cells come from earlier sessions than TensorFold's), from card 235's `engines.sh`; TensorFold from `engines.sh` here, DSpark on 64 lanes. Card 235's script started TensorFold on its default 8 lanes, so at 64 streams 56 requests queued (168 of 192 waited 10-55 s) and read 141.4 / 154.8; that is fixed here, and no request queued. All runs were under other cards' CPU load (35-77). oMLX streams each code reply in one @@ -75,7 +77,7 @@ chunk after 13 s, so its code cells are unmeasured in every run, card 235's too; | 1 stream | **90.2** (89.5-91.5) | 38.4 / 24.8 | | 64 streams | **306.6** (229.4-311.2) | 225.6 / 203.3 | -- TensorFold leads at both against oMLX's 4-bit build: 2.3× at one stream, 1.36-1.51× at 64. +- TensorFold leads at both against oMLX's 4-bit build, across sessions: 2.3× at one stream, 1.36-1.51× at 64. - TensorFold's code cells in the same session: 115.4 at one stream (96.5-117.7), 239.8 at four (194.3-273.5, load 60-77, under the clean 282.7-285.7 above), 399.1 at 64 (309.3-456.4). - 0 failed requests in every cell of both engines. @@ -83,4 +85,5 @@ chunk after 13 s, so its code cells are unmeasured in every run, card 235's too; ## Files `cells.jsonl`: every cell (medians, reps, round, `alone`, `serial`); `prefill45k.txt`; `bandwidth.py` measures the -ceiling's bandwidth; `engines.sh` runs TensorFold's receipt cells; `run.sh` reproduces the sequence. +ceiling's bandwidth; `engines.sh` runs TensorFold's receipt cells; `run.sh` reproduces the sequence: bandwidth, DSpark +and plain control/candidate/control, prefill and engines. diff --git a/docs/receipts/inkling-2-mini-metal-234/run.sh b/docs/receipts/inkling-2-mini-metal-234/run.sh index ff1e8755d89..25184a807e8 100755 --- a/docs/receipts/inkling-2-mini-metal-234/run.sh +++ b/docs/receipts/inkling-2-mini-metal-234/run.sh @@ -1,19 +1,23 @@ #!/bin/bash # run.sh CONTROL_TREE: card 234's window sequence under one lock. CONTROL_TREE is a checkout of the control commit with # its own `zig build native -Doptimize=ReleaseFast`; this tree is the candidate. oMLX's cells come from card 235's -# engines.sh. Run it as `lockf -k /tmp/tensorfold-model.lock run.sh CONTROL_TREE`. +# engines.sh; MLX_PYTHON is a Python with MLX for the bandwidth ceiling. Run it as +# `lockf -k /tmp/tensorfold-model.lock run.sh CONTROL_TREE`. set -euo pipefail ctrl=$1 wt=$(git -C "$(dirname "$0")" rev-parse --show-toplevel) model=${MODEL:-$HOME/models/Inkling-2-Mini} +mlx=${MLX_PYTHON:-$HOME/models/mlxref/bin/python3} r=docs/receipts/inkling-2-mini-metal-210 step() { echo "== $1 $(date +%T) load: $(sysctl -n vm.loadavg)"; } +step bandwidth; "$mlx" "$wt/docs/receipts/inkling-2-mini-metal-234/bandwidth.py" step ctrl1ds; "$ctrl/$r/bench.sh" ctrl1ds --drafter "$model" step cand1ds; "$wt/$r/bench.sh" cand1ds --drafter "$model" step ctrl2ds; "$ctrl/$r/bench.sh" ctrl2ds --drafter "$model" step cand2ds; "$wt/$r/bench.sh" cand2ds --drafter "$model" +step ctrl1plain; "$ctrl/$r/bench.sh" ctrl1plain step candplain; "$wt/$r/bench.sh" candplain -step ctrlplain; "$ctrl/$r/bench.sh" ctrlplain +step ctrl2plain; "$ctrl/$r/bench.sh" ctrl2plain step prefill; "$wt/$r/prefill.sh" candprefill --drafter "$model" step engines; "$wt/docs/receipts/inkling-2-mini-metal-234/engines.sh" step done From f8b9b3c0a7902e68c3a3ac88237ac453e43cdb00 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 10:32:59 +0800 Subject: [PATCH 18/22] changelog: card 234's rollback test, 64-lane exactness and plain parity scoped --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index cc22504e7b7..a105134e800 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -1,6 +1,6 @@ # Inkling 2 Mini on Metal: a DSpark round stops saving its convolution histories -- A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. +- A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. A real-checkpoint test fails a verify after its forward and checks the next decode's logits equal an untouched stream's bit for bit, beside a planted stale-history stream that differs. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. -- 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): one session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. -- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2. Bar not reached: one stream reads 118.0-120.2 tok/s at `1038e2d4` against #4618's 123. Plain rounds are equal to the controls' within 0.5 ms at one and four streams. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). +- 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): a separate session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone; the committed 64-lane receipt cells carry no such check. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. +- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2. Bar not reached: one stream reads 118.0-120.2 tok/s at `1038e2d4` against #4618's 123. Plain control/candidate/control ran under host load that moved single reps by up to 40%, so plain throughput parity is not established; its repeat under stable load waits for the next window. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, the fastest measured competitor (from earlier sessions), chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). From f1f03a5dcee30318d4178b640bf2199a6203a610 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 11:15:34 +0800 Subject: [PATCH 19/22] receipts: card 234's control/candidate/control repeat in its own Mac window --- .../inkling-2-mini-metal-234/README.md | 40 +++++++++++----- .../inkling-2-mini-metal-234/cells.jsonl | 48 +++++++++++++++++++ 2 files changed, 75 insertions(+), 13 deletions(-) diff --git a/docs/receipts/inkling-2-mini-metal-234/README.md b/docs/receipts/inkling-2-mini-metal-234/README.md index 84a96e595c2..db0374a3dd2 100644 --- a/docs/receipts/inkling-2-mini-metal-234/README.md +++ b/docs/receipts/inkling-2-mini-metal-234/README.md @@ -42,21 +42,35 @@ its dependent chain of kernels does, so the hold lever cuts launches and waits, - At one stream it is inside noise (118.0-120.2 against 118.9-122.2). Bar not reached: one stream reads 118.0-120.2 tok/s at `1038e2d4` against #4618's 123. Strata v0.2.19 reads 108.9-114.5 on M5 Max, another chip: a deployment comparison, not a chip one. -- Plain, 05:00-05:04, control / candidate / control with the load average at 80, 90 and 127: - - | plain, tok/s (code / chat) | control | candidate | control | - |---|---|---|---| - | 1 stream | 51.9 / 55.5 | 52.0 / 60.1 | 60.4 / 50.4 | - | 4 streams | 205.0 / 169.7 | 159.0 / 179.1 | 204.9 / 155.7 | - | round p50, 1 / 4 streams, code | 16.9 / 18.2 ms | 16.7 / 18.3 ms | 16.4 / 18.1 ms | - - Host load moved single reps by up to 40% (control code at four streams: 205.0, 127.2, 209.5), so these medians do - not establish throughput parity between the builds; the lever only touches the drafted path, and the per-round p50 - above is a hint, not a throughput result. A repeat of these three cells under stable load is pending the next Mac - GPU window. The earlier candidate cells (61.1 / 62.6 and 223.7 / 224.1 at load 9) match card 210's 61.0-62.3 / - 216-221. +- Plain at 05:00-05:04 (load 80-127) moved single reps by up to 40%; its repeat is below. - Every cell: 0 failed requests, every concurrent reply equal to its run alone (12 of 12), drafted equal to plain. +## Repeat, 24 Nov 11:02-11:09 + +A second Desk window for this card alone, idle GPU, load 3-20; candidate `f8b9b3c0a` (the lever plus its rollback +test), control `781eeab52`, both built before the first bench, one lock over the six sessions. The two controls agree +within 0.3% in every cell but plain chat at four streams. + +| tok/s (code / chat) | control | candidate | control | +|---|---|---|---| +| DSpark, 1 stream | 126.6 / 93.0 | 124.3 / 95.3 | 126.8 / 92.9 | +| DSpark, 4 streams | 282.1 / 229.3 | **288.0 / 237.3** | 281.4 / 228.9 | +| DSpark 4-stream round, code | 38.8 ms | 37.9 ms | 38.6 ms | +| plain, 1 stream | 61.6 / 61.0 | 60.1 / 59.8 | 61.5 / 56.3 | +| plain, 4 streams | 210.2 / 223.0 | 221.5 / 221.0 | 210.0 / 126.4* | + +\* reps 110.4/192.6/126.4: disturbed, not used. + +- The lever repeats at four streams: code 2.1-2.3% and chat 3.5-3.7% over both controls, a round 0.7-0.9 ms shorter. +- At one stream it gains nothing: code 124.3 (reps 127.4, 116.2, 124.3) against 126.6-126.8, chat 95.3 against 93. +- Plain is at parity, which the lever's path predicts (it only touches a verify window): code 60.1 against 61.5-61.6 + at one stream and 221.5 against 210.0-210.2 at four, chat 59.8 and 221.0 against the clean control's 61.0 and 223.0. +- #4618 reports 123 at one stream and 281 at four; it was not run on this Mac, so these medians are not a claim to + beat it. At this window's low load the controls already read 126.6-126.8 at one stream. +- A second candidate pass at 11:09-11:14 ran as load rose to 50 (DSpark four-stream code reps 282.4, 252.5, 238.6; + plain reps down to 41) and is not used. Every cell of both passes: 0 failed requests, every concurrent reply equal + to its run alone, drafted equal to plain. + ## Prefill at 45K `prefill.sh` with the drafter on: **2,365 tok/s** median (2,164-2,368), first token in 19.5-21.3 s; card 210 read diff --git a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl index 35c695c1a2b..b401baf2c39 100644 --- a/docs/receipts/inkling-2-mini-metal-234/cells.jsonl +++ b/docs/receipts/inkling-2-mini-metal-234/cells.jsonl @@ -64,3 +64,51 @@ {"label": "ctrl2plain", "prompt": "code", "streams": 4, "aggregate_tps": 204.9, "reps": [204.9, 139.8, 208.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 18.114, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} {"label": "ctrl2plain", "prompt": "chat", "streams": 1, "aggregate_tps": 50.4, "reps": [29.8, 50.4, 54.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.78, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} {"label": "ctrl2plain", "prompt": "chat", "streams": 4, "aggregate_tps": 155.7, "reps": [159.3, 148.4, 155.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 18.68, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-ctrl1ds", "prompt": "code", "streams": 1, "aggregate_tps": 126.6, "reps": [126.6, 126.0, 127.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.325, "round_gap_p50_ms": 26.531, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 176, "plain_drafted": 0}} +{"label": "w-ctrl1ds", "prompt": "code", "streams": 4, "aggregate_tps": 282.1, "reps": [282.1, 282.4, 282.0], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 38.763, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 176, "plain_drafted": 0}} +{"label": "w-ctrl1ds", "prompt": "chat", "streams": 1, "aggregate_tps": 93.0, "reps": [95.1, 93.0, 92.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.349, "round_gap_p50_ms": 25.636, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 147, "plain_drafted": 0}} +{"label": "w-ctrl1ds", "prompt": "chat", "streams": 4, "aggregate_tps": 229.3, "reps": [229.3, 230.2, 227.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 39.01, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 147, "plain_drafted": 0}} +{"label": "w-cand1ds", "prompt": "code", "streams": 1, "aggregate_tps": 124.3, "reps": [127.4, 116.2, 124.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.241, "round_gap_p50_ms": 26.013, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 176, "plain_drafted": 0}} +{"label": "w-cand1ds", "prompt": "code", "streams": 4, "aggregate_tps": 288.0, "reps": [287.2, 288.0, 288.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 37.904, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 176, "plain_drafted": 0}} +{"label": "w-cand1ds", "prompt": "chat", "streams": 1, "aggregate_tps": 95.3, "reps": [94.6, 95.3, 99.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.438, "round_gap_p50_ms": 25.981, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 146, "plain_drafted": 0}} +{"label": "w-cand1ds", "prompt": "chat", "streams": 4, "aggregate_tps": 237.3, "reps": [237.5, 236.6, 237.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 37.808, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 146, "plain_drafted": 0}} +{"label": "w-ctrl2ds", "prompt": "code", "streams": 1, "aggregate_tps": 126.8, "reps": [121.0, 126.8, 127.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.325, "round_gap_p50_ms": 26.606, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 178, "plain_drafted": 0}} +{"label": "w-ctrl2ds", "prompt": "code", "streams": 4, "aggregate_tps": 281.4, "reps": [281.8, 281.2, 281.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 38.633, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 178, "plain_drafted": 0}} +{"label": "w-ctrl2ds", "prompt": "chat", "streams": 1, "aggregate_tps": 92.9, "reps": [97.4, 92.9, 92.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.286, "round_gap_p50_ms": 25.123, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 145, "plain_drafted": 0}} +{"label": "w-ctrl2ds", "prompt": "chat", "streams": 4, "aggregate_tps": 228.9, "reps": [229.4, 228.6, 228.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 38.984, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 145, "plain_drafted": 0}} +{"label": "w-cand2ds", "prompt": "code", "streams": 1, "aggregate_tps": 122.6, "reps": [119.9, 122.6, 125.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.241, "round_gap_p50_ms": 26.823, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 174, "plain_drafted": 0}} +{"label": "w-cand2ds", "prompt": "code", "streams": 4, "aggregate_tps": 252.5, "reps": [282.4, 252.5, 238.6], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 39.802, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 174, "plain_drafted": 0}} +{"label": "w-cand2ds", "prompt": "chat", "streams": 1, "aggregate_tps": 74.2, "reps": [73.0, 77.8, 74.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.226, "round_gap_p50_ms": 23.618, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 153, "plain_drafted": 0}} +{"label": "w-cand2ds", "prompt": "chat", "streams": 4, "aggregate_tps": 228.5, "reps": [229.4, 193.5, 228.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 38.848, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 153, "plain_drafted": 0}} +{"label": "w-ctrl1plain", "prompt": "code", "streams": 1, "aggregate_tps": 61.6, "reps": [59.9, 61.6, 61.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.144, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-ctrl1plain", "prompt": "code", "streams": 4, "aggregate_tps": 210.2, "reps": [210.2, 221.2, 206.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 17.902, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-ctrl1plain", "prompt": "chat", "streams": 1, "aggregate_tps": 61.0, "reps": [59.8, 61.0, 61.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.404, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-ctrl1plain", "prompt": "chat", "streams": 4, "aggregate_tps": 223.0, "reps": [220.0, 223.0, 224.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 17.429, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-candplain", "prompt": "code", "streams": 1, "aggregate_tps": 60.1, "reps": [60.1, 59.7, 60.7], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.437, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-candplain", "prompt": "code", "streams": 4, "aggregate_tps": 221.5, "reps": [223.6, 198.6, 221.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 17.342, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-candplain", "prompt": "chat", "streams": 1, "aggregate_tps": 59.8, "reps": [59.8, 60.1, 54.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.321, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-candplain", "prompt": "chat", "streams": 4, "aggregate_tps": 221.0, "reps": [217.5, 226.4, 221.0], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 17.148, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-ctrl2plain", "prompt": "code", "streams": 1, "aggregate_tps": 61.5, "reps": [60.7, 61.9, 61.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.048, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-ctrl2plain", "prompt": "code", "streams": 4, "aggregate_tps": 210.0, "reps": [210.0, 221.3, 203.3], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 17.617, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-ctrl2plain", "prompt": "chat", "streams": 1, "aggregate_tps": 56.3, "reps": [62.8, 56.3, 53.1], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.077, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-ctrl2plain", "prompt": "chat", "streams": 4, "aggregate_tps": 126.4, "reps": [110.4, 192.6, 126.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 20.392, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-cand2plain", "prompt": "code", "streams": 1, "aggregate_tps": 49.9, "reps": [41.1, 50.2, 49.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.42, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-cand2plain", "prompt": "code", "streams": 4, "aggregate_tps": 183.8, "reps": [147.2, 216.3, 183.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 17.576, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-cand2plain", "prompt": "chat", "streams": 1, "aggregate_tps": 59.5, "reps": [41.0, 59.5, 61.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.613, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-cand2plain", "prompt": "chat", "streams": 4, "aggregate_tps": 141.9, "reps": [134.2, 141.9, 188.0], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 22.563, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-ctrl3plain", "prompt": "code", "streams": 1, "aggregate_tps": 48.9, "reps": [48.9, 55.3, 45.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 17.735, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-ctrl3plain", "prompt": "code", "streams": 4, "aggregate_tps": 205.2, "reps": [126.7, 205.2, 208.1], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 18.507, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-ctrl3plain", "prompt": "chat", "streams": 1, "aggregate_tps": 48.1, "reps": [41.3, 48.1, 55.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 19.41, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-ctrl3plain", "prompt": "chat", "streams": 4, "aggregate_tps": 175.2, "reps": [129.7, 201.7, 175.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 18.81, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-cand2ds", "prompt": "code", "streams": 1, "aggregate_tps": 122.6, "reps": [119.9, 122.6, 125.4], "failed": 0, "unmeasured": 0, "tokens_per_round": 3.241, "round_gap_p50_ms": 26.823, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 174, "plain_drafted": 0}} +{"label": "w-cand2ds", "prompt": "code", "streams": 4, "aggregate_tps": 252.5, "reps": [282.4, 252.5, 238.6], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.813, "round_gap_p50_ms": 39.802, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 174, "plain_drafted": 0}} +{"label": "w-cand2ds", "prompt": "chat", "streams": 1, "aggregate_tps": 74.2, "reps": [73.0, 77.8, 74.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.226, "round_gap_p50_ms": 23.618, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 153, "plain_drafted": 0}} +{"label": "w-cand2ds", "prompt": "chat", "streams": 4, "aggregate_tps": 228.5, "reps": [229.4, 193.5, 228.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 2.327, "round_gap_p50_ms": 38.848, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 153, "plain_drafted": 0}} +{"label": "w-cand2plain", "prompt": "code", "streams": 1, "aggregate_tps": 49.9, "reps": [41.1, 50.2, 49.9], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 16.42, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-cand2plain", "prompt": "code", "streams": 4, "aggregate_tps": 183.8, "reps": [147.2, 216.3, 183.8], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 17.576, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-cand2plain", "prompt": "chat", "streams": 1, "aggregate_tps": 59.5, "reps": [41.0, 59.5, 61.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 16.613, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-cand2plain", "prompt": "chat", "streams": 4, "aggregate_tps": 141.9, "reps": [134.2, 141.9, 188.0], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 22.563, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-ctrl3plain", "prompt": "code", "streams": 1, "aggregate_tps": 48.9, "reps": [48.9, 55.3, 45.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 17.735, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-ctrl3plain", "prompt": "code", "streams": 4, "aggregate_tps": 205.2, "reps": [126.7, 205.2, 208.1], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.0, "round_gap_p50_ms": 18.507, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 0, "plain_drafted": 0, "vacuous": "the drafted runs accepted no draft"}} +{"label": "w-ctrl3plain", "prompt": "chat", "streams": 1, "aggregate_tps": 48.1, "reps": [41.3, 48.1, 55.5], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 19.41, "alone": {"equal": 3, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} +{"label": "w-ctrl3plain", "prompt": "chat", "streams": 4, "aggregate_tps": 175.2, "reps": [129.7, 201.7, 175.2], "failed": 0, "unmeasured": 0, "tokens_per_round": 1.032, "round_gap_p50_ms": 18.81, "alone": {"equal": 12, "unequal": 0, "failed": 0}, "serial": {"equal": 1, "unequal": 0, "failed": 0, "accepted": 3, "plain_drafted": 0}} From 371a7becdfb3026a8ed181f22d599435ce36a53a Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 11:15:34 +0800 Subject: [PATCH 20/22] changelog: card 234's window repeat, four-stream gain and plain parity --- changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index a105134e800..d84d2576771 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -3,4 +3,5 @@ - A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. A real-checkpoint test fails a verify after its forward and checks the next decode's logits equal an untouched stream's bit for bit, beside a planted stale-history stream that differs. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. - 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): a separate session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone; the committed 64-lane receipt cells carry no such check. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. -- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2. Bar not reached: one stream reads 118.0-120.2 tok/s at `1038e2d4` against #4618's 123. Plain control/candidate/control ran under host load that moved single reps by up to 40%, so plain throughput parity is not established; its repeat under stable load waits for the next window. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, the fastest measured competitor (from earlier sessions), chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). +- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2. Bar not reached: one stream reads 118.0-120.2 tok/s at `1038e2d4` against #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, the fastest measured competitor (from earlier sessions), chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). +- A repeat in a window for this card alone (load 3-20, controls within 0.3% of each other) at `f8b9b3c0a` against `781eeab52`: DSpark at four streams reads 288.0 / 237.3 tok/s (code / chat) against 281.4-282.1 / 228.9-229.3 and a round is 0.7-0.9 ms shorter; at one stream it gains nothing (124.3 against 126.6-126.8 on code). Plain is at parity: 60.1 and 221.5 on code at one and four streams against 61.5-61.6 and 210.0-210.2. #4618 was not run on this Mac, so this is not a claim to beat it. From c553ad91024a8a7df340b04571fd1745f26d48b4 Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:18:11 +0800 Subject: [PATCH 21/22] inkling2 metal: the rollback test checks an open verify window leaves the convolution histories untouched --- .../families/inkling2/metal/serving_test.zig | 38 ++++++++++++++++--- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/zig/src/families/inkling2/metal/serving_test.zig b/zig/src/families/inkling2/metal/serving_test.zig index 113cacf3c32..defe898ac64 100644 --- a/zig/src/families/inkling2/metal/serving_test.zig +++ b/zig/src/families/inkling2/metal/serving_test.zig @@ -253,7 +253,23 @@ fn nextLogits(target: *backend.Metal, s: *lanes.Stream) []const u8 { return target.caches.get(s).?.logits.slice(u8, st.vocabulary * 4); } -test "Mini Metal: a verify that fails after its forward rolls back to a cache the next decode cannot tell apart" { +/// A shared copy of a cache's convolution histories. +fn histories(model: *const Model, cache: *const st.Cache) !mtl.Buffer { + const out = try model.device.buffer(st.conv_bytes, mtl.ResourceOptions.shared); + errdefer out.deinit(); + const pool = mtl.objc.Pool.push(); + defer pool.pop(); + const cb = model.queue.commandBuffer(); + const e = cb.blit(); + e.copy(cache.conv, 0, out, 0, st.conv_bytes); + e.end(); + cb.commit(); + cb.wait(); + if (cb.failure() != null) return error.GpuFailed; + return out; +} + +test "Mini Metal: an open verify window leaves the histories untouched, and one that fails rolls back to a cache the next decode cannot tell apart" { const dir = try checkpoint(); const ids = prompt(64, 9); const model = try Model.load(gpa, io, dir); @@ -273,17 +289,27 @@ test "Mini Metal: a verify that fails after its forward rolls back to a cache th const clean, const failed, const stale = .{ &streams[0], &streams[1], &streams[2] }; const first = try b.read(try b.first(clean, ids.len)); const wrong = (first + 1) % model.config.text.unpadded_vocab; - - // Every row's mask is empty: the draw fails after the forward has staged the window's taps on the GPU. const drafts = [_]u32{ wrong, wrong, wrong }; const positions = [_]u64{ ids.len + 1, ids.len + 2, ids.len + 3, ids.len + 4 }; + var sampled: [4]u32 = undefined; + var echo: [3]u32 = undefined; + var out = [_]lanes.backend.Verified{.{ .sampled = &sampled, .drafts = &echo }}; + + // An open window has run its forward but staged its taps aside: the histories are those before it. + const failed_cache = target.caches.get(failed).?; + const before = try histories(model, failed_cache); + defer before.deinit(); + try b.verify(&.{.{ .stream = failed, .pending = wrong, .held = 0, .tokens = &drafts, .parents = null, .positions = &positions, .masks = &.{} }}, &out); + const open = try histories(model, failed_cache); + defer open.deinit(); + try std.testing.expectEqualSlices(u8, before.slice(u8, st.conv_bytes), open.slice(u8, st.conv_bytes)); + failed_cache.rollback(); + + // Every row's mask is empty: the draw fails after the forward has staged the window's taps on the GPU. const masks = try gpa.alloc(u32, positions.len * ((model.config.text.vocab + 31) / 32)); defer gpa.free(masks); @memset(masks, 0); const window = [_]lanes.backend.Window{.{ .stream = failed, .pending = wrong, .held = 0, .tokens = &drafts, .parents = null, .positions = &positions, .masks = masks }}; - var sampled: [4]u32 = undefined; - var echo: [3]u32 = undefined; - var out = [_]lanes.backend.Verified{.{ .sampled = &sampled, .drafts = &echo }}; try std.testing.expectError(error.InklingEmptyTokenMask, b.verify(&window, &out)); // The planted control: a forward outside any window writes its histories, and only the length is wound back. From 226a1b959baa8ae98b79e2fb7ef170c3dbbf29fb Mon Sep 17 00:00:00 2001 From: netrunner <299844489+plotarmordev@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:18:11 +0800 Subject: [PATCH 22/22] receipts: card 234 marks the plain-chat controls disturbed and reports paired engine medians --- ...nkling-2-mini-on-mac-beat-4618-on-m5-ul.md | 6 ++-- .../inkling-2-mini-metal-234/README.md | 35 +++++++++---------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md index d84d2576771..9996a5bf3c6 100644 --- a/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md +++ b/changelog.d/234-inkling-2-mini-on-mac-beat-4618-on-m5-ul.md @@ -1,7 +1,7 @@ # Inkling 2 Mini on Metal: a DSpark round stops saving its convolution histories -- A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. A real-checkpoint test fails a verify after its forward and checks the next decode's logits equal an untouched stream's bit for bit, beside a planted stale-history stream that differs. +- A verify window no longer copies a stream's 1.9 MB of convolution histories aside before its forward and back after a rejection: the forward leaves the histories alone while a window is open, and the keep takes them from the staged taps of the rows it keeps. Every stream's keep shares one command buffer and one wait a round, where each stream had its own before the forward and one more after a rejection; a stream's cache is 1.9 MB smaller. A real-checkpoint test checks an open window leaves the histories byte for byte as before it, then fails a verify after its forward and checks the next decode's logits equal an untouched stream's bit for bit, beside a planted stale-history stream that differs. - Exactness on the official checkpoint, M5 Ultra, at `62559184d` (card 210's base merged in, with its drafted lone-copy pricing): the Metal greedy gate passes against the float64 host reference (0 of 32 tokens differ, `zig build test-inkling2-metal-float64`), and one DSpark server session at 1 and 4 streams on the code and chat prompts had 0 failed requests, every concurrent reply equal to its run alone (10 of 10) and every drafted reply equal to its plain one, with 176 and 154 drafts accepted. - 64 streams hold on one DSpark server (`--parallel 64`, 65,536-token context): a separate session of 32-token replies on the code and chat prompts had 0 failed requests and all 128 concurrent replies equal to their runs alone; the committed 64-lane receipt cells carry no such check. Past the drafter's reach the lanes decode one token a round, 64 rows over two 32-row batches, at 273 tok/s total on code and 246 on chat: one rep, outside a window. -- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2. Bar not reached: one stream reads 118.0-120.2 tok/s at `1038e2d4` against #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, the fastest measured competitor (from earlier sessions), chat prompt, TensorFold on 64 lanes leads at one stream (90.2 against 38.4 / 24.8 tok/s) and at 64 (306.6 against 225.6 / 203.3). -- A repeat in a window for this card alone (load 3-20, controls within 0.3% of each other) at `f8b9b3c0a` against `781eeab52`: DSpark at four streams reads 288.0 / 237.3 tok/s (code / chat) against 281.4-282.1 / 228.9-229.3 and a round is 0.7-0.9 ms shorter; at one stream it gains nothing (124.3 against 126.6-126.8 on code). Plain is at parity: 60.1 and 221.5 on code at one and four streams against 61.5-61.6 and 210.0-210.2. #4618 was not run on this Mac, so this is not a claim to beat it. +- Measured in the Desk's Mac GPU window against card 210's tip, control/candidate/control/candidate, medians of three (`docs/receipts/inkling-2-mini-metal-234`): with DSpark at four streams a round is 1 ms shorter and code reads 282.7 and 285.7 tok/s against 275.7 and 274.9; chat 233.6 and 235.7 against 227.7. At one stream it is inside noise, 118.0-120.2 against 118.9-122.2. Bar not reached: one stream reads 118.0-120.2 tok/s at `1038e2d4` against #4618's 123. Every cell had 0 failed requests and replies equal to their runs alone; 45K prefill reads 2,365 tok/s. The GPU measured 1,020 GB/s, so a plain step's floor is 182 tok/s and the 62 measured is 34% of it. Against oMLX's 4-bit MTP build on the same Mac, the only competitor measured there, paired medians on the chat prompt with TensorFold on 8 lanes: 49.0 against 38.4 tok/s at one stream, 141.4 against oMLX's 225.6 at 64. +- A repeat in a window for this card alone (load 3-20) at `f8b9b3c0a` against `781eeab52`, controls within 0.3% of each other except plain chat, which is disturbed and not compared: DSpark at four streams reads 288.0 / 237.3 tok/s (code / chat) against 281.4-282.1 / 228.9-229.3 and a round is 0.7-0.9 ms shorter; at one stream it gains nothing (124.3 against 126.6-126.8 on code). Plain code reads 60.1 and 221.5 at one and four streams against 61.5-61.6 and 210.0-210.2. #4618 was not run on this Mac, so this is not a claim to beat it. diff --git a/docs/receipts/inkling-2-mini-metal-234/README.md b/docs/receipts/inkling-2-mini-metal-234/README.md index db0374a3dd2..00aa63c9206 100644 --- a/docs/receipts/inkling-2-mini-metal-234/README.md +++ b/docs/receipts/inkling-2-mini-metal-234/README.md @@ -49,22 +49,22 @@ its dependent chain of kernels does, so the hold lever cuts launches and waits, A second Desk window for this card alone, idle GPU, load 3-20; candidate `f8b9b3c0a` (the lever plus its rollback test), control `781eeab52`, both built before the first bench, one lock over the six sessions. The two controls agree -within 0.3% in every cell but plain chat at four streams. +within 0.3% in every cell but plain chat. | tok/s (code / chat) | control | candidate | control | |---|---|---|---| | DSpark, 1 stream | 126.6 / 93.0 | 124.3 / 95.3 | 126.8 / 92.9 | | DSpark, 4 streams | 282.1 / 229.3 | **288.0 / 237.3** | 281.4 / 228.9 | | DSpark 4-stream round, code | 38.8 ms | 37.9 ms | 38.6 ms | -| plain, 1 stream | 61.6 / 61.0 | 60.1 / 59.8 | 61.5 / 56.3 | -| plain, 4 streams | 210.2 / 223.0 | 221.5 / 221.0 | 210.0 / 126.4* | +| plain, 1 stream | 61.6 / 61.0* | 60.1 / 59.8 | 61.5 / 56.3* | +| plain, 4 streams | 210.2 / 223.0* | 221.5 / 221.0 | 210.0 / 126.4* | -\* reps 110.4/192.6/126.4: disturbed, not used. +\* plain chat: the controls are 8% apart at one stream and 43% at four (reps 110.4/192.6/126.4), so both pairs are +disturbed and plain chat is not compared. - The lever repeats at four streams: code 2.1-2.3% and chat 3.5-3.7% over both controls, a round 0.7-0.9 ms shorter. - At one stream it gains nothing: code 124.3 (reps 127.4, 116.2, 124.3) against 126.6-126.8, chat 95.3 against 93. -- Plain is at parity, which the lever's path predicts (it only touches a verify window): code 60.1 against 61.5-61.6 - at one stream and 221.5 against 210.0-210.2 at four, chat 59.8 and 221.0 against the clean control's 61.0 and 223.0. +- Plain code reads 60.1 against 61.5-61.6 at one stream and 221.5 against 210.0-210.2 at four. - #4618 reports 123 at one stream and 281 at four; it was not run on this Mac, so these medians are not a claim to beat it. At this window's low load the controls already read 126.6-126.8 at one stream. - A second candidate pass at 11:09-11:14 ran as load rose to 50 (DSpark four-stream code reps 282.4, 252.5, 238.6; @@ -79,21 +79,20 @@ within 0.3% in every cell but plain chat at four streams. ## Engines at 1 and 64 streams -oMLX's own 4-bit MTP build `Inkling-2-Mini-oQ4e-mtp`, the fastest measured competitor (Strata and llama.cpp were not -measured on this Mac, and the oMLX cells come from earlier sessions than TensorFold's), from card 235's -`engines.sh`; TensorFold from `engines.sh` here, DSpark on 64 lanes. Card 235's script started TensorFold on its -default 8 lanes, so at 64 streams 56 requests queued (168 of 192 waited 10-55 s) and read 141.4 / 154.8; that is fixed -here, and no request queued. All runs were under other cards' CPU load (35-77). oMLX streams each code reply in one -chunk after 13 s, so its code cells are unmeasured in every run, card 235's too; the comparison is on chat. +oMLX's own 4-bit MTP build `Inkling-2-Mini-oQ4e-mtp` is the only competitor measured on this Mac (Strata and +llama.cpp were not). Card 235's `engines.sh` ran both engines in one session, TensorFold on its default 8 lanes, under +other cards' CPU load (35-77). oMLX streams each code reply in one chunk after 13 s, so its code cells are unmeasured; +the comparison is on chat. -| chat, tok/s total | TensorFold, 64 lanes (03:47-03:53) | oMLX (02:25 / 03:00) | +| chat, tok/s total, paired medians | TensorFold, 8 lanes | oMLX | |---|---|---| -| 1 stream | **90.2** (89.5-91.5) | 38.4 / 24.8 | -| 64 streams | **306.6** (229.4-311.2) | 225.6 / 203.3 | +| 1 stream | **49.0** | 38.4 | +| 64 streams | 141.4 | **225.6** | -- TensorFold leads at both against oMLX's 4-bit build, across sessions: 2.3× at one stream, 1.36-1.51× at 64. -- TensorFold's code cells in the same session: 115.4 at one stream (96.5-117.7), 239.8 at four (194.3-273.5, load - 60-77, under the clean 282.7-285.7 above), 399.1 at 64 (309.3-456.4). +- oMLX leads at 64 streams: on 8 lanes, 56 of TensorFold's 64 requests queued (168 of 192 waited 10-55 s). A second + paired session read 48.0 against 24.8 and 154.8 against 203.3. +- Unpaired, no oMLX in its session: `engines.sh` here, DSpark on 64 lanes with no request queued, read chat 90.2 at + one stream and 306.6 at 64, code 115.4 and 399.1. - 0 failed requests in every cell of both engines. ## Files