Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
tf-cuda-test modelopt: the lane rows get slice partials, which a card…
… without clusters reduces through

The fp8 and bf16 lane checks ([320, 2048], split-K 4) passed no partials buffer, so at 16 and 128 rows below sm_90
the lane's reduce wrote through a null pointer; they now pass one sized for the widest unfused call, as the fp8 and
nvfp4 tests do.
  • Loading branch information
BobClawblaw committed Oct 16, 2026
commit fcb45bdea9c73d9c7bb1113057473c6e002c4bc2
12 changes: 8 additions & 4 deletions zig/tests/cuda/modelopt_tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -187,22 +187,26 @@ fn lanes(gpu: Gpu, rng: std.Random, p: *const modelopt.Packer, lin: cuda.qlinear
defer y.free();
var y2 = try cuda.DeviceBuffer.alloc(gpu.d, m * n * 2);
defer y2.free();
try lin.decode(s, q, .{ .x = dx.ptr }, y.ptr, 16);
// the lane's slice partials where it reduces them (no clusters below sm_90): the widest unfused call is 128 rows
var part = try cuda.DeviceBuffer.alloc(gpu.d, @as(usize, qmmf.splitK(n, k)) * 128 * n * 4);
defer part.free();
const in: cuda.qlinear.Rows = .{ .x = dx.ptr, .part = part.ptr };
try lin.decode(s, q, in, y.ptr, 16);
try s.synchronize();
const wide = try check.download(gpu, y);
defer a.free(wide);
for (1..16) |rows| {
try y2.fill8(0xff, s.handle);
try lin.decode(s, q, .{ .x = dx.ptr }, y2.ptr, rows);
try lin.decode(s, q, in, y2.ptr, rows);
try s.synchronize();
try same(gpu, "decode rows at a narrower width", y2, wide[0 .. rows * n * 2]);
}
var worst = [2]f64{ 0, 0 };
try lin.prompt(s, q, .{ .x = dx.ptr }, y.ptr, m);
try lin.prompt(s, q, in, y.ptr, m);
try s.synchronize();
const prompt = try check.download(gpu, y);
defer a.free(prompt);
try lin.prompt(s, q, .{ .x = dx.ptr }, y2.ptr, 128);
try lin.prompt(s, q, in, y2.ptr, 128);
try s.synchronize();
try same(gpu, "prompt rows in a chunk of 128", y2, prompt[0 .. 128 * n * 2]);
for (0..m) |r| for (0..n) |c| {
Expand Down