Repository navigation
ricursive: serve Ripple-65B on two GB10s with up to 1M tokens of context - #2522
Open
ajensenwaud wants to merge 28 commits into
Open
ajensenwaud wants to merge 28 commits into
ajensenwaud wants to merge 28 commits into
Conversation
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 8, 2026
22 tasks
ajensenwaud
force-pushed
the
ricursive-tp2-cuda
branch
from
November 8, 2026 11:51
8e8cbd7 to
b133bc5
Compare
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 8, 2026
ajensenwaud
force-pushed
the
ricursive-tp2-cuda
branch
from
November 8, 2026 16:20
eff9be0 to
3b237f9
Compare
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 8, 2026
ajensenwaud
marked this pull request as ready for review
November 8, 2026 16:20
6 of 9 tasks
ajensenwaud
marked this pull request as draft
November 8, 2026 19:03
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 8, 2026
ajensenwaud
force-pushed
the
ricursive-tp2-cuda
branch
from
November 8, 2026 22:01
3b237f9 to
bfb6234
Compare
ajensenwaud
marked this pull request as ready for review
November 8, 2026 22:01
8 tasks done
ajensenwaud
force-pushed
the
ricursive-tp2-cuda
branch
from
November 8, 2026 23:26
bfb6234 to
ddf4bc4
Compare
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 8, 2026
Owner
|
@ajensenwaud thank you for this. It's a careful piece of work, and the admission tests and planted controls make it easy to read. Two things are on our side first: the ricursive family decision (#2171), and the notice's wording that these files follow the release "as ExLlamaV3's ricursive architecture runs it". Could you say exactly which parts (rounding points, fp16 activations, layer order) came from ExLlamaV3's ricursive code, rather than from
|
7 of 8 tasks
4 of 8 tasks
ajensenwaud
force-pushed
the
ricursive-tp2-cuda
branch
from
November 9, 2026 06:26
ddf4bc4 to
a27e54f
Compare
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
ajensenwaud
force-pushed
the
ricursive-tp2-cuda
branch
from
November 9, 2026 06:36
a27e54f to
833195c
Compare
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
ajensenwaud
force-pushed
the
ricursive-tp2-cuda
branch
from
November 9, 2026 07:55
833195c to
aee22a1
Compare
ajensenwaud
added a commit
to ajensenwaud/TensorFold
that referenced
this pull request
Nov 9, 2026
ajensenwaud
force-pushed
the
ricursive-tp2-cuda
branch
from
November 9, 2026 07:57
aee22a1 to
6c6a250
Compare
Contributor
Author
|
Thanks, Ash, and for the kind words. On the notice
On your five points
The branch is rebased on main |
4 tasks done
ashhart
force-pushed
the
ricursive-tp2-cuda
branch
from
November 26, 2026 16:06
326a68c to
9f72c42
Compare
… 1M context, native serving) A second CUDA path for the ricursive family, beside the one-GPU path: an ExLlamaV3 pack cut over two ranks, admitted only on sm_121 at exactly two ranks (every other SM or rank count is refused by name). Its files carry a tp2 prefix (families/ricursive/tp2*.zig, kernels/cuda/ricursive_tp2.cu, build/ricursive_tp2.zig, tests/ricursive_tp2_cuda.zig), so it shares no file with the one-GPU path. - Per rank: 40 query / 4 KV heads, FFN 20,480, vocab 50,176; every projection and the head on main's exl3.Dense, the embedding whole on each rank (it also seeds the value residual). - o_proj and down_proj write fp32 partials, gathered (NCCL, or RoCE writes for the small gathers) and added once in rank order (tf_rtp2_rank_sum) before the post-norm add; the head's vocab halves are gathered on rank 0. - Rank 0 drives: a plan word before each call (prompt chunk, decode rows, kept-state save/restore/drop/copy, taps), which rank 1 runs in follow(). Rank 1 is the same server at --rank 1, following until rank 0 stops. - Full (NoPE) layers to 1M context: decode rows on main's tree_attention, prompt chunks on main's window_attention prompt rows with query heads padded 10 -> 12 (tf_rtp2_heads); sliding layers on window_attention's decode rows. - Lanes: shared rounds over up to 16 streams, prompt-copy drafts, kept prompt states (snap_*), decode rows as CUDA graphs. - Native registry: a family may name the --tp it serves at (`ranks`); the registry opens it only there and otherwise lets another family of the same model_type open. The family's think rules use the `thinking` hook (reasoning optional, no budget). Thanks to @BobClawblaw for the host config this builds on (ashhart#2231), and to turboderp (exllamav3) and @auryn-macmillan for the EXL3 ricursive support the packs come from.
…ted controls, and its launch records ricursive_tp2.cu's eight kernels (embed, lerp, gate, swiglu, norm_add, rank_sum, heads, taps) become templates over a dropped step: the served instance (unchanged arithmetic) and a tf_rtp2_ctl_* control each, which the shapes gate must turn red (the product left unrounded, start-anchored lerp past one half, fp16 sigmoid, up clamped above only, bf16 a / rms, rank 1's partial in bf16, a neighbour's head, bf16 toward zero). `tf-cuda-test ricursive-tp2-contract` runs them: exact kernels by a host rule (embed, lerp, rank_sum, heads, taps), the rest against float64 at their rounding points (gate, swiglu, norm_add). Gate 5: one record a symbol at 256 threads, sm_121 only, from cuobjdump -res-usage on nvcc 13.0 (base, 13.2 pending) and 13.3.
…act.md, and its files in the notices
…of a width (the nvcc runner build failed on std.meta.Int)
…e input the clamps leave non-finite, so the nonfinite gate has a NaN to check
… never measured on CUDA Metal: Config.metal() refuses an EXL3 pack with UnsupportedRicursivePrecision, the by-name refusal nvfp4Mlp gave it before quant_method exl3 was read, instead of a missing tensor at load. CUDA (two ranks): only 5.0 and 6.0 bits with an 8-bit head, the packs measured against ExLlamaV3, are admitted; the config's bits are checked again on every trellis. Others: UnmeasuredRicursiveBitrate, explained by name.
…y; TF_RICURSIVE_COPIES dropped admit() refuses any world but 2, so the world == 1 paths in tp2_forward.zig and tp2_weights.zig, the optional rank group and Cut's one-rank default were unreachable. The unmeasured opt-in TF_RICURSIVE_COPIES goes (the lanes keep the default copy policy).
…precision points from ExLlamaV3's ricursive support
The norms' outputs, every EXL3 projection's input, the value residual and its seed, the gate and the MLP's intermediate move from fp16 to bf16. The residual stream, the rank sums and the logits stay fp32.
The notice no longer names ExLlamaV3's precision points, and the recipe states the bf16 activations and the pack comparison's metrics.
The config must name 5.0 bits with an 8-bit head, as in ashhart#2514. The loader no longer checks each tensor's bit width.
nvcc 13.0 and 13.3 give tf_rtp2_lerp 12 registers on sm_80 to sm_89. The other kernels' records are unchanged.
At an 8-bit weight the two lerp forms round to the same bf16, so the start-anchored control stayed green. A full fp32 weight tells them apart.
…ces at 600 lines
Follow main 4b997f8 (glm metal dflash2: account tap-stage bytes, fix host build core import, trim comments). Keep all current dispatches and refusals beside the incoming Ripple entries. Remove two interior blank lines to restore the 600-line source limit.
…tays at 600 lines
… (seven blank lines fewer) Main's cuda.zig (last 833c695, the MOSS-Image recognizer) is at 590 lines with the special families moved into open_family.zig; ashhart#2522's ranked registry loop, its ranks refusal and its test put it at 607. Seven blank lines between adjacent tests at the end of the file go; no code changes.
…does The blend is now the bf16 sigmoid of the stored lambda, shared with Metal's blendOf, and a lambda that is not a bf16 value is refused.
Model.load and Ripple.init now release what earlier steps made, and a failed open stops rank 1's follow loop.
The refusal tests called refusals.family directly, so they passed when openWith stopped calling it. This test goes through cuda.open for every registered family and fails with the call removed.
Each rank now sends its own slots and context, and both ranks run the same check on the pair, so a mismatch refuses on both. The two-rank tool gains a hello mode that covers mismatch, cleanup and reopen.
ashhart
force-pushed
the
ricursive-tp2-cuda
branch
from
November 27, 2026 00:09
9f72c42 to
9f984b4
Compare
This branch has not been deployed
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 this is
This PR serves Ripple-65B-Preview on two NVIDIA GB10s (DGX Spark, sm_121) at
--tp 2, from the 5.0 bpw ExLlamaV3 pack of the release. The full (global) layers run to a 1,048,576-token context, and the two ranks serve through main's lanes with kept prompt states.It is the two-GPU counterpart to #2302, which serves one GPU from the NVFP4 release. As agreed in review, it will fold into #2302's
ricursivefamily once #2302 lands, and drop its copy of #2231's commits then.exl3.Dense.o_projanddown_projsums and the logits stay in fp32.o_projanddown_projare gathered over NCCL, or over RoCE writes for the small gathers, and added once in rank order.ajensenwaud/Ripple-65B-Preview-exl3-5.0bpw, which averages 5.0 bits a weight with an 8-bit head. The loader identifies it by its config and refuses any other pack by name.modeling_ricursive.py, and the notice now credits the release alone./v1/modelsentry now hascapabilities.reasoning_optional. It istruefor Ripple, whose reply opens its own think block or answers bare, andfalsefor every other model.docs/api.mdlists it.Results on this head
ricursive-tp2-contract: 10 kernels pass gates 1-4, and all 8 planted controls fail as planted.--tp 2, drafted equals plain under greedy and seeded sampling, two concurrent streams equal their solo runs, and a resumed prompt equals a fresh one.Closeness, builds and commits
Closeness against ExLlamaV3 (5.0 pack, teacher-forced, TP=2). KL is KL(ExLlamaV3 || ours). The floor is ExLlamaV3 against itself with attention rounded to bf16, on the same rows as the path.
Agent top-1 misses. All five (2 prompt rows, 3 decode rows) are near-ties in ExLlamaV3's logits, and in each our pick is ExLlamaV3's second choice:
The median top-two gap on agent rows is 1.7 to 1.8 logits. Most of the agent decode KL is one row, 130, which is not a miss (both pick the same token): KL 0.338 there, where the bf16-attention floor itself is 0.164. Without row 130 the agent decode KL is 9.6e-4, below that path's floor of 1.7e-3.
Decode speed (
tools/bench_openai.py, one stream, tok/s, median of five).Prompt speed on fibonacci-raw, from the same runs: 120.5 and 121.5 tok/s on the fp16 build, 120.4 and 118.7 on this head.
Run. Two DGX Sparks (GB10, 128 GB unified memory), the nvcc 13.3 build image and Zig 0.17.0, on 18 Nov 2026. The fp16 build is
6c6a250af. The device runs used6c2fbf2b5, and the contract was run again on2574838e0, whose only change is the contract fixture. Since then, the rebases and Ash's commits moved tests, build helpers, the reasoning flags and a registry pin; no kernel or forward code changed.Main against branch (after the rebase, one GB10, 21 Nov). Spark-X2.6-4B 8-bit (main's
spark25family) served by mainf0b9cb855and by this head, same flags, eight runs: main, branch, main, branch, then branch, main, branch, main. Greedy 256-token replies (code, chat, agent with tools) have the same token hashes in all eight runs. Decode speed (tools/bench_openai.py, mean of the four runs each, tok/s):Each run is slightly slower than the one before, whichever build it is, so both orders are needed. Over the first four runs alone, the branch looked 0.6 to 0.9 % slower.
Host checks on this head.
zig build test-ricursive-tp2-host ricursive-tp2-cuda native compile-cuda-tests test-kernel-contract test-gradient-servingpasses all 66 steps and 286 tests on Linux x86, without a GPU. The lean checker finds 168 problems on mainf0b9cb855and on this head, the same findings (one at a shifted line).git diff --checkis clean.Launch records. nvcc 13.0 and 13.3 compile
ricursive_tp2.cufor sm_80, 86, 89, 120 and 121. Onlytf_rtp2_lerpchanged, from 14 to 12 registers on sm_80 to sm_89, and both record files say so.Reply check. Chat, a tool call and a tool round trip pass. The two cases where
max_tokenscuts a tool call need #2511, as before.Long context. The 1M-token runs were measured on the fp16 build: a needle at 1,018,419 tokens was answered, with 52.69 GiB a rank. The bf16 change leaves the cache sizes unchanged.
Known. On the default prompt path, the full layers' prompt rows are not bit-equal to their decode rows, because a different attention kernel sums in a different order. Resumed equals fresh because both cut at the same marks, and the backend reports
chunk_invariant = false.Stack. On main
f0b9cb855: #2231's five commits by @BobClawblaw, kept as authored, then this PR's commits.12fd25a12: the config reads an ExLlamaV3 pack asexl3.0b49bc343,ce8020710,357b70b9d: the two-rank family, its kernel contract, the recipe and the notice.c8a1ded84,7144b7103,65ab3ff7d,f67c41301: fixes for line limits, Zig 0.17, a contract fixture andreasoning_optional.012141473,3e17f54c5,6923bb1e5: the first review round.511b91e25,caa47bf23: bf16 activations, and the notice credits the release alone.10d7e4442: only the measured 5.0 bpw pack loads.78ed503ab,2357f2428: the lerp kernel's new records, and a lerp fixture whose control fails in bf16.f7a7bee9e,8ff2ed132,c3cf4891c,3262b0cc5,8ea8d62a9(Ash): sources kept at 600 lines, the reasoning flags throughfamilyInfo, and the kernel registry's pin.Changelog line (suggested). Ripple-65B-Preview runs on two GB10s at
--tp 2from the 5.0 bpw ExLlamaV3 pack, to a 1,048,576-token context; every/v1/modelsentry gainscapabilities.reasoning_optional(truefor Ripple,falseelsewhere) (#2522).Credits
@BobClawblaw for the host package this builds on (#2231). turboderp's ExLlamaV3 for the EXL3 format and the reference forward, and @auryn-macmillan for its ricursive support, which made the pack. ricursiveAI for the release.