Skip to content

ricursive: serve Ripple-65B on two GB10s with up to 1M tokens of context - #2522

Closed
ajensenwaud wants to merge 41 commits into
ashhart:mainfrom
ajensenwaud:ricursive-tp2-cuda
Closed

ajensenwaud wants to merge 41 commits into
ashhart:mainfrom
ajensenwaud:ricursive-tp2-cuda

Conversation

@ajensenwaud

@ajensenwaud ajensenwaud commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

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 ricursive family once #2302 lands, and drop its copy of #2231's commits then.

  • Model. Each rank holds half of every projection and of the head, and the whole bf16 embedding. Every projection and the head run on main's exl3.Dense.
  • Precision. Activations stay in the release's bf16: the norms' outputs, every projection's input, the value residual and its seed, the gate and the MLP's intermediate. The residual stream, the two ranks' o_proj and down_proj sums and the logits stay in fp32.
  • Ranks. Rank 0 drives, and before each call it sends rank 1 a plan word that rank 1 follows. The partial sums of o_proj and down_proj are gathered over NCCL, or over RoCE writes for the small gathers, and added once in rank order.
  • Pack. Only the measured pack loads: 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.
  • Limits. A GPU other than sm_121, a single rank or a third rank is refused by name. Metal refuses an EXL3 pack by name.
  • Notice. The layer order and the arithmetic come from the release's modeling_ricursive.py, and the notice now credits the release alone.
  • New capability key. Every /v1/models entry now has capabilities.reasoning_optional. It is true for Ripple, whose reply opens its own think block or answers bare, and false for every other model. docs/api.md lists it.

Results on this head

  • Closeness. Against ExLlamaV3's forward on the same pack, true-token NLL is within 0.13 % on every text, and greedy decoding matches for 32 of 32 tokens on every text. ExLlamaV3 runs in fp16, so the fp16 build sat closer to it; the table compares the two builds. Every top-1 miss is a near-tie in ExLlamaV3's own logits (below the table).
  • Kernel contract. ricursive-tp2-contract: 10 kernels pass gates 1-4, and all 8 planted controls fail as planted.
  • Exactness. Eager NCCL and CUDA graphs with RoCE give byte-identical logits and greedy ids. Served at --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.
  • Speed. One stream decodes at 9.7 to 9.8 tok/s, the same as the fp16 build within 2.2 %, in no consistent direction. Prompt speed on the benchmark's short prompt is also unchanged; a long cold prompt was not measured again.
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.

Text Path KL, fp16 build KL, this head bf16 floor Top-1, fp16 / this head NLL ExLlamaV3 → fp16 / this head
agent prompt 2.3e-4 6.1e-4 8.5e-4 1.000 / 0.991 3.2804 → 3.2794 / 3.2845
agent decode 1.3e-3 4.1e-3 1.7e-3 1.000 / 0.972
code prompt 4.1e-6 1.2e-5 5.2e-6 1.000 / 1.000 0.4810 → 0.4809 / 0.4813
code decode 2.4e-6 8.8e-6 4.3e-6 1.000 / 1.000
prose prompt 1.1e-5 2.0e-4 1.5e-5 1.000 / 1.000 1.9699 → 1.9699 / 1.9703
prose decode 1.1e-5 3.1e-5 1.1e-5 1.000 / 1.000

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:

Row ExLlamaV3's lead (logits) ExLlamaV3's top two Our lead the other way
133 (decode) 0.191 53.7 % / 44.3 % 0.170
194 (prompt, decode) 0.066 51.0 % / 47.8 % 0.019, 0.035
209 (prompt, decode) 0.015 21.0 % / 20.7 % 0.053, 0.167

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 Temperature fp16 build This head
fibonacci-raw 0 9.73 9.79
gpu-chat-no-think 0 9.66 9.83
fibonacci-raw 1.0 9.92 9.70
gpu-chat-no-think 1.0 9.87 9.74

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 used 6c2fbf2b5, and the contract was run again on 2574838e0, 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 spark25 family) served by main f0b9cb855 and 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):

Prompt Temperature Main This head
fibonacci-raw 0 52.17 52.22
gpu-chat-no-think 0 49.43 49.47
fibonacci-raw 1.0 49.89 50.02
gpu-chat-no-think 1.0 49.69 49.75

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-serving passes all 66 steps and 286 tests on Linux x86, without a GPU. The lean checker finds 168 problems on main f0b9cb855 and on this head, the same findings (one at a shifted line). git diff --check is clean.

Launch records. nvcc 13.0 and 13.3 compile ricursive_tp2.cu for sm_80, 86, 89, 120 and 121. Only tf_rtp2_lerp changed, 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_tokens cuts 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 as exl3.
  • 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 and reasoning_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 through familyInfo, and the kernel registry's pin.

Changelog line (suggested). Ripple-65B-Preview runs on two GB10s at --tp 2 from the 5.0 bpw ExLlamaV3 pack, to a 1,048,576-token context; every /v1/models entry gains capabilities.reasoning_optional (true for Ripple, false elsewhere) (#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.

ajensenwaud added a commit to ajensenwaud/TensorFold that referenced this pull request Nov 8, 2026
ajensenwaud added a commit to ajensenwaud/TensorFold that referenced this pull request Nov 8, 2026
ajensenwaud added a commit to ajensenwaud/TensorFold that referenced this pull request Nov 8, 2026
@ajensenwaud
ajensenwaud marked this pull request as ready for review November 8, 2026 16:20
@ajensenwaud
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
ajensenwaud marked this pull request as ready for review November 8, 2026 22:01
ajensenwaud added a commit to ajensenwaud/TensorFold that referenced this pull request Nov 8, 2026
@ashhart

ashhart commented Nov 9, 2026

Copy link
Copy Markdown
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 modeling_ricursive.py and the EXL3 format? Meanwhile:

  1. With exl3 = true, an EXL3 pack on the Metal path no longer gets nvfp4Mlp's by-name refusal and fails later on a missing tensor (config.zig:268, Metal weights.zig:80). Please refuse it by name there, with a test.
  2. admit refuses world ≠ 2, so the world == 1 branches in tp2_forward.zig and tp2_weights.zig:97 can't be reached; please remove them, or tell us what reaches them.
  3. TF_RICURSIVE_COPIES: please route it through platform/environment.zig with a docs/environment.md row, or drop it.
  4. Bitrates other than 5.0 and 6.0 are admitted through the variant table; please refuse unmeasured ones by name, or tell us why the EXL3 contract covers them.
  5. For the shared native/cuda.zig edits, could you post main-against-branch numbers (token sha and decode tok/s) for one existing CUDA family?

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 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

Copy link
Copy Markdown
Contributor Author

Thanks, Ash, and for the kind words.

On the notice

  • The layer order and the arithmetic come from modeling_ricursive.py.
  • What came from @auryn-macmillan's ExLlamaV3 branch (feat/ricursive at d71a6644) is narrower: the precision at each step. I matched it so that our logits could be checked against the forward pass that produced and measured the packs.
  • Concretely, the value-residual seed is held in fp16 and blended in fp16 with an fp32 weight; every EXL3 projection takes fp16 input; the MLP's intermediate is fp16; o_proj and down_proj write fp32; and the final norm hands the head fp16.
  • No ExLlamaV3 code is copied, and THIRD_PARTY_NOTICES now says exactly that.

On your five points

  1. Metal now refuses an EXL3 pack by name before any tensor is loaded, with the same error and message it gives other quantisations (Config.metal()). The config test covers it.
  2. You were right that nothing could reach them. The world == 1 paths in tp2_forward.zig and tp2_weights.zig are gone, along with the optional rank group and Cut's one-rank default. The TP=2 suites remain byte-identical to the recorded outputs: nine of nine files eager over NCCL, and nine of nine with CUDA graphs and RoCE.
  3. TF_RICURSIVE_COPIES is dropped; it was never measured on Ripple.
  4. Only the two measured bitrates, 5.0 and 6.0 with an 8-bit head, are admitted. Anything else fails with UnmeasuredRicursiveBitrate, checked once in the config and again for each trellis as it loads. The test tries 4.0, 5.5, a 6-bit head and a missing head_bits.
  5. To isolate the shared native/cuda.zig changes, I served Spark-X2.6-4B (spark25, 8-bit, one GB10) from main and from this branch with identical flags, alternating main, branch, main, branch.
    • Greedy output was identical in all four runs, across code, chat and a tool-calling agent prompt.
    • Decode speed was indistinguishable. On bench_openai's fibonacci-raw, the medians were 48.26 and 47.85 tok/s on main against 48.06 and 47.86 on the branch; on gpu-chat-no-think, 47.99 and 47.60 against 47.78 and 47.56.
    • The branch's 0.2-0.3% deficit is smaller than the 0.8% by which main varied between its own two runs.

The branch is rebased on main f212eeabd, and the GPU receipts are in the description.

ashhart and others added 24 commits December 5, 2026 02:38
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.
… (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.
Each rank's liveness line starts before any stage one rank can fail
alone. A failure in a call both ranks run, or in the follower, now
reaches the other rank, and a requested stop is no failure.
Export the two-rank family from the existing CUDA family module so its config has one owner per compilation. Keep both runtime variants and their rank-selected context defaults, while publishing one Ripple metadata entry with NVFP4 and EXL3 formats.

Add a native metadata regression and refresh the serving registry pin for the combined main and PR source, retaining both notes.
A longer prompt than any before grew the shared EXL3 scratch after decode graphs had captured its old address, and the next graphed row wrote into freed memory.
…admits ranks without a device SM

Site comments state why drop needs no slot and why copy's a is a source slot.
@ashhart

ashhart commented Dec 5, 2026

Copy link
Copy Markdown
Owner

READY to land on this head. We rewrote the branch as a straight line on today's main (authors kept) so the landing train can replay it; the final tree is byte-identical to the head we tested and signed off, so no code changed. Its focused host tests, including the two-rank Ripple tests, passed on that tree.

  • Synthena

@ashhart

ashhart commented Dec 5, 2026

Copy link
Copy Markdown
Owner

READY to land on this head. The fast gate refused zig/src/native/cuda.zig at 601 lines; our commit 3bb99f9 removes one blank line (600 lines, no code change), the same trim #2523 carries. The earlier GB10 pair A/B on this code stands.

  • Synthena

@ashhart

ashhart commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Thanks @ajensenwaud. Every commit on this branch is now on main: #2523 was stacked on it and landed with all 41 of them, including the 600-line fix (main 86ccfdc). Ripple-65B on two GB10s with up to 1M tokens of context ships in the next release with your name on it.

Closing this one as landed through #2523, since there is nothing left to merge here.

  • Synthena

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:feature Classified by Synthena as feature addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants