From 84872da33ca09e81a77e70cee7cd0cd29246225b Mon Sep 17 00:00:00 2001 From: Nipale-ai <236170788+Nipale-ai@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:50:33 +0100 Subject: [PATCH 1/6] exl3: a column view that launches the parent's plan Weight.pinnedColumns is columns with the parent's (sk, wk) fixed, so each column keeps the bits the whole matrix gives it. columns is unchanged. --- zig/src/cuda/exl3.zig | 9 +++++++++ zig/src/cuda/exl3_dense_test.zig | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/zig/src/cuda/exl3.zig b/zig/src/cuda/exl3.zig index e98b7dd8001..3def1bf9dd4 100644 --- a/zig/src/cuda/exl3.zig +++ b/zig/src/cuda/exl3.zig @@ -138,6 +138,15 @@ pub const Weight = struct { if (w.bias != 0) v.bias = w.bias + @as(u64, from) * 2; return v; } + + /// `columns` that launches the parent's (sk, wk) as it plans for the whole matrix, so each column keeps its bits. + pub fn pinnedColumns(w: Weight, from: u32, n: u32) !Weight { + var v = try w.columns(from, n); + const p = planOf(w); + v.sk = p.sk; + v.wk = p.wk; + return v; + } }; /// A weight's launch: the family's fixed (sk, wk) when given, else plan()'s; either is the shape's alone. diff --git a/zig/src/cuda/exl3_dense_test.zig b/zig/src/cuda/exl3_dense_test.zig index ca992a9b8ad..9c5f86fdf3f 100644 --- a/zig/src/cuda/exl3_dense_test.zig +++ b/zig/src/cuda/exl3_dense_test.zig @@ -98,3 +98,27 @@ test "pick: linear_wc, then the mid-M kernels from min_rows; the linear below th fixed.wk = 8; try std.testing.expect(exl3.pick(fixed, 64, true, true, 17).? == .linear); // (unregistered forms otherwise) } + +test "pinnedColumns launches the parent's plan where columns plans its own shape" { + const whole = weight(5120, 12288, 8); // q_proj of the 27B: 1 split, 8 warps; its half plans 4 splits, 4 warps + const p = exl3.planOf(whole); + const own = try whole.columns(6144, 6144); + try expectEqual(@as(u32, 0), own.sk); + try std.testing.expect(exl3.planOf(own).sk != p.sk and exl3.planOf(own).wk != p.wk); + const pinned = try whole.pinnedColumns(6144, 6144); + try expectEqual(p.sk, exl3.planOf(pinned).sk); + try expectEqual(p.wk, exl3.planOf(pinned).wk); + var same = pinned; // the same view of the same columns, only the plan fixed + same.sk = 0; + same.wk = 0; + try expectEqual(own, same); + try std.testing.expect(exl3.pick(pinned, 64, true, true, 17).? == .linear); // a fixed plan keeps the linear + var fixed = whole; // a parent that is itself pinned hands its own plan on + fixed.sk = 2; + fixed.wk = 4; + const view = try fixed.pinnedColumns(128, 256); + try expectEqual(@as(u32, 2), exl3.planOf(view).sk); + try expectEqual(@as(u32, 4), exl3.planOf(view).wk); + try std.testing.expectError(error.Exl3Shape, whole.pinnedColumns(64, 128)); + try std.testing.expectError(error.Exl3Shape, whole.pinnedColumns(12160, 256)); +} From a331e2448a3f7e216a991656c7aa6becbd4ce479 Mon Sep 17 00:00:00 2001 From: Nipale-ai <236170788+Nipale-ai@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:50:33 +0100 Subject: [PATCH 2/6] qwen3_5 cuda shard: hidden rows for o_proj, out_proj and down_proj Share.hidden is hidden over the world in 128-tiles, refused as NotOnTiles where it would leave them. o, out and the k part of mlp now say they are where a rank's part sits in the gathered input, not cuts of those weights. --- zig/src/families/qwen3_5/cuda_shard.zig | 37 ++++++++++++++++--- .../families/qwen3_5/cuda_shard_decl_test.zig | 5 ++- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/zig/src/families/qwen3_5/cuda_shard.zig b/zig/src/families/qwen3_5/cuda_shard.zig index 44c328f0980..de169324c76 100644 --- a/zig/src/families/qwen3_5/cuda_shard.zig +++ b/zig/src/families/qwen3_5/cuda_shard.zig @@ -33,19 +33,20 @@ pub const Shape = struct { v_heads: usize, // linear-attention value heads }; -/// One rank's spans, each in its weight's own rows (a row-split weight's are columns); even shares, no rank larger. +/// One rank's spans: rows of the weights it cuts, or where its part sits in a gathered input (o, out, mlp). pub const Share = struct { rank: usize, world: usize, q: Span, // q_proj rows: whole query heads, each head's q and gate rows together kv: Span, // k_proj and v_proj rows: whole KV heads; past kv_heads ranks one head is kept by its query ranks - o: Span, // o_proj columns (k): the attention width of the same query heads + o: Span, // where this rank's query heads sit in o_proj's gathered input (k); o_proj is cut by `hidden` qkv: [3]Span, // in_proj_qkv rows: its q, k and v segments each cut evenly, at their offsets z: Span, // in_proj_z rows: whole value heads heads: Span, // in_proj_a and in_proj_b rows, A_log and dt_bias: the same value heads - out: Span, // out_proj columns (k): the value heads of z - mlp: Span, // gate_proj and up_proj rows, and down_proj columns + out: Span, // where this rank's value heads sit in out_proj's gathered input (k); out_proj is cut by `hidden` + mlp: Span, // gate_proj and up_proj rows; and where this rank's rows sit in down_proj's gathered input (k) vocab: Span, // lm_head rows + hidden: Span, // o_proj, out_proj and down_proj rows (n): hidden over the world, each reading its whole k /// Rank `rank` of `world`; refused where a count does not split evenly or a cut would leave the 128-tiles. pub fn of(s: Shape, rank: usize, world: usize) Error!Share { @@ -57,6 +58,7 @@ pub const Share = struct { const v = try evenly(s.v_heads, rank, world); const mlp = try tiles(s.intermediate, rank, world); const vocab = try tiles(s.vocab, rank, world); + const hidden = try tiles(s.hidden, rank, world); const keys = s.k_heads * dk; return .{ .rank = rank, @@ -70,6 +72,7 @@ pub const Share = struct { .out = scale(v, dk), .mlp = mlp, .vocab = vocab, + .hidden = hidden, }; } @@ -114,7 +117,7 @@ fn shift(s: Span, by: usize) Span { } /// The 27B's widths (cuda_geometry.zig's test of them): 24 query heads over 4 KV heads, 48 value heads over 16. -const qwen27: Shape = .{ .hidden = 5120, .intermediate = 17408, .vocab = 248320, .q_heads = 24, .kv_heads = 4, .k_heads = 16, .v_heads = 48 }; +pub const qwen27: Shape = .{ .hidden = 5120, .intermediate = 17408, .vocab = 248320, .q_heads = 24, .kv_heads = 4, .k_heads = 16, .v_heads = 48 }; test "TP=2 halves every weight of the 27B: whole heads, 2,048-wide qkv segments cut at 1,024, the vocabulary at 124,160" { const r0 = try Share.of(qwen27, 0, 2); @@ -138,6 +141,8 @@ test "TP=2 halves every weight of the 27B: whole heads, 2,048-wide qkv segments try std.testing.expectEqual(Span{ .lo = 8704, .hi = 17408 }, r1.mlp); try std.testing.expectEqual(Span{ .lo = 0, .hi = 124160 }, r0.vocab); // 970 of 1,940 tiles try std.testing.expectEqual(Span{ .lo = 124160, .hi = 248320 }, r1.vocab); + try std.testing.expectEqual(Span{ .lo = 0, .hi = 2560 }, r0.hidden); // 20 of 40 tiles + try std.testing.expectEqual(Span{ .lo = 2560, .hi = 5120 }, r1.hidden); } test "TP=1 keeps every weight whole" { @@ -146,6 +151,7 @@ test "TP=1 keeps every weight whole" { try std.testing.expectEqual(Span{ .lo = 0, .hi = 1024 }, r.kv); try std.testing.expectEqual([3]Span{ .{ .lo = 0, .hi = 2048 }, .{ .lo = 2048, .hi = 4096 }, .{ .lo = 4096, .hi = 10240 } }, r.qkv); try std.testing.expectEqual(Span{ .lo = 0, .hi = 248320 }, r.vocab); + try std.testing.expectEqual(Span{ .lo = 0, .hi = 5120 }, r.hidden); } test "TP=4 takes a KV head and 6 query heads a rank; TP=8 keeps each KV head on two ranks and refuses the head's tiles" { @@ -154,6 +160,7 @@ test "TP=4 takes a KV head and 6 query heads a rank; TP=8 keeps each KV head on try std.testing.expectEqual(Span{ .lo = 768, .hi = 1024 }, r3.kv); try std.testing.expectEqual(Span{ .lo = 13056, .hi = 17408 }, r3.mlp); try std.testing.expectEqual(Span{ .lo = 186240, .hi = 248320 }, r3.vocab); + try std.testing.expectEqual(Span{ .lo = 3840, .hi = 5120 }, r3.hidden); // 1,940 vocabulary tiles do not split by 8: refused on the head, the last width read try std.testing.expectError(error.NotOnTiles, Share.of(qwen27, 5, 8)); var wide = qwen27; @@ -162,6 +169,7 @@ test "TP=4 takes a KV head and 6 query heads a rank; TP=8 keeps each KV head on try std.testing.expectEqual(Span{ .lo = 7680, .hi = 9216 }, r5.q); try std.testing.expectEqual(Span{ .lo = 512, .hi = 768 }, r5.kv); // KV head 2, kept by ranks 4 and 5 try std.testing.expectEqual(Span{ .lo = 1280, .hi = 1536 }, r5.qkv[0]); // key heads 10 and 11 of 16 + try std.testing.expectEqual(Span{ .lo = 3200, .hi = 3840 }, r5.hidden); // 5 of 40 tiles a rank } test "a width or a half off the 128-tiles is refused by name, never rounded" { @@ -177,6 +185,10 @@ test "a width or a half off the 128-tiles is refused by name, never rounded" { s = qwen27; s.vocab = 248320 + 1; try std.testing.expectError(error.NotOnTiles, Share.of(s, 0, 2)); + s = qwen27; + s.hidden = 41 * 128; // on the tiles, but 41 tiles do not halve: o_proj's rows would be cut inside a tile + try std.testing.expectError(error.NotOnTiles, Share.of(s, 0, 2)); + _ = try Share.of(s, 0, 1); } test "heads that do not split, and ranks that are not there, are refused" { @@ -210,3 +222,18 @@ test "a rank keeps the key head of each of its value heads and the KV head of ea } }; } + +test "the ranks' hidden spans tile the hidden width in whole 128-tiles, in rank order" { + var s = qwen27; + s.vocab = 248832; // 1,944 tiles split by 8 too + for ([_]usize{ 1, 2, 4, 8 }) |world| { + var next: usize = 0; + for (0..world) |rank| { + const h = (try Share.of(s, rank, world)).hidden; + try std.testing.expectEqual(next, h.lo); + try std.testing.expect(h.len() % unit == 0 and h.len() > 0); + next = h.hi; + } + try std.testing.expectEqual(s.hidden, next); + } +} diff --git a/zig/src/families/qwen3_5/cuda_shard_decl_test.zig b/zig/src/families/qwen3_5/cuda_shard_decl_test.zig index 72e601a7457..bb1a22484a9 100644 --- a/zig/src/families/qwen3_5/cuda_shard_decl_test.zig +++ b/zig/src/families/qwen3_5/cuda_shard_decl_test.zig @@ -55,6 +55,7 @@ fn declaredOf(s: cs.Shape, rank: usize, world: usize) anyerror!cs.Share { try std.testing.expectEqual(gate, down); // gate_proj, up_proj and down_proj cut one range const head: shard.Decl = .{ .kind = .vocab, .unit = cs.unit, .rule = .even }; const vocab = try span(head, s.vocab, rank, world, error.NotOnTiles); + const hidden_rows = try span(tile_rows, s.hidden, rank, world, error.NotOnTiles); // o_proj, out_proj and down_proj rows return .{ .rank = rank, .world = world, @@ -67,6 +68,7 @@ fn declaredOf(s: cs.Shape, rank: usize, world: usize) anyerror!cs.Share { .out = out, .mlp = gate, .vocab = vocab, + .hidden = hidden_rows, }; } @@ -80,7 +82,7 @@ fn expectSame(s: cs.Shape, rank: usize, world: usize) !void { const qwen27: cs.Shape = .{ .hidden = 5120, .intermediate = 17408, .vocab = 248320, .q_heads = 24, .kv_heads = 4, .k_heads = 16, .v_heads = 48 }; test "the declared shares equal Share.of at every world to 16, its refusals and their order included" { - var shapes: [8]cs.Shape = @splat(qwen27); + var shapes: [9]cs.Shape = @splat(qwen27); shapes[1].hidden = 5120 + 64; // off the tiles: refused first, at every world shapes[2].kv_heads = 2; // fewer KV heads than ranks past world 2: kept by their query ranks, or KvHeads shapes[3].kv_heads = 3; // 3 does not split over 2 or 4 ranks @@ -89,6 +91,7 @@ test "the declared shares equal Share.of at every world to 16, its refusals and shapes[6].q_heads = 20; // two axes wrong at once: the query heads refuse first, where 20 does not split shapes[6].vocab = 248320 + 64; shapes[7].v_heads = 0; // nothing to cut: EmptyShare + shapes[8].hidden = 41 * 128; // on the tiles, but 41 tiles do not split past world 1: refused last for (&shapes) |*s| { for (1..17) |world| for (0..world) |rank| try expectSame(s.*, rank, world); try expectSame(s.*, 0, 0); From 7ee615f6dc8bb15d33aa8ef959cbbb353a6bdfbb Mon Sep 17 00:00:00 2001 From: Nipale-ai <236170788+Nipale-ai@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:50:33 +0100 Subject: [PATCH 3/6] qwen3_5 cuda: each weight's cut spans of n and the whole weight's plan, host only cuda_shard_plan.zig names, for the 27B's eleven EXL3 weights, which Share span cuts the output axis and the (sk, wk) every launch of the cut keeps: the whole weight's. Host tests pin both at worlds 1, 2 and 4 from exl3.planOf, and show which halves would plan their own. --- zig/src/families/qwen3_5/cuda.zig | 8 +- zig/src/families/qwen3_5/cuda_shard_plan.zig | 158 +++++++++++++++++++ 2 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 zig/src/families/qwen3_5/cuda_shard_plan.zig diff --git a/zig/src/families/qwen3_5/cuda.zig b/zig/src/families/qwen3_5/cuda.zig index 0406b573b6a..d472f112049 100644 --- a/zig/src/families/qwen3_5/cuda.zig +++ b/zig/src/families/qwen3_5/cuda.zig @@ -92,8 +92,14 @@ test "Qwen pages default: the learner's and the prefix share's refusals stop bef try @import("cuda_admit_test.zig").refusals(); } +pub const shard = @import("cuda_shard.zig"); +pub const shard_plan = @import("cuda_shard_plan.zig"); +/// The EXL3 tensor checks the loader and the cut-plan runner share. +pub const exl3_admit = @import("cuda_exl3_admit.zig"); + test { - _ = @import("cuda_shard.zig"); + _ = shard; + _ = shard_plan; } test "the shard plan's head widths are the kernels'" { diff --git a/zig/src/families/qwen3_5/cuda_shard_plan.zig b/zig/src/families/qwen3_5/cuda_shard_plan.zig new file mode 100644 index 00000000000..2a566e70e2d --- /dev/null +++ b/zig/src/families/qwen3_5/cuda_shard_plan.zig @@ -0,0 +1,158 @@ +//! Which output columns of each dense Qwen3.5 EXL3 weight a rank cuts, and the K splits its launches keep. + +const std = @import("std"); +const cuda = @import("cuda"); +const cs = @import("cuda_shard.zig"); + +const exl3 = cuda.exl3; + +/// The EXL3 weights of the dense hybrids and the head: each cut along its n (outputs), every rank reading the whole k. +pub const Part = enum { q_proj, k_proj, v_proj, o_proj, in_proj_qkv, in_proj_z, out_proj, gate_proj, up_proj, down_proj, lm_head }; + +/// A whole weight's shape: n outputs of k inputs. +pub const Dims = struct { n: usize, k: usize }; + +/// `part`'s whole shape at the widths of `s`. +pub fn dims(s: cs.Shape, part: Part) Dims { + return switch (part) { + .q_proj => .{ .n = s.q_heads * 2 * cs.head_dim, .k = s.hidden }, + .k_proj, .v_proj => .{ .n = s.kv_heads * cs.head_dim, .k = s.hidden }, + .o_proj => .{ .n = s.hidden, .k = s.q_heads * cs.head_dim }, + .in_proj_qkv => .{ .n = (2 * s.k_heads + s.v_heads) * cs.dk, .k = s.hidden }, + .in_proj_z => .{ .n = s.v_heads * cs.dk, .k = s.hidden }, + .out_proj => .{ .n = s.hidden, .k = s.v_heads * cs.dk }, + .gate_proj, .up_proj => .{ .n = s.intermediate, .k = s.hidden }, + .down_proj => .{ .n = s.hidden, .k = s.intermediate }, + .lm_head => .{ .n = s.vocab, .k = s.hidden }, + }; +} + +/// A weight of `d`'s shape with no storage behind it: all that `planOf` and the column views read. +fn unplaced(d: Dims) exl3.Weight { + return .{ .trellis = 0, .suh = 0, .svh = 0, .k = @intCast(d.k), .n = @intCast(d.n), .halves = 8, .codebook = .mul1, .stride_k = 0, .stride_nb = 0 }; +} + +/// One weight as a rank cuts it: its spans of the whole n, and the whole weight's (sk, wk) for every launch of them. +pub const Cut = struct { + whole: Dims, + spans: [3]cs.Span, + len: usize, // the spans in use: in_proj_qkv's three segments, else one + sk: u32, + wk: u32, + + pub fn items(c: *const Cut) []const cs.Span { + return c.spans[0..c.len]; + } +}; + +/// `part` as the rank of `share` cuts it; the plan is the whole weight's, the one TP=1 launches. +pub fn cutOf(part: Part, s: cs.Shape, share: cs.Share) Cut { + const d = dims(s, part); + const p = exl3.planOf(unplaced(d)); + var spans: [3]cs.Span = @splat(.{ .lo = 0, .hi = 0 }); + var len: usize = 1; + switch (part) { + .q_proj => spans[0] = share.q, + .k_proj, .v_proj => spans[0] = share.kv, + .o_proj, .out_proj, .down_proj => spans[0] = share.hidden, + .in_proj_qkv => { + spans = share.qkv; + len = 3; + }, + .in_proj_z => spans[0] = share.z, + .gate_proj, .up_proj => spans[0] = share.mlp, + .lm_head => spans[0] = share.vocab, + } + return .{ .whole = d, .spans = spans, .len = len, .sk = p.sk, .wk = p.wk }; +} + +/// A rank's view of `whole` (the whole weight on the device) over `span` of its n, launching the whole's plan. +pub fn view(whole: exl3.Weight, span: cs.Span) !exl3.Weight { + return whole.pinnedColumns(@intCast(span.lo), @intCast(span.len())); +} + +const Plan = struct { sk: u32, wk: u32 }; + +/// What `columns` would launch for `span`: the plan of the span's own shape, as a weight cut without the pin plans. +fn ownPlan(d: Dims, span: cs.Span) !Plan { + const v = try unplaced(d).columns(@intCast(span.lo), @intCast(span.len())); + const p = exl3.planOf(v); + return .{ .sk = p.sk, .wk = p.wk }; +} + +fn sp(lo: usize, hi: usize) cs.Span { + return .{ .lo = lo, .hi = hi }; +} + +const Want = struct { part: Part, n: usize, k: usize, sk: u32, wk: u32, r0: []const cs.Span, r1: []const cs.Span }; + +/// The 27B at TP=2, the plan of each whole weight as `exl3.plan` gives it (K splits, warps). +const tp2 = [_]Want{ + .{ .part = .q_proj, .n = 12288, .k = 5120, .sk = 1, .wk = 8, .r0 = &.{sp(0, 6144)}, .r1 = &.{sp(6144, 12288)} }, + .{ .part = .k_proj, .n = 1024, .k = 5120, .sk = 8, .wk = 4, .r0 = &.{sp(0, 512)}, .r1 = &.{sp(512, 1024)} }, + .{ .part = .v_proj, .n = 1024, .k = 5120, .sk = 8, .wk = 4, .r0 = &.{sp(0, 512)}, .r1 = &.{sp(512, 1024)} }, + .{ .part = .o_proj, .n = 5120, .k = 6144, .sk = 8, .wk = 4, .r0 = &.{sp(0, 2560)}, .r1 = &.{sp(2560, 5120)} }, + .{ .part = .in_proj_qkv, .n = 10240, .k = 5120, .sk = 1, .wk = 8, .r0 = &.{ sp(0, 1024), sp(2048, 3072), sp(4096, 7168) }, .r1 = &.{ sp(1024, 2048), sp(3072, 4096), sp(7168, 10240) } }, + .{ .part = .in_proj_z, .n = 6144, .k = 5120, .sk = 4, .wk = 4, .r0 = &.{sp(0, 3072)}, .r1 = &.{sp(3072, 6144)} }, + .{ .part = .out_proj, .n = 5120, .k = 6144, .sk = 8, .wk = 4, .r0 = &.{sp(0, 2560)}, .r1 = &.{sp(2560, 5120)} }, + .{ .part = .gate_proj, .n = 17408, .k = 5120, .sk = 1, .wk = 8, .r0 = &.{sp(0, 8704)}, .r1 = &.{sp(8704, 17408)} }, + .{ .part = .up_proj, .n = 17408, .k = 5120, .sk = 1, .wk = 8, .r0 = &.{sp(0, 8704)}, .r1 = &.{sp(8704, 17408)} }, + .{ .part = .down_proj, .n = 5120, .k = 17408, .sk = 8, .wk = 4, .r0 = &.{sp(0, 2560)}, .r1 = &.{sp(2560, 5120)} }, + .{ .part = .lm_head, .n = 248320, .k = 5120, .sk = 1, .wk = 8, .r0 = &.{sp(0, 124160)}, .r1 = &.{sp(124160, 248320)} }, +}; + +test "TP=2 on the 27B: each weight's spans of n, and the whole weight's (sk, wk) for both halves" { + for (tp2) |w| for ([_][]const cs.Span{ w.r0, w.r1 }, 0..) |want, rank| { + const c = cutOf(w.part, cs.qwen27, try cs.Share.of(cs.qwen27, rank, 2)); + try std.testing.expectEqual(Dims{ .n = w.n, .k = w.k }, c.whole); + try std.testing.expectEqual(Plan{ .sk = w.sk, .wk = w.wk }, Plan{ .sk = c.sk, .wk = c.wk }); + try std.testing.expectEqualSlices(cs.Span, want, c.items()); + }; +} + +test "at worlds 1, 2 and 4 the spans tile each weight's n in 128-tiles and every cut keeps the whole weight's plan" { + const keys = cs.qwen27.k_heads * cs.dk; // in_proj_qkv's q and k segments are this wide, v the rest + for ([_]usize{ 1, 2, 4 }) |world| for (std.enums.values(Part)) |part| { + const d = dims(cs.qwen27, part); + const whole = exl3.planOf(unplaced(d)); + const segments: usize = if (part == .in_proj_qkv) 3 else 1; + const starts = [3]usize{ 0, keys, 2 * keys }; + const ends = [3]usize{ if (segments == 3) keys else d.n, 2 * keys, d.n }; + var next = [3]usize{ 0, 0, 0 }; + for (0..world) |rank| { + const c = cutOf(part, cs.qwen27, try cs.Share.of(cs.qwen27, rank, world)); + try std.testing.expectEqual(Plan{ .sk = whole.sk, .wk = whole.wk }, Plan{ .sk = c.sk, .wk = c.wk }); + for (c.items(), 0..) |span, j| { + if (rank == 0) next[j] = starts[j]; + try std.testing.expectEqual(next[j], span.lo); + try std.testing.expect(span.lo % cs.unit == 0 and span.len() % cs.unit == 0 and span.len() > 0); + next[j] = span.hi; + } + } + for (0..segments) |j| try std.testing.expectEqual(ends[j], next[j]); + }; +} + +/// The weights whose halves (world 2) or quarters (world 4) would plan their own (sk, wk), not the whole's. +const own_at_2 = [_]Part{ .q_proj, .in_proj_qkv, .in_proj_z, .down_proj }; +const own_at_4 = [_]Part{ .q_proj, .in_proj_qkv, .in_proj_z, .gate_proj, .up_proj, .down_proj }; + +test "a half cut without the pin plans its own (sk, wk) for q_proj, in_proj_qkv, in_proj_z and down_proj; the view keeps the whole's" { + for ([_]usize{ 2, 4 }) |world| for (std.enums.values(Part)) |part| { + const own_set: []const Part = if (world == 2) &own_at_2 else &own_at_4; + const listed = std.mem.indexOfScalar(Part, own_set, part) != null; + for (0..world) |rank| { + const c = cutOf(part, cs.qwen27, try cs.Share.of(cs.qwen27, rank, world)); + for (c.items()) |span| { + const pinned = exl3.planOf(try view(unplaced(c.whole), span)); + try std.testing.expectEqual(Plan{ .sk = c.sk, .wk = c.wk }, Plan{ .sk = pinned.sk, .wk = pinned.wk }); + const own = try ownPlan(c.whole, span); + try std.testing.expectEqual(listed, own.sk != c.sk or own.wk != c.wk); + } + } + }; + // q_proj's half plans 4 splits of 4 warps (the whole 1 of 8), in_proj_z's 8 of 4, down_proj's 16 of 4 + try std.testing.expectEqual(Plan{ .sk = 4, .wk = 4 }, try ownPlan(dims(cs.qwen27, .q_proj), sp(0, 6144))); + try std.testing.expectEqual(Plan{ .sk = 8, .wk = 4 }, try ownPlan(dims(cs.qwen27, .in_proj_z), sp(0, 3072))); + try std.testing.expectEqual(Plan{ .sk = 16, .wk = 4 }, try ownPlan(dims(cs.qwen27, .down_proj), sp(0, 2560))); +} From 72b659ce2a6d4f50737c2f9013b8196cf96e2e24 Mon Sep 17 00:00:00 2001 From: Nipale-ai <236170788+Nipale-ai@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:50:33 +0100 Subject: [PATCH 4/6] tf-cuda-test qwen35-tp-cut: each rank's EXL3 columns against one GPU's bytes Every EXL3 weight of a pack, both ranks of a world of two, 1 to 1,536 rows, bf16 and fp32 outputs, finite and non-finite rows, and projection groups. The same columns planned on their own are run beside them. --- zig/tests/cuda/main.zig | 7 +- zig/tests/cuda/qwen35_tp_cut_tests.zig | 292 +++++++++++++++++++++++++ 2 files changed, 295 insertions(+), 4 deletions(-) create mode 100644 zig/tests/cuda/qwen35_tp_cut_tests.zig diff --git a/zig/tests/cuda/main.zig b/zig/tests/cuda/main.zig index 87a227790ec..f09b14e3eb1 100644 --- a/zig/tests/cuda/main.zig +++ b/zig/tests/cuda/main.zig @@ -37,9 +37,7 @@ const carveout_tests = @import("carveout_tests.zig"); const nvfp4_tests = @import("nvfp4_tests.zig"); const modelopt_tests = @import("modelopt_tests.zig"); const exl3_tests = @import("exl3_tests.zig"); -const exl3_tp2_tests = @import("exl3_tp2_tests.zig"); const exl3_plan_bench = @import("exl3_plan_bench.zig"); -const exl3_candidate_tests = @import("exl3_candidate_tests.zig"); const experts3_tests = @import("experts3_tests.zig"); const moe_tests = @import("moe_tests.zig"); const ck_tests = @import("ck_tests.zig"); @@ -265,12 +263,13 @@ fn run(gpu: check.Gpu, cmd: []const u8, rest: []const [:0]const u8) !void { if (std.mem.eql(u8, cmd, "exlr8-bench")) return exlr8_tests.bench(gpu, try arg(rest, 0), if (rest.len > 1) rest[1] else "home", if (rest.len > 2) try std.fmt.parseInt(u16, rest[2], 10) else 40, if (rest.len > 3) try std.fmt.parseInt(usize, rest[3], 10) else 4); if (std.mem.eql(u8, cmd, "exl3")) return exl3_tests.run(gpu, if (rest.len > 0) rest[0] else "none"); if (std.mem.eql(u8, cmd, "exl3-grouped-tile")) return @import("exl3_grouped_tile_tests.zig").run(gpu); - if (std.mem.eql(u8, cmd, "exl3-tiles")) return exl3_candidate_tests.run(gpu, if (rest.len > 0) rest[0] else null); + if (std.mem.eql(u8, cmd, "exl3-tiles")) return @import("exl3_candidate_tests.zig").run(gpu, if (rest.len > 0) rest[0] else null); if (std.mem.eql(u8, cmd, "exl3-shapes")) return exl3_plan_bench.profileShapes(gpu, if (rest.len > 0) rest[0] else null); if (std.mem.eql(u8, cmd, "exl3-midm")) return exl3_plan_bench.midm(gpu); if (std.mem.eql(u8, cmd, "exl3-plans")) return exl3_plan_bench.run(gpu, if (rest.len > 0) rest[0] else null); if (std.mem.eql(u8, cmd, "exl3-contract")) return @import("contract_exl3.zig").run(gpu); - if (std.mem.eql(u8, cmd, "exl3-tp2")) return exl3_tp2_tests.run(gpu, try arg(rest, 0), try arg(rest, 1), if (rest.len > 2) rest[2] else "none"); + if (std.mem.eql(u8, cmd, "exl3-tp2")) return @import("exl3_tp2_tests.zig").run(gpu, try arg(rest, 0), try arg(rest, 1), if (rest.len > 2) rest[2] else "none"); + if (std.mem.eql(u8, cmd, "qwen35-tp-cut")) return @import("qwen35_tp_cut_tests.zig").run(gpu, try arg(rest, 0), if (rest.len > 1) rest[1] else "1"); if (std.mem.eql(u8, cmd, "sample")) return sample_tests.draws(gpu); if (std.mem.eql(u8, cmd, "nemotron-draws")) return @import("nemotron_draw_tests.zig").run(gpu); if (std.mem.eql(u8, cmd, "topk")) return sample_tests.topk(gpu); diff --git a/zig/tests/cuda/qwen35_tp_cut_tests.zig b/zig/tests/cuda/qwen35_tp_cut_tests.zig new file mode 100644 index 00000000000..013bfd10e9b --- /dev/null +++ b/zig/tests/cuda/qwen35_tp_cut_tests.zig @@ -0,0 +1,292 @@ +//! tf-cuda-test qwen35-tp-cut PACK [STEP]: a rank's cut of the 27B's EXL3 weights at the whole plan, one GPU's bytes. +const std = @import("std"); +const cuda = @import("cuda"); +const core = @import("core"); +const qwen35 = @import("qwen35"); +const check = @import("check.zig"); + +const exl3 = cuda.exl3; +const cs = qwen35.shard; +const plans = qwen35.shard_plan; +const admit = qwen35.exl3_admit; +const Part = plans.Part; + +const world = 2; +const most = 1536; // the engine's default prompt chunk +/// Rows: a decode row, 2, 16, then 17 to 129 across linear_wc, the mid-M groups (36 is one) and 128-row blocks. +const counts = [_]usize{ 1, 2, 16, 17, 36, 48, 49, 128, 129, most }; +/// The head reads the last rows of a chunk, so it stops at the first count past a 128-row block. +const head_most = 129; +const root = "model.language_model.layers.{d}."; + +/// A weight of a layer by its tensor name, and the set of weights one input feeds (the engine groups those it can). +const Member = struct { part: Part, name: []const u8 }; +const m_q: Member = .{ .part = .q_proj, .name = "self_attn.q_proj" }; +const m_k: Member = .{ .part = .k_proj, .name = "self_attn.k_proj" }; +const m_v: Member = .{ .part = .v_proj, .name = "self_attn.v_proj" }; +const m_o: Member = .{ .part = .o_proj, .name = "self_attn.o_proj" }; +const m_qkv: Member = .{ .part = .in_proj_qkv, .name = "linear_attn.in_proj_qkv" }; +const m_z: Member = .{ .part = .in_proj_z, .name = "linear_attn.in_proj_z" }; +const m_out: Member = .{ .part = .out_proj, .name = "linear_attn.out_proj" }; +const m_gate: Member = .{ .part = .gate_proj, .name = "mlp.gate_proj" }; +const m_up: Member = .{ .part = .up_proj, .name = "mlp.up_proj" }; +const m_down: Member = .{ .part = .down_proj, .name = "mlp.down_proj" }; +const m_head: Member = .{ .part = .lm_head, .name = "lm_head" }; +const attention = [_][]const Member{ &.{ m_q, m_k, m_v }, &.{m_o} }; +const delta = [_][]const Member{ &.{m_qkv}, &.{m_z}, &.{m_out} }; +const mlp = [_][]const Member{ &.{ m_gate, m_up }, &.{m_down} }; + +/// What a run counted, per part: weights, the whole plan and a half's own, and how often the own-plan columns matched. +const Tally = struct { + weights: std.EnumArray(Part, usize) = .initFill(0), + own_same: std.EnumArray(Part, usize) = .initFill(0), + own_diff: std.EnumArray(Part, usize) = .initFill(0), + whole: std.EnumArray(Part, [2]u32) = .initFill(.{ 0, 0 }), + own: std.EnumArray(Part, [2]u32) = .initFill(.{ 0, 0 }), + checks: usize = 0, + groups: usize = 0, + /// By row count: pinned views equal, own-plan columns equal and different, and the whole run's kernels. + pinned_equal: [counts.len]usize = @splat(0), + rows_same: [counts.len]usize = @splat(0), + rows_diff: [counts.len]usize = @splat(0), + kernel: [2][counts.len][3]usize = @splat(@splat(@splat(0))), // by sweep: linear, linear_wc and mid-M launches +}; + +const Ctx = struct { + gpu: check.Gpu, + s: cuda.Stream, + dense: *exl3.Dense, + ck: *core.Checkpoint, + rng: std.Random, + t: *Tally, +}; + +/// A host buffer on the device, freed with `bufs`. +fn upload(c: *Ctx, bufs: *std.ArrayList(cuda.DeviceBuffer), bytes: []const u8) !cuda.DeviceBuffer { + const b = try cuda.DeviceBuffer.fromHost(c.gpu.d, bytes); + try bufs.append(c.gpu.gpa, b); + return b; +} + +/// The whole weight `base` of the pack on the device, as the family's loader places it. +fn load(c: *Ctx, bufs: *std.ArrayList(cuda.DeviceBuffer), base: []const u8, d: plans.Dims) !exl3.Weight { + const g = admit.denseGroup(c.ck, base, d.n, d.k) catch |e| { + std.debug.print("FAIL {s}: not the 27B's {d} x {d} EXL3 weight ({s})\n", .{ base, d.n, d.k, @errorName(e) }); + return error.TestFailed; + }; + const st = exl3.strides(d.k, d.n, g.halves, false); + return .{ + .trellis = (try upload(c, bufs, g.trellis.bytes)).ptr, + .suh = (try upload(c, bufs, g.suh.bytes)).ptr, + .svh = (try upload(c, bufs, g.svh.bytes)).ptr, + .k = @intCast(d.k), + .n = @intCast(d.n), + .halves = g.halves, + .codebook = .mul1, + .stride_k = st.k, + .stride_nb = st.nb, + }; +} + +/// One call as the engine makes it: decode rows to 16, the prompt entry above. +fn launch(c: *Ctx, w: exl3.Weight, x: u64, m: usize, y: u64, dt: exl3.DType) !void { + if (m <= 16) return c.dense.decode(c.s, w, x, .bf16, m, y, dt); + return c.dense.prompt(c.s, w, x, .bf16, m, y, dt); +} + +/// `len` bytes of the buffer, after the stream is done and before the next call fills it again. +fn back(c: *Ctx, a: std.mem.Allocator, b: cuda.DeviceBuffer, len: usize) ![]u8 { + const host = try a.alloc(u8, len); + try c.s.synchronize(); + try b.download(0, host); + return host; +} + +/// Columns [lo, lo + len) of each of `m` rows of `whole` (n columns of `es` bytes): a rank's view of the rows. +fn kept(a: std.mem.Allocator, whole: []const u8, m: usize, n: usize, es: usize, span: cs.Span) ![]u8 { + const w = span.len() * es; + const rows = try a.alloc(u8, m * w); + for (0..m) |row| @memcpy(rows[row * w ..][0..w], whole[(row * n + span.lo) * es ..][0..w]); + return rows; +} + +/// Unit-normal bf16 rows; the first row's first three columns NaN, +inf and -inf when `nonfinite`. +fn inputs(a: std.mem.Allocator, rng: std.Random, len: usize, nonfinite: bool) ![]u16 { + const x = try a.alloc(u16, len); + for (x) |*h| h.* = core.bf16_round.bits(rng.floatNorm(f32)); + if (nonfinite) x[0..3].* = .{ 0x7fc0, 0x7f80, 0xff80 }; + return x; +} + +/// A weight's views of one rank: each span's columns at the whole plan, and the same columns planned on their own. +const Views = struct { pinned: [3]exl3.Weight, own: [3]exl3.Weight, spans: [3]cs.Span, len: usize }; + +/// Every comparison of one input set: the whole weights against each rank's views, at every row count and both outputs. +fn setChecks(c: *Ctx, members: []const Member, prefix: []const u8) !void { + var bufs: std.ArrayList(cuda.DeviceBuffer) = .empty; + defer { + for (bufs.items) |*b| b.free(); + bufs.deinit(c.gpu.gpa); + } + const shape = cs.qwen27; + var whole: [3]exl3.Weight = undefined; + var plan_differs: [3]bool = @splat(false); + var views: [3][world]Views = undefined; + var widest: usize = 0; + for (members, 0..) |m, i| { + var name_buf: [160]u8 = undefined; + const d = plans.dims(shape, m.part); + whole[i] = try load(c, &bufs, try std.fmt.bufPrint(&name_buf, "{s}{s}", .{ prefix, m.name }), d); + widest = @max(widest, d.n); + for (0..world) |rank| { + const cut = plans.cutOf(m.part, shape, try cs.Share.of(shape, rank, world)); + var vw: Views = .{ .pinned = undefined, .own = undefined, .spans = cut.spans, .len = cut.len }; + for (cut.items(), 0..) |span, j| { + vw.pinned[j] = try plans.view(whole[i], span); + vw.own[j] = try whole[i].columns(@intCast(span.lo), @intCast(span.len())); + try check.expect(vw.pinned[j].sk == cut.sk and vw.pinned[j].wk == cut.wk, "{s}: the view keeps the whole's {d} splits of {d} warps", .{ m.name, cut.sk, cut.wk }); + const own = exl3.planOf(vw.own[j]); + if (own.sk != cut.sk or own.wk != cut.wk) plan_differs[i] = true; + c.t.whole.set(m.part, .{ cut.sk, cut.wk }); + c.t.own.set(m.part, .{ own.sk, own.wk }); + } + views[i][rank] = vw; + } + c.t.weights.getPtr(m.part).* += 1; + } + defer c.dense.lin.use_wc = true; + const rows_most: usize = if (members[0].part == .lm_head) head_most else most; + const big = try cuda.DeviceBuffer.alloc(c.gpu.d, rows_most * widest * 4); + try bufs.append(c.gpu.gpa, big); + const ys = try cuda.DeviceBuffer.alloc(c.gpu.d, rows_most * widest * 4); + try bufs.append(c.gpu.gpa, ys); + var group_ys: [3]cuda.DeviceBuffer = undefined; + for (0..members.len) |i| { + group_ys[i] = try cuda.DeviceBuffer.alloc(c.gpu.d, 16 * plans.dims(shape, members[i].part).n * 4); + try bufs.append(c.gpu.gpa, group_ys[i]); + } + const kk = plans.dims(shape, members[0].part).k; + var witnessed: [3]bool = @splat(false); // an own plan that differs from the whole's must give other bytes in some run + for ([_]bool{ false, true }) |nonfinite| { + var arena = std.heap.ArenaAllocator.init(c.gpu.gpa); + defer arena.deinit(); + const x = try upload(c, &bufs, std.mem.sliceAsBytes(try inputs(arena.allocator(), c.rng, rows_most * kk, nonfinite))); + // two sweeps: linear_wc allowed as the engine has it, then off so the mid-M kernels take the rows it would + for (0..2 * counts.len) |pass| { + const ci = pass % counts.len; + const m = counts[ci]; + c.dense.lin.use_wc = pass < counts.len; + if (m > rows_most or (pass >= counts.len and (m <= 16 or m > 128))) continue; + for ([_]exl3.DType{ .bf16, .f32 }) |dt| { + var iter = std.heap.ArenaAllocator.init(c.gpu.gpa); + defer iter.deinit(); + const a = iter.allocator(); + const es: usize = if (dt == .f32) 4 else 2; + var want: [3][]u8 = undefined; + for (members, 0..) |mem, i| { + const n = plans.dims(shape, mem.part).n; + try big.fill8(0xff, c.s.handle); // a launch that writes nothing fails its comparison + if (dt == .bf16 and !nonfinite) { + var at: usize = 0; // Dense takes 128 rows a launch + while (at < m) : (at += 128) { + const how = exl3.pick(whole[i], @min(m - at, 128), c.dense.lin.midm, c.dense.lin.use_wc, c.dense.lin.min_rows).?; + const slot: usize = switch (how) { + .linear => 0, + .wc => 1, + .mpg => 2, + }; + c.t.kernel[pass / counts.len][ci][slot] += 1; + } + } + try launch(c, whole[i], x.ptr, m, big.ptr, dt); + want[i] = try back(c, a, big, m * n * es); + for (0..world) |rank| { + const vw = views[i][rank]; + for (vw.spans[0..vw.len], 0..) |span, j| { + const exp = try kept(a, want[i], m, n, es, span); + try ys.fill8(0xff, c.s.handle); + try launch(c, vw.pinned[j], x.ptr, m, ys.ptr, dt); + const what = try std.fmt.allocPrint(a, "{s} rank {d} span {d}, {d} rows, {s}, nonfinite={any}", .{ mem.name, rank, j, m, @tagName(dt), nonfinite }); + try check.sameBytes(what, try back(c, a, ys, exp.len), exp); + c.t.checks += 1; + c.t.pinned_equal[ci] += 1; + try ys.fill8(0xff, c.s.handle); + try launch(c, vw.own[j], x.ptr, m, ys.ptr, dt); + const alike = std.mem.eql(u8, try back(c, a, ys, exp.len), exp); + const tally = if (alike) &c.t.own_same else &c.t.own_diff; + tally.getPtr(mem.part).* += 1; + (if (alike) &c.t.rows_same else &c.t.rows_diff)[ci] += 1; + if (!alike and dt == .f32 and !nonfinite) witnessed[i] = true; + } + } + } + if (members.len < 2 or m > 16) continue; + for (0..world) |rank| { + var vs: [3]exl3.Weight = undefined; + var outs: [3]u64 = undefined; + for (members, 0..) |_, i| { + vs[i] = views[i][rank].pinned[0]; + outs[i] = group_ys[i].ptr; + try group_ys[i].fill8(0xff, c.s.handle); + } + try c.dense.decodeGroup(c.s, vs[0..members.len], x.ptr, .bf16, m, outs[0..members.len], dt); + if (exl3.groupable(vs[0..members.len], m)) c.t.groups += 1; + for (members, 0..) |mem, i| { + const n = plans.dims(shape, mem.part).n; + const exp = try kept(a, want[i], m, n, es, views[i][rank].spans[0]); + const what = try std.fmt.allocPrint(a, "{s} rank {d} in a group of {d}, {d} rows, {s}, nonfinite={any}", .{ mem.name, rank, members.len, m, @tagName(dt), nonfinite }); + try check.sameBytes(what, try back(c, a, group_ys[i], exp.len), exp); + c.t.checks += 1; + } + } + } + } + } + for (members, 0..) |m, i| { + try check.expect(!plan_differs[i] or witnessed[i], "{s}: the half's own plan gives the whole's bytes, so the pin cannot be shown to matter", .{m.name}); + } +} + +pub fn run(gpu: check.Gpu, dir: []const u8, step_arg: []const u8) !void { + const step = try std.fmt.parseInt(usize, step_arg, 10); + if (step == 0) return error.BadArguments; + var s = try cuda.Stream.init(gpu.d, false); + defer s.deinit(); + var dense = try exl3.Dense.load(gpu.d); + defer dense.unload(); + var ck = try core.Checkpoint.openModel(gpu.gpa, gpu.io, dir); + defer ck.close(); + var prng = std.Random.DefaultPrng.init(0x7f27_c07); + var t: Tally = .{}; + var c: Ctx = .{ .gpu = gpu, .s = s, .dense = &dense, .ck = &ck, .rng = prng.random(), .t = &t }; + try setChecks(&c, &.{m_head}, ""); + var layer: usize = 0; + var kept_layers: usize = 0; + while (true) : (layer += 1) { + var buf: [96]u8 = undefined; + const prefix = try std.fmt.bufPrint(&buf, root, .{layer}); + var probe: [128]u8 = undefined; + if (!ck.has(try std.fmt.bufPrint(&probe, "{s}mlp.gate_proj.trellis", .{prefix}))) break; + if (layer % step != 0) continue; + kept_layers += 1; + const attn = ck.has(try std.fmt.bufPrint(&probe, "{s}self_attn.q_proj.trellis", .{prefix})); + const sets: []const []const Member = if (attn) &attention else δ + for (sets) |set| try setChecks(&c, set, prefix); + for (&mlp) |set| try setChecks(&c, set, prefix); + } + try check.expect(kept_layers > 0, "the pack has no layer to check", .{}); + for (std.enums.values(Part)) |part| { + const n = t.weights.get(part); + if (n == 0) continue; + const whole = t.whole.get(part); + const own = t.own.get(part); + std.debug.print("RESULT qwen35-tp-cut {s}: {d} weights, whole plan {d} splits x {d} warps, a half's own {d} x {d}; own-plan columns equal the whole run's in {d} and differ in {d} comparisons\n", .{ @tagName(part), n, whole[0], whole[1], own[0], own[1], t.own_same.get(part), t.own_diff.get(part) }); + } + for (counts, 0..) |m, ci| { + const on = t.kernel[0][ci]; + const off = t.kernel[1][ci]; + std.debug.print("RESULT qwen35-tp-cut {d} rows: whole run's launches (bf16, finite) linear {d}, linear_wc {d}, mid-M {d}; linear_wc off: linear {d}, mid-M {d}; pinned views (linear) equal in {d}; own-plan columns equal in {d}, differ in {d}\n", .{ m, on[0], on[1], on[2], off[0], off[2], t.pinned_equal[ci], t.rows_same[ci], t.rows_diff[ci] }); + } + check.pass("qwen35-tp-cut: {d} layers, {d} byte comparisons (bf16 and fp32 outputs, finite and non-finite rows), {d} projection groups; " ++ + "each rank's columns at the whole plan equal one run's bytes at 1 to {d} rows (the head to {d})", .{ kept_layers, t.checks, t.groups, most, head_most }); +} From 78387caa245e0ea7fcfa168e00c06e0b5a655ac8 Mon Sep 17 00:00:00 2001 From: ashhart <71890694+ashhart@users.noreply.github.com> Date: Thu, 19 Nov 2026 09:27:19 +0000 Subject: [PATCH 5/6] Follow main's extracted CUDA test help for #3602 Place qwen35-tp-cut's existing command description in main_usage.zig, where main moved the CUDA runner's help. Preserve every main entry and the incoming command description unchanged. --- zig/tests/cuda/main_usage.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/zig/tests/cuda/main_usage.zig b/zig/tests/cuda/main_usage.zig index 77a5a798e33..e588db109cb 100644 --- a/zig/tests/cuda/main_usage.zig +++ b/zig/tests/cuda/main_usage.zig @@ -128,6 +128,7 @@ pub const usage = \\ exl3-contract EXL3's replacements of linear_body through gates 1-4, each control red (kernel-contract's subset) \\ exl3-tp2 [dir] EXL3 tensor parallel: rank shards vs the Python engine's, all-gathered (dir none skips them) \\ exl3-tiles [DIR] EXL3's tile candidate: codebooks and tiles bit-equal, FP64, rows through qlinear and Dense + \\ qwen35-tp-cut PACK [STEP] the 27B's EXL3 weights cut for two ranks at the whole plan: each rank's columns, one run's bytes \\ train-pack MODEL EXAMPLES [COUNT] training passes holding several sequences against one a pass: differences, time \\ kernel-contract [WORD...] the contract's gates, each planted control red (-Dnvcc); WORDs: kernels named so \\ qmm-prefill-many-contract the GB10 bit-exact multi-projection prompt launch against separate launches From fb390e5d11bdb10ce525cf1b3f5993c288fc95bd Mon Sep 17 00:00:00 2001 From: ashhart <71890694+ashhart@users.noreply.github.com> Date: Fri, 20 Nov 2026 11:51:49 +0000 Subject: [PATCH 6/6] changelog: #3602 under Unreleased --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01f129c76cf..bcc5f3e83f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel ## Unreleased +- Tests: for Qwen3.5 dense EXL3 at TP=2, a rank's column cut of a weight can keep the whole weight's K-split plan (`Weight.pinnedColumns`), and `tf-cuda-test qwen35-tp-cut PACK` compares each rank's columns with one GPU's whole-weight bytes; `--tp 1` is unchanged and `--tp 2` stays refused (#3602). Thanks to @Nipale-ai. + - Server: a checkpoint no native backend serves is pointed to the Python engine 0.6.6 only when 0.6.6 serves its model type (DeepSeek V4, Gemma 4, GLM5-Next, Nemotron-H, Prism Hadamard Qwen3.5, Qwen3.5, Qwen3.5-MoE, Qwen3.8 Flash Next and Qwen4); any other type, such as `hy_v4_flash`, is told no TensorFold release serves it yet and pointed to the recipe book and the runbook (#4008). - GLM-5.3-Flash on CUDA: the load races the classic and factored expert forms, which give the same bits, at each of its ten timed decode window widths and keeps the faster one at each (classic unless factored is more than 1% faster), instead of one form for every window; a window takes the form of the narrowest timed width that holds it, and `TF_GLM_EXPERT_FORM` names one form for every width (#3249). Thanks to @Bizuayeu.