Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5c3ce6e
changelog: #4496 under Unreleased
ashhart Nov 23, 2026
e2fc534
gemma4 metal: note the chunked prefill under Unreleased
ashhart Nov 17, 2026
5d50066
changelog: #3025 under Unreleased
ashhart Nov 23, 2026
fcb4079
refactor(cuda): place GLM from one resolved launch
laudney Nov 11, 2026
2332f9f
muse_spark: weightShare takes rank and tp like the other families, af…
ashhart Nov 19, 2026
3f663ec
refactor(cuda): place MiniMax from the resolved launch
laudney Nov 11, 2026
88871c5
refactor(cuda): place Nemotron from the resolved launch
laudney Nov 11, 2026
f609e6e
docs(recipes): launch tensor-parallel ranks with flags
laudney Nov 11, 2026
80e5886
fix(minimax): name --tp and --rank in its refusals
laudney Nov 11, 2026
8b6de90
fix(cuda): name only given values in launch refusals
laudney Nov 11, 2026
b2bcbab
docs(recipes): leave the alias release to the start-up warning
laudney Nov 11, 2026
ae5268b
fix(cuda): count the dense tower on rank 0 with the other towers
laudney Nov 15, 2026
fc52e19
refactor(cuda): check a launch's place inside its resolver
laudney Nov 15, 2026
52bfb97
dots_mocr: the tower test passes visionBytes rank 0 of 1, after main'…
ashhart Nov 20, 2026
72c3444
tests: refresh serving pins after the unified CUDA launch rebase
ashhart Nov 21, 2026
335ca24
tests: use documentation addresses in the rendezvous fake
ashhart Nov 21, 2026
15bcba1
tests: format rebased GLM rank wiring
ashhart Nov 23, 2026
f2ed3cd
changelog: #2919 under Unreleased
ashhart Nov 23, 2026
177033d
changelog: each line once under Unreleased
ashhart Nov 23, 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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel

## Unreleased

- GLM, MiniMax and Nemotron on CUDA: each is placed by `--tp`, `--rank`, `--master` and `--master-port`, and `--master` with `--master-port` sets `NCCL_COMM_ID` when it is unset (a different one refuses); `TF_GLM_RANK`/`TF_GLM_WORLD`, `TF_MINIMAX_RANK`/`TF_MINIMAX_WORLD` and `TF_NEMOTRON_RANK`/`TF_NEMOTRON_WORLD` still work as aliases until 1.3.1, with a start-up warning, and a flag and an alias that differ refuse (#2919, part of #2560). Thanks to @laudney.

- Gemma 4 on Metal: a new stream's prompt fills one chunk per call at the same chunk cuts as before, with other streams' decode rounds running between chunks, so a long prompt no longer freezes their replies; a cancel between chunks keeps the last finished chunk, and a drafting stream's drafter takes each chunk's tapped rows as it lands (#3025, fixes #3021).

- Qwen3.5/3.8 on CUDA: `TF_QWEN35_ATTN_ALL_ROWS=1` sends multi-row BF16 decode windows to the existing rows attention kernel at every context length (it already matches the one-row kernel's score and reduction order), removing the dead second launch below 8K; off by default (#N).



- Tests: a GB10 check compares Qwen CUDA prompts run in one pass against 512-row capped cuts with a second stream live, byte for byte and over the next 64 greedy tokens (#N).

- Flash Next on Metal: `TF_FLASHNEXT_BATCH_GDN_WIDE=1` runs 8- and 16-row batch segments on the existing non-replay GDN kernel instead of the recorded pipe; off by default until the M3 and M5 checks (#N).
Expand Down
2 changes: 1 addition & 1 deletion docs/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ gathers whose stride exceeds the ceiling. `TF_TP_MAILBOX_MAX_KB` still sizes the
is the smaller of the two limits. Changing the relay ceiling does not resize those slots or change gathered bytes.

This setting is read directly by the TP parser, outside the profile registry. Invalid values refuse by name, and
relay ranks must agree on the value. GLM uses its actual `TF_GLM_WORLD` and rank for relay validation, so a four-rank
relay ranks must agree on the value. GLM uses its actual world (`--tp`, or `TF_GLM_WORLD`) and rank for relay validation, so a four-rank
GLM run does not also need `TF_TP_WORLD=4`. With `TF_GLM_ROCE_MULTI=1`, a relay outside four ranks is refused before
weights load.
The relay remains opt-in through `TF_TP_ROCE_RELAY=1`; mesh, two-rank paths and all-reduce routing keep their defaults.
Expand Down
8 changes: 4 additions & 4 deletions docs/recipes/cuda.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ Each engine defines its own serial reference. A verify row uses the same group o
rounding as that row alone. Attention partitions depend on absolute key position; router ties use a
stable ID order. Recurrent commits replay the accepted path with the same update routine.

Native CUDA has tensor-parallel serving as well as one-GPU paths. GLM's recorded TP=2 and TP=3 setups use
`TF_GLM_RANK`, `TF_GLM_WORLD` and `NCCL_COMM_ID`; see [native GLM placement](glm-5.3-flash-cuda.md#run).
Other families take `--tp`, `--rank` and `--master` only where their native options support ranks; for example,
[Super VL](nemotron-3.5-super-vl.md) serves on one or two GB10s. A rank option is not universal family support.
Native CUDA has tensor-parallel serving as well as one-GPU paths. GLM, MiniMax and Nemotron take
`--tp`, `--rank`, `--master` and `--master-port` (see [native GLM placement](glm-5.3-flash-cuda.md#run)); their
`TF_*_RANK` and `TF_*_WORLD` variables are aliases for one release (the start-up warning names the release that refuses them). Other families take the flags only where their native
options support ranks; for example, [Super VL](nemotron-3.5-super-vl.md) serves on one or two GB10s. A rank option is not universal family support.

The following transport and two-rank reduction notes describe Python 0.6.6. In that engine, @jayleaton's
[#219](https://github.com/ashhart/TensorFold/pull/219) gave the communicator its transport interface
Expand Down
21 changes: 12 additions & 9 deletions docs/recipes/glm-5.3-flash-cuda.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,30 @@ NVIDIA's FP4-Local checkpoint as stored and from XSFP4, which keeps FP4-Local's
Jammed XSFP4, in [1.2.3](../../CHANGELOG.md#123) ([#2041](https://github.com/ashhart/TensorFold/pull/2041)), holds those experts at block 32 in the `csf0_v1` form and loads the same way.
Jammed XSFP4 NZ5, in [1.2.10](../../CHANGELOG.md#1210) ([#2894](https://github.com/ashhart/TensorFold/pull/2894)), is Jammed XSFP4 refitted with E2M1's -0 code read as +5 (`NVFP4_NZ5`) and loads the same way.
Rank 0 serves HTTP and the other ranks follow its steps, with MTP drafts, concurrent streams and kept prompt states.
The [Python 0.6.6 recipe](glm-5.3-flash.md) and its `--tp`, `--rank` and `--master` flags belong to the frozen engine.
The [Python 0.6.6 recipe](glm-5.3-flash.md) belongs to the frozen engine; the native server takes the same `--tp`, `--rank`
and `--master` flags.

## Run

`TF_GLM_RANK` of `TF_GLM_WORLD` places each rank, and `NCCL_COMM_ID` names rank 0's address and port on the link
between the hosts ([placement](../multi-rank-receipts.md)). Give every rank the same arguments: before the weights load
`--rank` of `--tp` places each rank, and `--master` with `--master-port` names rank 0's address and port on the link
between the hosts; they become NCCL's root (`NCCL_COMM_ID`, which may be set instead, and must match when both are)
([placement](../multi-rank-receipts.md)). `TF_GLM_RANK` and `TF_GLM_WORLD` still place a rank as aliases of `--rank` and `--tp` for one release; the start-up warning names the release that refuses them
with the flag to use; a flag and an alias that differ refuse. Give every rank the same arguments: before the weights load
the ranks compare their settings, model and build, and name the field and rank that differ. `--context` takes a
positive limit for GLM. On two GB10s, with 192.0.2.1 as rank 0's address on their direct link:

```bash
tensorfold pull nvidia/GLM-5.3-Flash-NVFP4@423acf37583782c51c142d145aef733d72943d93
# on rank 1
TF_GLM_RANK=1 TF_GLM_WORLD=2 NCCL_COMM_ID=192.0.2.1:29583 \
tensorfold serve nvidia/GLM-5.3-Flash-NVFP4 --context 245760 --parallel 1
tensorfold serve nvidia/GLM-5.3-Flash-NVFP4 --tp 2 --rank 1 --master 192.0.2.1 --master-port 29583 \
--context 245760 --parallel 1
# on rank 0 (192.0.2.1)
TF_GLM_RANK=0 TF_GLM_WORLD=2 NCCL_COMM_ID=192.0.2.1:29583 \
tensorfold serve nvidia/GLM-5.3-Flash-NVFP4 --context 245760 --parallel 1
tensorfold serve nvidia/GLM-5.3-Flash-NVFP4 --tp 2 --rank 0 --master 192.0.2.1 --master-port 29583 \
--context 245760 --parallel 1
```

Set `NCCL_SOCKET_IFNAME` and `NCCL_IB_HCA` for the link between the hosts as NCCL documents them. Each rank keeps a
TCP line to rank 0 on the port after `NCCL_COMM_ID`'s (29584 here), opened before NCCL: a rank that fails, refuses or
TCP line to rank 0 on the port after the root's (29584 here), opened before NCCL: a rank that fails, refuses or
dies stops the others.

The contributed runs read that revision. The repository's later commit `da920bb0`, which declares the MTP layer as
Expand Down Expand Up @@ -243,7 +246,7 @@ default, 4 to 1024); larger ones, reductions and exchanges stay on NCCL. On the
cold 64K prompts in 36.5 s and decode at 73.1 / 60.8 tok/s (code / chat, temperature 0) with the relay off, and
36.7 s and 75.3 / 62.7 tok/s with it on (#2569).

`TF_GLM_WORLD=3` places a third rank the same way. From 1.1.2 the uneven KDA input projections of TP=3 (22, 21 and
`--tp 3` places a third rank the same way. From 1.1.2 the uneven KDA input projections of TP=3 (22, 21 and
21 heads) run instead of being refused; TP=3 device qualification is pending
([#1067](https://github.com/ashhart/TensorFold/issues/1067)). How a prompt's rows reach the other ranks
(`TF_GLM_PREFILL_REDUCE`) and the RoCE gathers (`TF_ROCE`: on at two ranks, `TF_ROCE=1` at three or more) are in
Expand Down
17 changes: 9 additions & 8 deletions docs/recipes/minimax-m3.1-flash-cuda.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,23 @@ rank, the vocabulary split 782 and 781 blocks.
## Run

The family is admitted only as it was run: on GB10 (sm_121) at two ranks. Any other GPU is refused
(`MiniMaxM3RequiresSm121`), and so is one rank or any other world (`MiniMaxM3RequiresTwoRanks`). `TF_MINIMAX_RANK`
(0 or 1) of `TF_MINIMAX_WORLD=2` places each rank, and `NCCL_COMM_ID` names rank 0's address and port on the link
between the hosts. With 192.0.2.1 as rank 0's address on their direct link, the same folder on both:
(`MiniMaxM3RequiresSm121`), and so is one rank or any other world (`MiniMaxM3RequiresTwoRanks`). `--rank`
(0 or 1) of `--tp 2` places each rank, and `--master` with `--master-port` names rank 0's address and port on the link
between the hosts (NCCL's root, `NCCL_COMM_ID`). `TF_MINIMAX_RANK` and `TF_MINIMAX_WORLD` still place a rank as aliases of `--rank` and `--tp` for one release; the start-up warning names the release that refuses them
with the flag to use; a flag and an alias that differ refuse. With 192.0.2.1 as rank 0's address on their direct link, the same folder on both:

```bash
export NCCL_RUNTIME_CONNECT=0 NCCL_CUMEM_ENABLE=0 NCCL_CUMEM_HOST_ENABLE=0 # on GB10 pairs
# on rank 1
TF_MINIMAX_RANK=1 TF_MINIMAX_WORLD=2 NCCL_COMM_ID=192.0.2.1:29581 TENSORFOLD_MEMORY_RESERVE_GIB=3 \
tensorfold serve ~/models/mm-exl3 --context 32768 --parallel 2 --prompt-cache-gib 3 --vision
TENSORFOLD_MEMORY_RESERVE_GIB=3 tensorfold serve ~/models/mm-exl3 --tp 2 --rank 1 --master 192.0.2.1 \
--master-port 29581 --context 32768 --parallel 2 --prompt-cache-gib 3 --vision
# on rank 0 (192.0.2.1)
TF_MINIMAX_RANK=0 TF_MINIMAX_WORLD=2 NCCL_COMM_ID=192.0.2.1:29581 TENSORFOLD_MEMORY_RESERVE_GIB=3 \
tensorfold serve ~/models/mm-exl3 --context 32768 --parallel 2 --prompt-cache-gib 3 --vision
TENSORFOLD_MEMORY_RESERVE_GIB=3 tensorfold serve ~/models/mm-exl3 --tp 2 --rank 0 --master 192.0.2.1 \
--master-port 29581 --context 32768 --parallel 2 --prompt-cache-gib 3 --vision
```

Set `NCCL_SOCKET_IFNAME` and `NCCL_IB_HCA` for the link as NCCL documents them; each rank keeps a TCP line to rank 0
on the port after `NCCL_COMM_ID`'s, so a rank that fails stops the others. On two ranks the layers' small gathers go by
on the port after the root's, so a rank that fails stops the others. On two ranks the layers' small gathers go by
RoCE writes (as GLM's); `TF_ROCE=0` leaves them to NCCL and `TF_ROCE_MAX_KB` caps a rank's bytes.

- The key/value cache is bf16, exact; a token takes 75 KiB a rank at TP=2 across the 60 layers (keys and values of the
Expand Down
11 changes: 6 additions & 5 deletions docs/recipes/nemotron-3.5-super-vl.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,16 @@ too) and computes it for rank 0's jobs. The ranks meet over NCCL, which the engi

```bash
# on rank 1
TF_NEMOTRON_RANK=1 TF_NEMOTRON_WORLD=2 NCCL_COMM_ID=192.0.2.1:29741 \
tensorfold serve /models/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4
tensorfold serve /models/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4 --tp 2 --rank 1 --master 192.0.2.1 --master-port 29741
# on rank 0 (192.0.2.1)
TF_NEMOTRON_RANK=0 TF_NEMOTRON_WORLD=2 NCCL_COMM_ID=192.0.2.1:29741 \
tensorfold serve /models/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4 --name super --vision --host 0.0.0.0
tensorfold serve /models/NVIDIA-Nemotron-3.5-Super-VL-120B-A12B-NVFP4 --tp 2 --rank 0 --master 192.0.2.1 --master-port 29741 \
--name super --vision --host 0.0.0.0
```

`TF_NEMOTRON_RANK` and `TF_NEMOTRON_WORLD` still place a rank as aliases of `--rank` and `--tp` for one release; the start-up warning names the release that refuses them
with the flag to use; a flag and an alias that differ refuse.
Set `NCCL_SOCKET_IFNAME` and `NCCL_IB_HCA` for the link between the hosts as NCCL documents them. Rank 1 keeps a TCP
line to rank 0 on the port after `NCCL_COMM_ID`'s (29742 here), opened before NCCL. Before any weight loads, both ranks
line to rank 0 on the port after the root's (29742 here), opened before NCCL. Before any weight loads, both ranks
check that they run the same build, model, cut and precision and the same checkpoint layout: config.json, the index,
and each shard's name, size and header. While the weights load, each rank reads and hashes every byte of every shard
it holds (sha256), and checks each file against its Hugging Face blob name, which is its sha256, when the folder is a
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes/persisted-serving-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ grids, and whether a captured set runs with which entries on our glue. `TF_FLASH
keyed through the profile rows. Its draft, window, round, graph, lane-parts (`TF_FLASHNEXT_LANE_PARTS`), load-thread, I/O and dense-split settings and
`TF_FLASHNEXT_KV_PAGE_TEST` are not keyed: kept states come only from prompt passes, which those settings either never
reach, reach with the same launches or the same kernels addressing pages, or refuse for disk at `--tp 2`.
Nemotron on CUDA keys `--precision checkpoint`'s math, the expert ranks of `TF_NEMOTRON_WORLD`, a ModelOpt
Nemotron on CUDA keys `--precision checkpoint`'s math, the expert ranks of `--tp` (or `TF_NEMOTRON_WORLD`), a ModelOpt
checkpoint's NVFP4 decode warps and lane half-tile threshold, the experts' resident grids and, with a captured set, the
attention variant `--context` picks by its chunk count. Its pages, poison fill, carveout, segments, graph log and trace,
and the context on our own glue, are not keyed: they place memory, fill pages before use, log, run only passes that
Expand Down
4 changes: 3 additions & 1 deletion zig/build/cuda_engines.zig
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ pub fn engines(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bu
const api = qwen35.import_table.get("engine_api").?; // family()'s, so the server and qwen3_5 share one
const canon = canonModule(b, target, optimize);
const verbs = @import("tp.zig").verbsModule(b, target, optimize);
const glm = glmCudaShared(b, target, optimize, cuda, core, lanes, heat, api, canon, verbs);
const mod = b.createModule(.{
.root_source_file = b.path("zig/src/native/cuda.zig"),
.target = target,
Expand All @@ -78,7 +79,8 @@ pub fn engines(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.bu
.{ .name = "lfm2", .module = lfm2Module(b, target, optimize, cuda, core) },
.{ .name = "core", .module = core },
.{ .name = "flashnext", .module = flashnextModule(b, target, optimize, cuda, core, lanes, qwen_vision, api) },
.{ .name = "glm_cuda", .module = glmCudaShared(b, target, optimize, cuda, core, lanes, heat, api, canon, verbs) },
.{ .name = "glm_cuda", .module = glm },
.{ .name = "mesh", .module = glm.import_table.get("mesh").? }, // the launch resolver's, GLM's one instance
.{ .name = "qwen3_cuda", .module = qwen3Module(b, target, optimize, cuda, core, lanes, api) },
.{ .name = "minimax_m3_cuda", .module = @import("minimax_cuda.zig").module(b, target, optimize, cuda, core, lanes) },
.{ .name = "qwen35", .module = qwen35 },
Expand Down
2 changes: 1 addition & 1 deletion zig/src/cli/cuda_main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ pub fn main(init: std.process.Init) !u8 {
const segments = opts.segments orelse @as(usize, @intCast((try settings.parse("TF_CUDA_SEGMENTS", init.environ_map.get("TF_CUDA_SEGMENTS"))) orelse 1));
// a rank past 0 of a tensor-parallel latent MoE holds expert shares and serves rank 0's jobs, whatever the command
if (init.environ_map.get("TF_NEMOTRON_RANK")) |r| if (!std.mem.eql(u8, r, "0")) {
nemotron.worker.serve(gpa, init.io, &ctx, opts.model, opts.math) catch |err| {
nemotron.worker.serve(gpa, init.io, &ctx, opts.model, opts.math, null) catch |err| {
cuda.tp_watch.fail(@errorName(err)); // rank 0 stops with this rank's error
std.log.err("expert rank stopped: {s}", .{@errorName(err)});
std.c._exit(1); // a stream may still wait on rank 0: a normal exit would join it
Expand Down
3 changes: 3 additions & 0 deletions zig/src/core/engine_api.zig
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,9 @@ pub const Open = struct {
execution_witness: bool = false, // --execution-witness: an engine on a supported path attests it (Info.witness)
rank: u32 = 0,
given: Given = .{},
/// The build's release (rank aliases retire by it) and where `tp` came from, for the start-up line.
release: []const u8 = "",
launch_from: []const u8 = "",
master: []const u8 = "",
master_port: u16 = 29551,
/// --policy: the engine's policy as `key=value,...`; empty: its defaults.
Expand Down
58 changes: 58 additions & 0 deletions zig/src/cuda/rendezvous.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//! NCCL's root for a family over hosts: --master and --master-port become NCCL_COMM_ID when it is unset.
const std = @import("std");
const env = @import("sys").env;

/// NCCL's root from --master and --master-port when NCCL_COMM_ID is unset; first in `open`, before the liveness line.
pub fn fromMaster(o: anytype, lookup: anytype, out: anytype) !void {
if (o.tp <= 1) return;
const master = o.master orelse return; // without --master, NCCL_COMM_ID stays required as today (NoCommId)
var buf: [320]u8 = undefined;
const want = std.fmt.bufPrintSentinel(&buf, "{s}:{d}", .{ master, o.master_port }, 0) catch return error.MasterTooLong;
if (lookup.get("NCCL_COMM_ID")) |have| {
if (!std.mem.eql(u8, have, want)) return error.RendezvousDisagree;
return;
}
out.put("NCCL_COMM_ID", want);
}

/// The process environment, for `rendezvous` outside tests: NCCL's own variable, the only one it reads.
pub const Process = struct {
pub fn get(_: Process, _: [:0]const u8) ?[]const u8 {
return if (std.c.getenv("NCCL_COMM_ID")) |v| std.mem.span(v) else null;
}
pub fn put(_: Process, name: [:0]const u8, value: [:0]const u8) void {
_ = env.setenv(name, value, 1);
}
};

test "the rendezvous sets NCCL_COMM_ID from --master once, keeps an equal one, refuses a different one" {
const Fake = struct {
have: ?[]const u8 = null,
set: ?[]const u8 = null,
buf: [64]u8 = undefined,
pub fn get(f: *@This(), _: [:0]const u8) ?[]const u8 {
return f.have;
}
pub fn put(f: *@This(), _: [:0]const u8, v: [:0]const u8) void {
@memcpy(f.buf[0..v.len], v);
f.set = f.buf[0..v.len];
}
};
const O = struct { tp: u32, master: ?[]const u8, master_port: u16 };
var f: Fake = .{};
try fromMaster(O{ .tp = 2, .master = "192.0.2.7", .master_port = 29583 }, &f, &f);
try std.testing.expectEqualStrings("192.0.2.7:29583", f.set.?);
f = .{ .have = "192.0.2.7:29583" };
try fromMaster(O{ .tp = 2, .master = "192.0.2.7", .master_port = 29583 }, &f, &f);
try std.testing.expect(f.set == null);
f = .{ .have = "192.0.2.8:29583" };
try std.testing.expectError(error.RendezvousDisagree, fromMaster(O{ .tp = 2, .master = "192.0.2.7", .master_port = 29583 }, &f, &f));
f = .{};
var long: [400]u8 = undefined;
@memset(&long, 'h');
try std.testing.expectError(error.MasterTooLong, fromMaster(O{ .tp = 2, .master = &long, .master_port = 29583 }, &f, &f));
f = .{};
try fromMaster(O{ .tp = 1, .master = "192.0.2.7", .master_port = 29583 }, &f, &f);
try fromMaster(O{ .tp = 2, .master = null, .master_port = 29583 }, &f, &f);
try std.testing.expect(f.set == null);
}
2 changes: 2 additions & 0 deletions zig/src/cuda/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub const rank_scatter = @import("rank_scatter.zig");
pub const relay_plan = @import("relay_plan.zig");
pub const tp_group = @import("tp_group.zig");
pub const tp_watch = @import("tp_watch.zig");
pub const rendezvous = @import("rendezvous.zig");
pub const startup_log = @import("startup_log.zig");
pub const startup_watch = @import("startup_watch.zig");
pub const p2p_report = @import("p2p_report.zig");
Expand Down Expand Up @@ -143,6 +144,7 @@ test {
_ = @import("modelopt.zig");
_ = @import("ck.zig");
_ = @import("tp_watch.zig");
_ = @import("rendezvous.zig");
_ = @import("shared_test.zig");
_ = @import("tree_attention.zig");
_ = @import("block_attention.zig");
Expand Down
5 changes: 3 additions & 2 deletions zig/src/cuda_dense/native.zig
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ fn WithTower(comptime R: type, comptime T: type) type {
return C.loaded(Loaded, try C.open(gpa, io, ctx, dir, kernels, o));
}

/// The tower's device bytes beside the text weights: its weights, its largest image's scratch, its workspace.
pub fn visionBytes(a: std.mem.Allocator, io: std.Io, dir: []const u8) !u64 {
/// The tower's device bytes on rank 0, which holds it: its weights, its largest image's scratch, its workspace.
pub fn visionBytes(a: std.mem.Allocator, io: std.Io, dir: []const u8, rank: u32, _: u32) !u64 {
if (rank != 0) return 0;
return try T.weightBytes(a, io, dir) + try T.openBytes(a, io, dir);
}

Expand Down
Loading
Loading