Skip to content
Closed
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
7 changes: 5 additions & 2 deletions zig/src/native/cuda.zig
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ pub const Host = struct {
/// The family's backend, each call made with the context current on the calling thread.
fn backend(h: *Host) lanes.backend.Backend {
h.vtable = lane_backend.vtable(Host, h.inner.vtable.*);
return .{ .ptr = h, .vtable = &h.vtable };
return .{ .ptr = h, .vtable = &h.vtable, .first_before_draft = h.inner.first_before_draft };
}
};

Expand Down Expand Up @@ -487,12 +487,15 @@ test {
_ = windows;
}

test "the lane core sees a family's prefill_step through the lane backend, so a served prompt can step" {
test "CUDA host preserves prefill_step and first-before-draft capability" {
var target: lanes.fake.Fake = .{ .gpa = std.testing.allocator, .prefill_chunks = 3 };
defer target.deinit();
var h: Host = undefined;
h.inner = target.stepped();
try std.testing.expect(h.backend().vtable.prefill_step != null);
try std.testing.expect(!h.backend().first_before_draft);
h.inner.first_before_draft = true;
try std.testing.expect(h.backend().first_before_draft);
}

test "every registered family and d1's decision engine are listed for capabilities" {
Expand Down