Skip to content
Closed
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: 3 additions & 1 deletion zig/tests/cuda/contract_flashnext_fexp.zig
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ pub const Fexp = struct {
const a = self.rig.gpu.gpa;
for (self.aff.items) |f| f.deinit();
self.aff.clearRetainingCapacity();
for ([_][]const u8{ std.mem.sliceAsBytes(self.expert), std.mem.sliceAsBytes(self.gs), std.mem.sliceAsBytes(self.us) }) |b| if (b.len > 0) a.free(b);
a.free(self.expert);
a.free(self.gs);
a.free(self.us);
self.expert = &.{};
self.gs = &.{};
self.us = &.{};
Expand Down
2 changes: 1 addition & 1 deletion zig/tests/cuda/contract_glm_attn.zig
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub const Chunks = struct {
ds[i] = abs * scale * 520 * 0x1p-24;
most = pages.maxNan(most, s[i]);
}
for (p, s) |*x, v| x.* = @exp(v - most);
for (p, s[0..n]) |*x, v| x.* = @exp(v - most);
const l = if (acc) |k| pages.sumIn(k, order, p) else pages.sumIn(.none, .sequential, p);
const col = try a.alloc(f64, n);
defer a.free(col);
Expand Down
2 changes: 1 addition & 1 deletion zig/tests/cuda/contract_window_rows.zig
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ pub const Rows = struct {
const a = self.arena.allocator();
const f = self.f;
const kv = f.hk * f.d;
for (0..kc.len / kv) |i| @memcpy(kc[i * kv ..][0..kv], kc[0..kv]);
for (1..kc.len / kv) |i| @memcpy(kc[i * kv ..][0..kv], kc[0..kv]); // the rows after the first take its keys
@memset(vc, 0);
const n = self.call.rows;
const lo = self.call.first(self.call.at(n - 1).p);
Expand Down
Loading