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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ Each release's page on GitHub has its notes and measurements. See [the 1.0.0 rel

## Unreleased

- Pull: `tensorfold pull` no longer stops with "detecting network configuration failed" after 64 distinct resolved addresses on a long pull; a full address table replaces its oldest entry (#4621, follows #4140).

- Metal: a checkpoint file span of 16 GiB or more loads; each `pread` asks for at most 1 GiB, since macOS refuses a count above INT_MAX (#4435). Thanks to @sethforprivacy, and to @markyu0401 for the first fix (#4433).



- HIP: a DFlash2 hold runs only the rows its drafts need (a frame takes its deepest stream's drafts plus the pending row, within the block), and a draft's marginal cost is measured at load to price holds (0.56 ms a draft on gfx1151 against the full block's 1.73 ms), so the depth rule prices shared rounds at what a hold costs; the 27B recipe's DFlash2 figures are refreshed on current main, and nothing changes without `--drafter` (#3918, fixes #1563). Thanks to @AbrahamCete.

- GLM at TP=2 on CUDA: with `TF_GLM_PAIR_EXPERTS=1` (opt-in), paired prompt chunks pass each rank's own FFN partial under the default split reduction, so their hidden states and tokens match the unpaired path; off, nothing changes (#4619, fixes #4493).
Expand Down
15 changes: 10 additions & 5 deletions zig/src/cli/pull_route.zig
Original file line number Diff line number Diff line change
Expand Up @@ -209,18 +209,23 @@ pub fn tunnelOf(io: std.Io, address: *const std.Io.net.IpAddress) ?Tunnel {
const AddressDeadline = struct { address: std.Io.net.IpAddress = undefined, deadline: std.Io.Clock.Timestamp = .{ .raw = .zero, .clock = .awake } };
var addresses: [64]AddressDeadline = @splat(.{});
var address_count: usize = 0;
var address_next: usize = 0; // once full, the oldest entry is replaced (a pull over rotating CDN addresses never runs out)

/// Carries a name's original deadline to each address the resolver returned.
pub fn rememberAddress(io: std.Io, address: std.Io.net.IpAddress, deadline: std.Io.Clock.Timestamp) !void {
/// Carries a name's deadline to each resolved address; when full, the oldest goes (its connect gets a fresh deadline).
pub fn rememberAddress(io: std.Io, address: std.Io.net.IpAddress, deadline: std.Io.Clock.Timestamp) error{TooManyHosts}!void {
lock.lockUncancelable(io);
defer lock.unlock(io);
for (addresses[0..address_count]) |*a| if (a.address.eql(&address)) {
a.deadline = deadline;
return;
};
if (address_count == addresses.len) return error.TooManyHosts;
addresses[address_count] = .{ .address = address, .deadline = deadline };
address_count += 1;
if (address_count < addresses.len) {
addresses[address_count] = .{ .address = address, .deadline = deadline };
address_count += 1;
return;
}
addresses[address_next] = .{ .address = address, .deadline = deadline };
address_next = (address_next + 1) % addresses.len;
}

pub fn addressDeadline(io: std.Io, address: *const std.Io.net.IpAddress) ?std.Io.Clock.Timestamp {
Expand Down
12 changes: 12 additions & 0 deletions zig/src/cli/pull_route_test.zig
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,15 @@ test "pull proxy: the timeouts read their own variables" {
try std.testing.expectEqual(@as(u32, 5), s.connect_s);
try std.testing.expectEqual(@as(u32, 7), s.stall_s);
}

test "pull route: more distinct addresses than the table holds never fails a pull; the newest keeps its deadline" {
const io = std.testing.io;
const deadline: std.Io.Clock.Timestamp = .{ .raw = .zero, .clock = .awake };
var i: usize = 0;
while (i < 200) : (i += 1) {
const address: std.Io.net.IpAddress = .{ .ip4 = .{ .bytes = .{ 10, 99, @intCast(i / 256), @intCast(i % 256) }, .port = 443 } };
try route.rememberAddress(io, address, deadline);
}
const newest: std.Io.net.IpAddress = .{ .ip4 = .{ .bytes = .{ 10, 99, 0, 199 }, .port = 443 } };
try std.testing.expect(route.addressDeadline(io, &newest) != null);
}
Loading