feat(rust): Laguna-S-2.1 decode on the CUDA engine, 36.5 tok/s on GB10#69
Merged
TheTom merged 2 commits intoJul 23, 2026
Merged
Conversation
Carries the uncommitted engine state the GB10 box has been running: CUDA-graph capture trait plumbing (begin/end capture, graph_launch), fp8 projection microbench and MoE grouped-MMA test updates, and the device trait additions they depend on. Precedes the Laguna port commits that build on these interfaces.
Full single-stream decode for the 117.55B/8.14B-active hybrid MoE: sigmoid top-10 router with score-correction bias and shared expert, per-head softplus attention gate, per-head QK RMSNorm, period-4 full/sliding-window attention with a 512-slot ring KV cache, YaRN partial-rotary rope on full layers (scaling read from GGUF metadata, this export is a 256K/factor-32 checkpoint), Q8 LM head, and a Q4-requantized weight load straight from GGUF. New ops: rope_yarn_partial (+posbuf variant), gate_softplus_mul_perhead, argmax_f32_device, sdpa_decode_nbuf (n_kv from a device buffer), write_u32, moe_gather_q4 and moe_gather_q4_swiglu wrappers. Decode runs eagerly or as a captured CUDA graph (FFAI_LAGUNA_GRAPH=1, warmup-capture-replay via LagunaDecodeCtx with a persistent workspace), with optional fused MoE gate+up (FFAI_LAGUNA_FUSE=1) and micro-fusions (FFAI_LAGUNA_MICRO=1: concatenated QKVG projection, shared expert via the fused gather, o_proj residual accumulate). GB10 single-stream greedy: 21.2 tok/s reference baseline, 36.5 tok/s here (graph+fuse+micro), greedy tokens verified identical to the reference implementation. Env-gated integration smoke: FFAI_LAGUNA_GGUF plus laguna tests in ffai-cuda (unit kernels run without weights).
TheTom
marked this pull request as ready for review
July 23, 2026 12:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Full single-stream Laguna-S-2.1 (117.55B / 8.14B-active hybrid MoE) decode on the Rust CUDA engine, correctness-verified token-for-token against the reference C++ implementation and benched on the DGX Spark GB10.
Commit 1 lands the in-flight engine state the GB10 working tree has been running (CUDA-graph trait plumbing, fp8 microbench, MoE grouped-MMA test updates). Commit 2 is the Laguna port itself.
Numbers (GB10, single-stream greedy, 128-token bench, Q4)
Greedy continuations byte-identical to the reference in every mode. Roughly 62 percent of the theoretical bandwidth ceiling for 8.14B active params at Q4 on this memory system.
How
Tests
Notes for review