Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel

## Unreleased

- CUDA: GLM's `TF_GLM_L2PF` site f now also prefetches a MoE layer's shared expert gate-up after its router within the same `TF_GLM_L2PF_MB` budget, giving about 1.0-1.2% faster decode at TP=2 on GB10 (mean of three alternating launches) with identical tokens (#3156). Thanks to @Bizuayeu.

- Desktop: the Terminal picker launches a registered Orchestrator CLI by its ID without forwarding the catalog command as a custom override, lists CLIs for the current project and host, and stops a click left stale by retargeting, project removal or a disabled host before dispatch; local custom commands and the remote refusal still apply (#3828, fixes #3824). Thanks to @AIFlowML.

- Web: the OpenAI connection probe now uses the shared stream reader, so partial text followed by an error or early EOF fails the check instead of passing; the reader handles LF, CRLF and bare CR, including a CRLF split across chunks, and complete streams still pass the text-or-reasoning check (#3826, fixes #3823). Thanks to @AIFlowML.
Expand Down
20 changes: 14 additions & 6 deletions zig/src/families/glm/cuda_l2pf.zig
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ fn sources(l: weights.Layer, site: Site) Sources {
},
},
.f => switch (l.ffn) {
.moe => |m| s.add(m.router),
.moe => |m| {
s.add(m.router);
s.proj(m.shared_gu); // read after the routed experts, which no table holds (the router picks them)
},
.dense => |m| switch (m.w) {
.nvfp4 => |x| {
s.lane(x.gate);
Expand Down Expand Up @@ -310,10 +313,11 @@ test "the table: each site's sources in its matmuls' order, site n from the next
d.mixer.mla.q_b = .{ .bf16 = 0x7000_0000 };
d.ffn = .{ .dense = undefined };
d.ffn.dense.w = .{ .bf16 = .{ .gu = 0x9000_0000, .down = 0xa000_0000 } };
var e: weights.Layer = undefined; // layer 1: KDA on the lane and MoE
var e: weights.Layer = undefined; // layer 1: KDA on the lane and MoE, its shared expert block FP8 on the lane
e.mixer = .{ .kda = k };
e.ffn = .{ .moe = undefined };
e.ffn.moe.router = 0x5000_0000;
e.ffn.moe.shared_gu = .{ .fp8g = .{ .mode = .fp8g, .codes = 0xb000_0000, .scales = 0x8000_0000, .n = 64, .k = 64, .npad = 64 } };
const MiB = 1 << 20;
var bufs = [_]cuda.DeviceBuffer{
.{ .d = undefined, .ptr = 0x1000_0000, .len = 1 * MiB },
Expand All @@ -324,6 +328,8 @@ test "the table: each site's sources in its matmuls' order, site n from the next
.{ .d = undefined, .ptr = 0x6000_0000, .len = 16 * MiB },
.{ .d = undefined, .ptr = 0x7000_0000, .len = 17 * MiB },
.{ .d = undefined, .ptr = 0x9000_0000, .len = 34 * MiB },
.{ .d = undefined, .ptr = 0x8000_0000, .len = 1 * MiB },
.{ .d = undefined, .ptr = 0xb000_0000, .len = 16 * MiB },
};
var rows: std.ArrayList([2]i64) = .empty;
defer rows.deinit(t.allocator);
Expand All @@ -333,17 +339,19 @@ test "the table: each site's sources in its matmuls' order, site n from the next
.{ 0x1000_0000, 1 * MiB }, // layer 0's n: layer 1's qkv scales whole, then its codes' head
.{ 0x2000_0000, 11 * MiB },
.{ 0x9000_0000, 12 * MiB }, // layer 0's f: its gate and up's head
.{ 0x5000_0000, 2 * MiB }, // layer 1's f: its router; its n would be the head's, its o is KDA's o
.{ 0x4000_0000, 12 * MiB },
.{ 0x5000_0000, 2 * MiB }, // layer 1's f: its router, then its shared gate-up's scales and its codes' head
.{ 0x8000_0000, 1 * MiB },
.{ 0xb000_0000, 9 * MiB },
.{ 0x4000_0000, 12 * MiB }, // layer 1's o, KDA's o; its n would be the head's
};
try t.expectEqualSlices([2]i64, &want, rows.items);
try t.expectEqualSlices(Span, &.{
.{ .at = 0, .rows = 2, .bytes = 12 * MiB },
.{ .at = 2, .rows = 1, .bytes = 12 * MiB },
.{ .at = 3 }, // DSA: no site o
.{ .at = 3 },
.{ .at = 3, .rows = 1, .bytes = 2 * MiB },
.{ .at = 4, .rows = 1, .bytes = 12 * MiB },
.{ .at = 3, .rows = 3, .bytes = 12 * MiB },
.{ .at = 6, .rows = 1, .bytes = 12 * MiB },
}, &spans);
rows.clearRetainingCapacity();
try t.expect(!try table(t.allocator, bufs[1..], &.{ d, e }, 12 * MiB, &rows, &spans));
Expand Down
Loading