Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
26 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
864fe25
Graph cache: effective settings have one digest for ranks to compare …
jayleaton Oct 16, 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
a3e2fb1
TP NCCL: all_reduce's doc says NCCL adds in its ring's order, so its …
jayleaton Oct 14, 2026
62a75ae
TP: keep Linux-only transport host tests off macOS builds
jayleaton Oct 15, 2026
e2504f6
TP: bootstrap compares the graph cache's effective settings, so a ran…
jayleaton Oct 16, 2026
5410eac
Session memory for paged-KV families: page pool, prefix trie, RAM res…
jayleaton Oct 10, 2026
0d0bdb2
Sessions: the page map is rehashed before tombstones fill it
jayleaton Oct 11, 2026
2cf61d3
Sessions: honor zero residency budgets and reserve uncapped requests
jayleaton Oct 15, 2026
dcdc30c
Keep the Linux NVMe lane test out of portable host tests
cwschroeder Oct 16, 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
Prev Previous commit
Next Next commit
TP tests: a drain on rank 0 then its clean stop ends rank 1's loop at…
… the stop word with no fail-fast exit; a rank killed mid-drain still fails the other fast.
  • Loading branch information
jayleaton committed Oct 16, 2026
commit 9af2ea2330935ec98cd72abddc92d785db5b5814
95 changes: 95 additions & 0 deletions zig/src/fabric/tp/fate_test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,98 @@ test "rank 0's clean stop ends every rank with no fail-fast exit, whatever order
try std.testing.expectEqual(@as(u32, 0), exits.load(.acquire));
try std.testing.expectEqual(@as(u32, 0), hooks.load(.acquire));
}

// -- a server's drain on two ranks: the plan link and the fate channel in the order a family's stop uses them --

const planlink = @import("planlink.zig");

/// Plan words a family's rank 0 sends: a round's operation, and a stop word that ends a follower's loop.
const op_round: i64 = 1;
const op_stop: i64 = 4;

fn linkPair(links: *[2]planlink.PlanLink) !void {
const l = try bootstrap.testListener();
defer sock.close(l.fd);
const deadline = sock.nowNs() + 5 * std.time.ns_per_s;
const a = try sock.connect("localhost", l.port, deadline);
const b = try sock.accept(l.fd, deadline);
var f0: [planlink.max_ranks]sock.Fd = @splat(-1);
var f1: [planlink.max_ranks]sock.Fd = @splat(-1);
f0[1] = b;
f1[0] = a;
links[0] = planlink.PlanLink.init(0, 2, f0);
links[1] = planlink.PlanLink.init(1, 2, f1);
}

/// Rank 1's loop: each round as it comes, until the stop word, or until the link ends.
const Follower = struct {
link: *planlink.PlanLink,
rounds: u32 = 0,
ended: enum { running, stopped, peer_closed, failed } = .running,

fn run(f: *Follower) void {
var buf: [16]i64 = undefined;
while (true) {
const msg = f.link.recv(&buf) catch |e| {
f.ended = if (e == error.PeerClosed) .peer_closed else .failed;
return;
};
if (msg.len == 0) continue;
if (msg[0] == op_stop) {
f.ended = .stopped;
return;
}
if (msg[0] == op_round) f.rounds += 1;
}
}
};

test "a drain on rank 0, then its clean stop at a round boundary: rank 1 ends its loop there and nobody exits 70" {
reset();
var fates: [2]Fate = undefined;
try pair(&fates);
var links: [2]planlink.PlanLink = undefined;
try linkPair(&links);
var follower: Follower = .{ .link = &links[1] };
const t = try std.Thread.spawn(.{}, Follower.run, .{&follower});
// serving, then draining (rank 0 refuses new work, rounds go on; the fate channel is untouched), past a grace
var sent: u32 = 0;
for (0..30) |_| {
try links[0].send(&.{ op_round, sent });
sent += 1;
sock.sleepNs(5 * std.time.ns_per_ms);
}
try std.testing.expect(!fates[0].closing.load(.acquire));
// the stop's order: the stop word first, so the follower ends its loop before the fate STOP and the hang-up
try links[0].send(&.{op_stop});
fates[0].announceStop();
links[0].close();
fates[0].close();
t.join();
// rank 1's loop returned: its model closes and the process exits 0
fates[1].close();
links[1].close();
sock.sleepNs(2 * grace + 100 * std.time.ns_per_ms);
try std.testing.expectEqual(.stopped, follower.ended);
try std.testing.expectEqual(sent, follower.rounds);
try std.testing.expectEqual(@as(u32, 0), exits.load(.acquire));
try std.testing.expectEqual(@as(u32, 0), hooks.load(.acquire));
}

test "a drain on rank 0 does not disarm fail-fast: rank 1 killed mid-drain still ends rank 0 (exit 70)" {
reset();
var fates: [2]Fate = undefined;
try pair(&fates);
defer fates[0].close();
var links: [2]planlink.PlanLink = undefined;
try linkPair(&links);
defer links[0].close();
for (0..5) |i| try links[0].send(&.{ op_round, @intCast(i) });
// rank 0 is draining (no stop announced); rank 1 is killed: its sockets close with no word
links[1].close();
fates[1].expectStop();
fates[1].close();
_ = try waitExits(1);
try std.testing.expect(std.mem.indexOf(u8, fates[0].reason(), "rank 1 closed the fate channel") != null);
try std.testing.expectEqual(@as(u32, 1), exits.load(.acquire));
}