Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
39de039
lane core and native CUDA host for two-rank families with a vision to…
BobClawblaw Oct 14, 2026
22d92e4
lane host: a warm pass that steps aside is not launched after its can…
BobClawblaw Oct 15, 2026
ef73ec3
tf_video: the includes back under its one-line header
BobClawblaw Oct 15, 2026
cc5d9d1
vision inputs: a server without --vision refuses image parts in the f…
BobClawblaw Oct 15, 2026
aaed024
qwen_image.formatSeconds: t * 10 rounded in integers, not f128, so te…
BobClawblaw Oct 15, 2026
9e6dfcd
lane host: a set-up job's kept entry stays pinned until its restore r…
BobClawblaw Oct 15, 2026
c6418f3
Flash Next's embedding row matches the host dequant of the same MLX g…
AdrianBinDC Oct 7, 2026
1dca5c1
Layer 0's first hyper-connection matches its host check on one token,…
AdrianBinDC Oct 7, 2026
cd57bfc
Layer 0's linear-attention projection matches the host group-32 dot o…
AdrianBinDC Oct 7, 2026
37dec96
Layer 0's linear-attention convolution, recurrence and output multipl…
AdrianBinDC Oct 7, 2026
2590dfc
Layer 0's second hyper-connection matches its host check on one token…
AdrianBinDC Oct 7, 2026
58fed6c
Layer 0's experts match the host check on one token, the top 10 and t…
AdrianBinDC Oct 7, 2026
69c4888
Layer 3's full attention matches the host check on one decode token, …
AdrianBinDC Oct 7, 2026
8a4add2
Layer 7's full attention matches the host check on one decode token, …
AdrianBinDC Oct 7, 2026
40472fb
Layer 11's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
307312a
Layer 15's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
d91b049
Layer 19's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
fcd0c15
Layer 23's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
0b4eab2
Layer 27's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
fbb2776
Layer 31's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
43961f6
Layer 35's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
8949cd1
Layer 39's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
2bb8a78
Layer 43's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
8c50b42
Layer 47's full attention matches the host check on one decode token,…
AdrianBinDC Oct 7, 2026
1bbed57
Layer 2's n-gram table matches the host dequant on one decode token, …
AdrianBinDC Oct 7, 2026
994c2ff
The final mix and the word scores match the host check on one decode …
AdrianBinDC Oct 7, 2026
7f0794d
One drafts-off prompt matches the Python engine, eight greedy token i…
AdrianBinDC Oct 7, 2026
0d04c43
Keep the drafts-off prompt match after splitting the forward and pack…
AdrianBinDC Oct 7, 2026
785896e
Flash Next CUDA: prompt ids and positions upload on the compute strea…
ZackSample Oct 11, 2026
8391cac
native/cuda.zig takes each CUDA family's prompt-cache copies, cache r…
ZackSample Oct 15, 2026
bd35940
CUDA experts over a window's or a prompt chunk's rows, each row with …
ZackSample Oct 15, 2026
2484c93
triton_aot_pack.py: a constexpr Triton folded from None is left out, …
ZackSample Oct 15, 2026
5cf4291
Flash Next CUDA: prompts and decode rounds on one batched pass, with …
ZackSample Oct 15, 2026
035b7f9
Flash Next CUDA: the MTP head, its draft chains, verify windows and t…
ZackSample Oct 15, 2026
1ac9bd0
Flash Next CUDA serves several streams through the lane core: drafted…
ZackSample Oct 15, 2026
62865ab
Flash Next CUDA: buffers are zeroed on the compute stream, so a pass …
ZackSample Oct 15, 2026
8d32cd3
Docs: Flash Next on CUDA, its recipe, the CUDA and Flash Next pages, …
ZackSample Oct 15, 2026
52b82fc
prompt cache: an entry removed while pinned is dead to lookups and fr…
BobClawblaw Oct 15, 2026
b45e26a
Flash Next CUDA refuses the config.json settings its kernels fix: RMS…
ZackSample Oct 15, 2026
9fa628b
Flash Next CUDA: a failed zero fill frees the buffer it was filling
ZackSample Oct 15, 2026
475df92
Flash Next CUDA: a pass's uploads read pinned staging the scratch own…
ZackSample Oct 15, 2026
1e86036
Core: router logits and softmax top-k rows for every CUDA family (rou…
ZackSample Oct 15, 2026
794d273
Core: token rows in groups of 32 with a copy a stream, and RMS rows w…
ZackSample Oct 15, 2026
ea7d098
Flash Next CUDA: its own glue kernels, flashnext_hc.cu and flashnext_…
ZackSample Oct 15, 2026
38c9c63
Flash Next CUDA boots on its own glue; a captured set that holds ever…
ZackSample Oct 15, 2026
235ea01
Flash Next CUDA: TF_FLASHNEXT_OWNED runs named entry points on our gl…
ZackSample Oct 15, 2026
7746bb9
Docs: Flash Next on CUDA boots on its own kernels; a captured set is …
ZackSample Oct 15, 2026
e7163c5
Flash Next CUDA: each layer_types label must be the exact role the ke…
ZackSample Oct 15, 2026
4b46157
Flash Next CUDA: a failed upload or record drains the stream before t…
ZackSample Oct 15, 2026
3f069e3
Add lossless NVFP4 compressed scale planes and TP slices
akol1 Oct 16, 2026
6837fae
Integrate shared native TP host APIs with Flash Next CUDA
akol1 Oct 16, 2026
33d6494
core: admit ModelOpt NVFP4 checkpoints from config.json's quantizatio…
Bizuayeu Oct 12, 2026
9d4a6fa
core: read ModelOpt NVFP4 linears as stored, with an f32 reference row
Bizuayeu Oct 12, 2026
798d38f
core: the ModelOpt NVFP4 linear's test decodes with core/quant's refe…
Bizuayeu Oct 15, 2026
d06009d
Add lossless NVFP4 compressed scale planes and TP slices
akol1 Oct 16, 2026
2868a9a
cuda: refuse tensor parallelism before loading unranked families
akol1 Oct 16, 2026
d631b15
core: read exact rank-local NVFP4 tensors with plain or compressed sc…
akol1 Oct 16, 2026
0a0bb86
core: read exact rank-local NVFP4 tensors with plain or compressed sc…
akol1 Oct 16, 2026
f1f7f9a
cuda: serve losslessly packed MXFP8 projections through native qlinear
akol1 Oct 16, 2026
17ce054
cuda: serve losslessly packed MXFP8 projections through native qlinear
akol1 Oct 16, 2026
f6a0055
Expose FP32 lane projection outputs before residual reduction
akol1 Oct 16, 2026
1f17be1
Read native NVFP4 n-gram rows directly from mapped checkpoint shards
akol1 Oct 16, 2026
3d56b2a
Expose FP32 lane projection outputs before residual reduction
akol1 Oct 16, 2026
32be3e5
Preserve dense connection weights and FP32 normalization in native CU…
akol1 Oct 16, 2026
2187111
Support exact BF16 token rows and dense vocabulary projections
akol1 Oct 16, 2026
97715a2
Load mixed dense and microscaled projections without requantization
akol1 Oct 16, 2026
2661d28
Load exact rank-local NVFP4 routed expert partitions
akol1 Oct 16, 2026
041cc0a
Run the mixed-format shared expert separately from routed partitions
akol1 Oct 16, 2026
359eef3
Bound CUDA rank control and NCCL collective failures
akol1 Oct 16, 2026
567be14
Add bounded Flash Next rank replay and checkpoint norm conversion
akol1 Oct 16, 2026
aa4015e
Serve mixed-format Flash Next ranks with bounded admission and health
akol1 Oct 16, 2026
a801b9a
Report unavailable engine health and preserve admission HTTP 503
akol1 Oct 16, 2026
09830ff
perf: queue TP work and disable delayed control frames
akol1 Oct 16, 2026
e2ebb0d
feat: add bounded opt-in tensor-rank decode graph replay
akol1 Oct 16, 2026
64bd35b
Load native ModelOpt MTP projections and exact draft vocabulary rows
akol1 Oct 16, 2026
1967f90
Mirror MTP verification windows and prefix commits across CUDA ranks
akol1 Oct 16, 2026
69e335e
Add opt-in affine proposal head with independent arithmetic checks
akol1 Oct 16, 2026
a7af69b
Allow bounded draft chains through the full verification window
akol1 Oct 16, 2026
c325d76
Expose bounded NVFP4 expert CTA geometry without changing tile arithm…
akol1 Oct 16, 2026
e71e400
Export fixed-history full score rows for independent model fidelity c…
akol1 Oct 16, 2026
961e1d3
Experiment with exact vocabulary-column projection across CUDA ranks
akol1 Oct 16, 2026
8f014e1
Add single-rank score export to isolate full-model fidelity
akol1 Oct 16, 2026
c611ade
Disable Nagle on accepted HTTP streaming connections
akol1 Oct 16, 2026
7b0cd5a
Disable Nagle on accepted HTTP streaming connections
akol1 Oct 16, 2026
94cefdd
Prefer shared plain rounds when admitting concurrent decode streams
akol1 Oct 16, 2026
4e31bd7
Merge remote-tracking branch 'origin/main' into codex/http-stream-nod…
akol1 Oct 16, 2026
91f9f4b
Merge upstream main and preserve distinct engine readiness and stale-…
akol1 Oct 16, 2026
d40bc9e
Merge upstream main and add MXFP8 numerical contract coverage
akol1 Oct 16, 2026
cb23d3d
Merge current main and retain FP32 projections across packed formats
akol1 Oct 16, 2026
ff97f72
Merge refreshed MXFP8 dependency and numerical contract harness
akol1 Oct 16, 2026
50c4f56
Exercise FP32 packed projections through numerical contract gates
akol1 Oct 16, 2026
37578da
Cover served dense and attention projection dimensions
akol1 Oct 16, 2026
8a41d66
Merge current main for host-validated CSF scale decoding
akol1 Oct 16, 2026
c224f30
Merge refreshed lossless CSF dependency and current main
akol1 Oct 16, 2026
a008b5c
test(cuda): register MXFP8 launch resource limits
akol1 Oct 16, 2026
b3d4713
Merge commit 'a008b5cd' into codex/cuda-f32-projections
akol1 Oct 16, 2026
5bb7392
test(cuda): register FP32 projection launch resources
akol1 Oct 16, 2026
3eecc6e
Merge lossless NVFP4 reader support for the native family backend
akol1 Oct 16, 2026
4f11337
Merge bounded serving health contracts for native rank owners
akol1 Oct 16, 2026
1695e16
Merge accepted-connection streaming latency control
akol1 Oct 16, 2026
cb2c749
cuda: refresh compiler-derived launch resource records
akol1 Oct 16, 2026
d9ce107
cuda: integrate native Flash Next family with current engine
akol1 Oct 16, 2026
fe461bb
test(cuda): expose writeback double rounding against FP64
akol1 Oct 16, 2026
8f7af95
fix(cuda): fuse Flash Next hidden-state writeback before BF16 rounding
akol1 Oct 16, 2026
2e59316
cuda: refresh compiler-derived launch resource records
akol1 Oct 16, 2026
b0753fa
style: format native family integration with pinned Zig
akol1 Oct 16, 2026
839a5a4
Merge compiler resource records into MXFP8 qualification
akol1 Oct 16, 2026
787064f
Merge qualified resource records through MXFP8 dependency
akol1 Oct 16, 2026
f141cd5
test(cuda): declare native Flash Next launch resource inventory
akol1 Oct 16, 2026
af32562
test(cuda): qualify hyper-connection writeback through numerical gates
akol1 Oct 16, 2026
79480c0
test(cuda): contract ordered slice sums and history copies
akol1 Oct 16, 2026
e4efbb2
test(cuda): check utility guards at every shape
akol1 Oct 16, 2026
0e78b5f
test(cuda): run native history and slice utility contracts
akol1 Oct 16, 2026
5049af9
test(cuda): independently contract sparse attention selection
akol1 Oct 16, 2026
63000ad
test(cuda): contract proposal maximum and log-sum-exp independently
akol1 Oct 16, 2026
d467307
test(cuda): run independent sparse selection contracts
akol1 Oct 16, 2026
8874feb
test(cuda): record compiled native family launch resources
akol1 Oct 16, 2026
4683601
fix(test): retain CUDA contract hooks for the runner lifetime
akol1 Oct 16, 2026
dd11a22
Merge remote-tracking branch 'origin/main' into codex/engine-unavaila…
akol1 Oct 16, 2026
fdbf481
Merge remote-tracking branch 'origin/main' into codex/http-stream-nod…
akol1 Oct 16, 2026
7b94b5e
test: bound accepted TCP stream checks
akol1 Oct 16, 2026
a56a005
flashnext cuda: refuse rank snapshot reuse without draft state
cwschroeder Oct 16, 2026
df44f51
Reject non-finite errors in CUDA reference comparisons
cwschroeder Oct 16, 2026
5a94b2f
Merge remote-tracking branch 'origin/main' into codex/mxfp8-checker-r…
akol1 Oct 16, 2026
6b78da2
Merge branch 'codex/mxfp8-checker-review' into codex/projection-fixtu…
akol1 Oct 16, 2026
37359a1
test: poison each FP32 projection dispatch and reduction scratch
cwschroeder Oct 16, 2026
4544c5c
test(cuda): reject no-op projection dispatches after stale prefixes
akol1 Oct 16, 2026
f859ed4
test(server): cover streamed admission and drained health regressions
cwschroeder Oct 16, 2026
e8f50da
fix(native): report drained Flash Next hosts unavailable
cwschroeder Oct 16, 2026
e832734
Merge projection checker and dispatch fixture review fixes
akol1 Oct 16, 2026
e649136
Merge commit '7b94b5e6d20a4a18b7d8d4707e6c640049044958' into codex/fl…
akol1 Oct 16, 2026
8f87428
fix(server): admit streams before opening and wire family readiness
akol1 Oct 16, 2026
f9a0585
Merge admission and readiness review fixes into native family
akol1 Oct 16, 2026
66c9e37
native: keep CUDA context configuration in a focused module
akol1 Oct 16, 2026
beec1aa
test(native): retain context-window coverage in the host root
akol1 Oct 16, 2026
ab7f7ba
test(cuda): clear experts-rows buffers on the kernels' stream
balancedscorpion Oct 17, 2026
b6fd0d9
docs: measure the ModelOpt FP4-Local checkpoint on one GB10
balancedscorpion Oct 17, 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
12 changes: 12 additions & 0 deletions zig/build/cuda.zig
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ pub fn hostTests(b: *std.Build, draft_ids: *std.Build.Module, build_options: *st
step.dependOn(&b.addRunArtifact(b.addTest(.{ .root_module = b.createModule(.{ .root_source_file = b.path("zig/build/check_fatbins.zig"), .target = host }) })).step);
const cuda = runtime(b, host, .debug, &.{});
const mods = family(b, host, .debug, cuda, draft_ids);
const reference_step = b.step("test-cuda-reference", "CUDA's FP64 comparison with CPU-only readback (no GPU)");
for ([_]std.builtin.OptimizeMode{ .debug, .fast }) |mode| {
const reference = b.addRunArtifact(b.addTest(.{ .root_module = b.createModule(.{
.root_source_file = b.path("zig/tests/cuda/quant_ref_host_tests.zig"),
.target = host,
.optimize = mode,
.link_libc = true,
.imports = &.{ .{ .name = "cuda", .module = cuda }, .{ .name = "core", .module = mods.core } },
}) }));
step.dependOn(&reference.step);
reference_step.dependOn(&reference.step);
}
const native_modules = engines(b, host, .debug, cuda, mods.core, mods.lanes, mods.nemotron, mods.heat);
const native = native_modules.engines;
// the HTTP server's unit tests (zig/src/server/root.zig), which the macOS build runs, on Linux hosts too
Expand Down
83 changes: 83 additions & 0 deletions zig/tests/cuda/quant_ref_host_tests.zig
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//! CPU tests of Rig.close: only stream synchronization and readback are replaced; the comparison is the GPU gate's.
const std = @import("std");
const cuda = @import("cuda");
const Rig = @import("quant_ref_tests.zig").RigT;

const Readback = struct {
var syncs: usize = 0;
var copies: usize = 0;

fn sync(_: cuda.abi.Stream) callconv(.c) cuda.abi.Result {
syncs += 1;
return cuda.abi.success;
}

fn copy(dst: ?*anyopaque, src: cuda.abi.DevicePtr, n: usize) callconv(.c) cuda.abi.Result {
const out: [*]u8 = @ptrCast(dst.?);
const in: [*]const u8 = @ptrFromInt(src);
@memcpy(out[0..n], in[0..n]);
copies += 1;
return cuda.abi.success;
}
};

fn close(comptime T: type, got: []const T, want: []const f64, tol: []const f64) !void {
var d: cuda.Driver = undefined;
d.api.cuStreamSynchronize = Readback.sync;
d.api.cuMemcpyDtoH_v2 = Readback.copy;
var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
defer arena.deinit();
var rig: Rig = .{
.gpu = .{ .d = &d, .ctx = undefined, .gpa = std.testing.allocator, .io = std.testing.io },
.a = arena.allocator(),
.s = .{ .d = &d, .handle = null },
.rng = undefined,
};
Readback.syncs = 0;
Readback.copies = 0;
const result = rig.close("CPU reference comparison", @intFromPtr(got.ptr), T == f32, want, tol);
try std.testing.expectEqual(@as(usize, 1), Readback.syncs);
try std.testing.expectEqual(@as(usize, 1), Readback.copies);
return result;
}

const zero = [_]f64{ 0, 0, 0 };
const tolerance = [_]f64{ 1, 1, 1 };

test "finite FP32 and BF16 outputs pass at the bound and fail beyond it" {
try close(f32, &.{ 0.5, 1, 0 }, &zero, &tolerance);
try close(u16, &.{ 0x3f00, 0x3f80, 0 }, &zero, &tolerance);
try std.testing.expectError(error.TestFailed, close(f32, &.{ 2, 0, 0 }, &zero, &tolerance));
try std.testing.expectError(error.TestFailed, close(u16, &.{ 0x4000, 0, 0 }, &zero, &tolerance));
}

test "FP32 NaN cannot disappear before a later finite result" {
for ([_]u32{ 0x7fc00000, 0xffffffff }) |bits| {
for (0..3) |i| {
var got = [_]f32{ 0, 0, 0 };
got[i] = @bitCast(bits);
try std.testing.expectError(error.TestFailed, close(f32, &got, &zero, &tolerance));
}
}
}

test "BF16 NaN cannot disappear before a later finite result" {
for ([_]u16{ 0x7fc0, 0xffff }) |bits| {
for (0..3) |i| {
var got = [_]u16{ 0, 0, 0 };
got[i] = bits;
try std.testing.expectError(error.TestFailed, close(u16, &got, &zero, &tolerance));
}
}
}

test "NaN cannot erase an earlier out-of-bound or infinite result" {
try std.testing.expectError(error.TestFailed, close(f32, &.{ 0, std.math.inf(f32), 0 }, &zero, &tolerance));
try std.testing.expectError(error.TestFailed, close(f32, &.{ 0, -std.math.inf(f32), 0 }, &zero, &tolerance));
try std.testing.expectError(error.TestFailed, close(u16, &.{ 0, 0x7f80, 0 }, &zero, &tolerance));
try std.testing.expectError(error.TestFailed, close(u16, &.{ 0, 0xff80, 0 }, &zero, &tolerance));
try std.testing.expectError(error.TestFailed, close(f32, &.{ 2, std.math.nan(f32), 0 }, &zero, &tolerance));
try std.testing.expectError(error.TestFailed, close(f32, &.{ std.math.inf(f32), std.math.nan(f32), 0 }, &zero, &tolerance));
try std.testing.expectError(error.TestFailed, close(u16, &.{ 0x4000, 0xffff, 0 }, &zero, &tolerance));
try std.testing.expectError(error.TestFailed, close(u16, &.{ 0x7f80, 0xffff, 0 }, &zero, &tolerance));
}
1 change: 1 addition & 0 deletions zig/tests/cuda/quant_ref_tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const Rig = struct {
for (want, tol, 0..) |w, t, i| {
const g: f64 = if (f32_out) std.mem.bytesToValue(f32, raw[4 * i ..][0..4]) else bf(std.mem.bytesToValue(u16, raw[2 * i ..][0..2]));
const q = @abs(g - w) / t;
try check.expect(std.math.isFinite(q), "{s}: non-finite error at element {d} (got {e}, reference {e}, tolerance {e})", .{ name, i, g, w, t });
if (!(q <= most)) {
most = q;
at = i;
Expand Down