Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
a3303c7
CUDA keyed graph cache and device arena, both off until a family inst…
jayleaton Oct 10, 2026
69e8a65
A failed CUDA kernel launch names its kernel and launch configuration…
jayleaton Oct 10, 2026
d7e89df
fix(cuda): correct RDMA VMM capability attribute
jrb-ai Oct 10, 2026
5826f89
Graph cache: a capture is freed until the map holds it, the keep floo…
jayleaton Oct 11, 2026
5806e55
CUDA arena: the address maps are rehashed before tombstones fill them
jayleaton Oct 11, 2026
d335520
Graph cache: TF_GRAPH_CACHE=0 or off runs every step eagerly in any f…
jayleaton Oct 14, 2026
7ff83d8
Tensor parallelism across CUDA processes: bootstrap, NCCL, mailbox an…
jayleaton Oct 10, 2026
9af2ea2
TP tests: a drain on rank 0 then its clean stop ends rank 1's loop at…
jayleaton Oct 10, 2026
7c9a26e
TP RoCE: with no TF_TP_ROCE_HCA, each rank picks the ports on an IPv4…
jayleaton Oct 11, 2026
8ebb0be
TP README: when -Dtp-nvcc, TF_TP_ROCE_HCA, NCCL_IB_HCA, NCCL_SOCKET_I…
jayleaton Oct 11, 2026
e9e0056
TP test runner: a binary built without the mailbox kernel refuses the…
jayleaton Oct 11, 2026
0472cbf
TP RoCE: every RDMA post is bounds-checked before the verb, and peers…
jayleaton Oct 11, 2026
9688398
TP RoCE: no RDMA write past 1 MiB, and boot refuses any setting that …
jayleaton Oct 11, 2026
72132f0
TP RoCE: TF_TP_ROCE_CHUNKED_KB gathers strides past the slot in slot-…
jayleaton Oct 11, 2026
bf19238
TP RoCE: a failed transport halts its QPs, drains them and keeps its …
jayleaton Oct 11, 2026
beae7e8
TP RoCE: tf-tp-test failfast V transport checks the failed-transport …
jayleaton Oct 11, 2026
602aad5
Fix RoCE test smaps lookup for merged mappings
jayleaton Oct 11, 2026
890dfc6
TP RoCE: run_hosts.sh gives NCCL the RoCE picker's ports when neither…
jayleaton Oct 11, 2026
5410eac
Session memory for paged-KV families: page pool, prefix trie, RAM res…
jayleaton Oct 10, 2026
a3e2fb1
TP NCCL: all_reduce's doc says NCCL adds in its ring's order, so its …
jayleaton Oct 14, 2026
0d0bdb2
Sessions: the page map is rehashed before tombstones fill it
jayleaton Oct 11, 2026
62a75ae
TP: keep Linux-only transport host tests off macOS builds
jayleaton Oct 15, 2026
2cf61d3
Sessions: honor zero residency budgets and reserve uncapped requests
jayleaton Oct 15, 2026
864fe25
Graph cache: effective settings have one digest for ranks to compare …
jayleaton Oct 16, 2026
e2504f6
TP: bootstrap compares the graph cache's effective settings, so a ran…
jayleaton Oct 16, 2026
dcdc30c
Keep the Linux NVMe lane test out of portable host tests
cwschroeder Oct 16, 2026
abcad7d
Merge ashhart/main into stack/02-graph-cache-arena
jayleaton Oct 16, 2026
02d455e
Merge stack/02-graph-cache-arena (with ashhart/main) into stack/03-tp…
jayleaton Oct 16, 2026
9266f3f
Merge stack/03-tp-fabric (with ashhart/main) into stack/04-sessions
jayleaton Oct 16, 2026
8900c7c
Sessions: a failed prefix insert leaves the index as it was
jayleaton Oct 17, 2026
3aeebb9
CUDA arena: a reuse whose address-map insertion fails keeps its range…
jayleaton Oct 17, 2026
46161ac
Merge stack/02-graph-cache-arena (the #635 arena fix) into stack/03-t…
jayleaton Oct 17, 2026
78ce706
Merge stack/03-tp-fabric (the #635 arena and #637 prefix fixes) into …
jayleaton Oct 17, 2026
88418d8
test(tp): reject malformed runner commands before configuration
cwschroeder Oct 17, 2026
4c69b0d
fix(tp): parse runner commands before opening sessions
cwschroeder Oct 17, 2026
4df28ce
test(tp): retain verbs load failures in HCA diagnostics
cwschroeder Oct 17, 2026
0a80da0
fix(tp): distinguish verbs load errors from absent HCA ports
cwschroeder Oct 17, 2026
999cb03
Merge stack/03-tp-fabric (adopted #636 runner CLI validation and HCA …
jayleaton Oct 18, 2026
cdde1a4
Merge ashhart/main (1.1.0, 76aafcf2) into stack/02-graph-cache-arena
jayleaton Oct 18, 2026
adbdb8a
CUDA launches: a not-ready launch returns NotReady unlogged, as Drive…
jayleaton Oct 18, 2026
3bd6a6a
Merge stack/02-graph-cache-arena (adbdb8ab, main 76aafcf2) into stack…
jayleaton Oct 18, 2026
54141a1
Merge stack/03-tp-fabric (3bd6a6ab, main 76aafcf2) into stack/04-sess…
jayleaton Oct 18, 2026
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
3 changes: 3 additions & 0 deletions RUNBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ budget free for the next states.
`TF_HEAT_HIGH` and `TF_HEAT_LOW`, in degrees Celsius and set together, make each prompt chunk wait while the hottest
thermal zone (under `/sys/class/thermal`, or `TF_HEAT_ROOT`) is above the high band, until it is at or under the low one.
The server logs `heat_wait_s`, a cancel ends the wait, and the reply's tokens do not change.
On three GB10s serving GLM-5.3-Flash NVFP4 at TP=3, a 1,035,295-token prompt without the bands kept one host's hottest
zone at 94 C or more for most of the prompt (97.7 C at the top); `TF_HEAT_HIGH=92` and `TF_HEAT_LOW=88` held all three
at 93.0 C or under, and the first token came 10% later.
`TF_GRAPH_CACHE=0` (or `off`, any case) runs every step eagerly in any family that installs the keyed CUDA graph cache,
without a rebuild. Set it alike on every tensor-parallel rank: an off rank never joins the cache's per-miss vote, so a
rank left on would wait at its first miss, and only the off rank logs the switch. Ranks that share a cache compare
Expand Down
6 changes: 6 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ values agree within fp16/bf16 rounding (under 0.01 on random groups), not bit fo
dequant are written for TensorFold and checked against an independent reference of that arithmetic. The native engine
has no quantized KV cache and refuses `--kv-dtype`.

The two-rank CUDA RoCE gather (`zig/src/cuda/roce.zig`, `zig/kernels/cuda/roce_gather.cu`) adapts
the one-shot all-gather protocol of [b12x](https://github.com/local-inference-lab/b12x)'s RoCEnante
(`b12x/comm/roce/`, PRs #295 and #315): a device-resident epoch, sequence flags after each payload, two slots by
sequence parity and a timeout that fails the transport. Copyright 2026 Luke Alonso and the b12x contributors,
Apache License 2.0 (see [the license text](LICENSES/Apache-2.0.txt)); b12x ships no NOTICE file.

The Zig tensor-parallel fabric's RoCE path (`zig/src/fabric/tp/mailbox.cu`, `roce.zig`, `roce_verbs.zig`) adapts
the one-shot all-gather protocol of [b12x](https://github.com/local-inference-lab/b12x)'s RoCEnante
(`b12x/comm/roce/`, PRs #295 and #315): a device-resident epoch, sequence flags after each payload, two slots by
Expand Down
5 changes: 4 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const server_build = @import("zig/build/server.zig");
const golden_build = @import("zig/build/golden.zig");
const contract_build = @import("zig/build/kernel_contract.zig");
const video_build = @import("zig/build/video.zig");
const sys_build = @import("zig/build/sys.zig");
const tp_build = @import("zig/build/tp.zig");

comptime {
Expand Down Expand Up @@ -201,8 +202,10 @@ pub fn build(b: *std.Build) void {
test_step.dependOn(&warning_run.step);
b.step("test-learn-warning", "CPU production-log refusal, backoff and recovery test").dependOn(&warning_run.step);
grammar_build.steps(b, target, xgrammar);
contract_build.hostTests(b);
contract_build.hostTests(b, gemma4_contract_host);
tp_build.add(b, target, optimize, test_step);
sys_build.wire(b);
@import("zig/build/checkpoint_config.zig").wire(b);
}

/// `zig build native -Dcpu=apple_m1`: tensorfold-native with the Metal engines for the Python package's bundle (a native M5 build traps on M1-M4).
Expand Down
4 changes: 1 addition & 3 deletions zig/src/cuda/graph_cache_ranks_test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ const Board = struct {
}

fn now() u64 {
var ts: std.c.timespec = undefined;
_ = std.c.clock_gettime(.MONOTONIC, &ts);
return @as(u64, @intCast(ts.sec)) * std.time.ns_per_s + @as(u64, @intCast(ts.nsec));
return @intCast(std.Io.Clock.awake.now(std.testing.io).toNanoseconds());
}
};

Expand Down
1 change: 1 addition & 0 deletions zig/src/cuda/launch.zig
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ pub fn launch(f: Function, cfg: Config, stream: Stream, args: *Args) Error!void
/// A launch's result; a failure names the kernel and its configuration with the code.
fn launched(f: Function, cfg: Config, res: abi.Result, what: []const u8) Error!void {
if (res == abi.success) return;
if (res == abi.error_not_ready) return error.NotReady; // as Driver.check: not a failure to log
const d = f.d;
var buf: [160]u8 = undefined;
std.log.err("{s}: {s} ({d}) {s}; {s}{s}", .{ what, d.errorName(res), res, d.errorText(res), describe(&buf, d.functionName(f.handle), cfg), driver.shutdownNote(res) });
Expand Down
2 changes: 1 addition & 1 deletion zig/src/cuda/memory.zig
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub const DeviceBuffer = struct {
if (alloc_hook) |h| p = h.alloc(h.ctx, len) orelse 0;
if (p == 0) try d.check(d.api.cuMemAlloc_v2(&p, len), "cuMemAlloc");
}
held(&device_bytes, len);
finishAllocation(&device_bytes, len);
return .{ .d = d, .ptr = p, .len = len };
}

Expand Down
3 changes: 0 additions & 3 deletions zig/src/cuda/nccl.zig
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ pub const Api = struct {
ncclBroadcast: *const fn (D, D, usize, DataType, c_int, Comm, abi.Stream) callconv(.c) R,
ncclSend: *const fn (D, usize, DataType, c_int, Comm, abi.Stream) callconv(.c) R,
ncclRecv: *const fn (D, usize, DataType, c_int, Comm, abi.Stream) callconv(.c) R,
/// Frees the communicator after ending its pending work; safe from another thread while a kernel waits.
ncclCommAbort: *const fn (Comm) callconv(.c) R,
ncclCommGetAsyncError: *const fn (Comm, *Result) callconv(.c) R,
ncclGroupStart: *const fn () callconv(.c) R,
ncclGroupEnd: *const fn () callconv(.c) R,
};
Expand Down
18 changes: 18 additions & 0 deletions zig/src/cuda/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pub const Context = @import("context.zig").Context;
pub const DeviceBuffer = @import("memory.zig").DeviceBuffer;
pub const HostBuffer = @import("memory.zig").HostBuffer;
pub const memory = @import("memory.zig");
pub const memory_receipt = @import("memory_receipt.zig");
pub const setAllocationLimit = @import("memory.zig").setAllocationLimit;
pub const usage = @import("memory.zig").usage;
pub const Usage = @import("memory.zig").Usage;
pub const carveout = @import("carveout.zig");
Expand Down Expand Up @@ -54,6 +56,16 @@ pub const ck = @import("ck.zig");
pub const modelopt = @import("modelopt.zig");
pub const graph_cache = @import("graph_cache.zig");
pub const arena = @import("arena.zig");
pub const tree_attention = @import("tree_attention.zig");
pub const block_attention = @import("block_attention.zig");
pub const window_attention = @import("window_attention.zig");
pub const moe_glue = @import("moe_glue.zig");
pub const dense_rows = @import("dense_rows.zig");
pub const exl3 = @import("exl3.zig");
pub const exl3_experts = @import("exl3_experts.zig");
pub const exl3_upload = @import("exl3_upload.zig");
pub const exl3_candidate = @import("exl3_candidate.zig");
pub const exl3_grouped = @import("exl3_grouped.zig");

test {
_ = exl3_grouped;
Expand Down Expand Up @@ -92,6 +104,12 @@ test {
_ = @import("tp_watch.zig");
_ = graph_cache;
_ = arena;
_ = @import("shared_test.zig");
_ = @import("tree_attention.zig");
_ = @import("block_attention.zig");
_ = @import("window_attention.zig");
_ = @import("moe_glue.zig");
_ = @import("dense_rows.zig");
}

pub const moe = @import("moe.zig");
Expand Down
Loading