Repository navigation
ricursive: Ripple-65B-Preview on native CUDA (NVFP4) - #2302
Conversation
|
Thanks @jrb-ai, and for tracking the ATC failure to #2211's 21 linked issues. A draft claim is fine meanwhile. #2211 is near the front of our landing queue, and once it merges it's no longer an open pull request, so One thing to know before you build much: whether we take the |
7aefa9b to
79fb36a
Compare
|
Thanks @jrb-ai for waiting. #2171 now has a yes, so this lands third, after #2231 and #2260 and after our 1.2.6 release. We'll do the full review on the rebased head. What it needs:
We'll record the new launches with our own compiler when we run it on a GB10. We can't promise a date.
|
|
Thanks so much @ashhart, really appreciate you working through the ricursive decision, and the clear landing order and checklist. Great news for Ripple on CUDA! I'll wait for #2231 to land, then rebase #2302 and #2475 onto main and build on that, working through the list here (registry joins, |
|
Thanks @jrb-ai, and waiting for #2231 is right; it hasn't landed yet. Since it has been rebased twice since your base, here's what we saw laying your 8 commits over its current head, so the rebase has fewer surprises:
That's on top of the four from last time: registry joins;
|
844c0d9 to
19fb5f6
Compare
|
Thanks @ashhart. #2302 is now rebased onto main (head
Authored by JRB AI in a private capacity. This contribution does not represent the views or positions of any organisation. |
The CUDA family from ashhart#2302 (jrb-ai) on the host config from ashhart#2231 (BobClawblaw) loads an ExLlamaV3 pack of the bf16 release besides the NVFP4 one: config.zig reads quant_method exl3, cuda_exl3.zig maps the pack's trellises (mul1, suh, svh) and refuses a leftover tensor, and every projection and the head become a Proj, either the lane weight as before or an exl3.Weight. Model.linear runs the latter on exl3.Dense (128-row blocks for prompt chunks and decode rows alike), with its scratch grown at init so captured rounds allocate nothing. q, k and g stay three EXL3 projections, written as planar blocks that prep and the gate read at their own strides. Metal refuses a pack.
… kernel contract The rc kernels follow glue.metal step for step at its bf16 rounding points: embed, add-norms, output gate, FFN activation, and q/k head norms with RoPE into rings or pages, one stream's rows or each row at its own position and stream. window_attention.cu gains the group-10 prompt instances; global decode runs through tree_attention. ricursive-contract checks them through gates 1-4 with planted controls; nvcc 13.3 records for the eight launches.
…CUDA graphs The NVFP4 release's weights and gate; Metal forward.zig's layer order on the rc kernels. Prompt chunks of one slot, and rounds of rows each at its own position and slot (several streams, verify windows), replayed from a graph of the round's row count. ripple-forward checks rounds against one-row steps, bit for bit.
…and kept states Several streams behind lanes.Backend, a slot of the arena each: shared rounds, copied drafts verified as chains, draws and logprobs by the shared cuda.sample, and the prompt cache's states. ripple-serve checks it on synthetic weights.
… gate tools run and kl drive the CUDA forward directly on one stream; decode rounds replay graphs unless --eager. compile-cuda-cli builds the CLI without a GPU. The gate tools compare kl dumps with ricursive_reference.py's logits (KL, top-1, worst rows, identical dumps, a greedy reply) and turn a chat into the kl command's ids.
… near-tie leads in the gate compare
… files in the notices
…uh, so contract_controls.cu stays at 600 lines contract_controls_set.cu includes it after contract_dense_controls.cuh; the image is still contract_controls.
…_commands.zig, so main.zig stays at 600 lines ricursive-contract, ripple-forward and ripple-serve keep their names and usage lines.
…lopment milestone's name
…he root pytest job does not install
d31136d to
2efc8c8
Compare
|
Thank you @jrb-ai. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes. |
The CUDA family from ashhart#2302 (jrb-ai) on the host config from ashhart#2231 (BobClawblaw) loads an ExLlamaV3 pack of the bf16 release besides the NVFP4 one: config.zig reads quant_method exl3, cuda_exl3.zig maps the pack's trellises (mul1, suh, svh) and refuses a leftover tensor, and every projection and the head become a Proj, either the lane weight as before or an exl3.Weight. Model.linear runs the latter on exl3.Dense (128-row blocks for prompt chunks and decode rows alike), with its scratch grown at init so captured rounds allocate nothing. q, k and g stay three EXL3 projections, written as planar blocks that prep and the gate read at their own strides. Metal refuses a pack.
The CUDA family from ashhart#2302 (jrb-ai) on the host config from ashhart#2231 (BobClawblaw) loads an ExLlamaV3 pack of the bf16 release besides the NVFP4 one: config.zig reads quant_method exl3, cuda_exl3.zig maps the pack's trellises (mul1, suh, svh) and refuses a leftover tensor, and every projection and the head become a Proj, either the lane weight as before or an exl3.Weight. Model.linear runs the latter on exl3.Dense (128-row blocks for prompt chunks and decode rows alike), with its scratch grown at init so captured rounds allocate nothing. q, k and g stay three EXL3 projections, written as planar blocks that prep and the gate read at their own strides. Metal refuses a pack.
The CUDA family from ashhart#2302 (jrb-ai) on the host config from ashhart#2231 (BobClawblaw) loads an ExLlamaV3 pack of the bf16 release besides the NVFP4 one: config.zig reads quant_method exl3, cuda_exl3.zig maps the pack's trellises (mul1, suh, svh) and refuses a leftover tensor, and every projection and the head become a Proj, either the lane weight as before or an exl3.Weight. Model.linear runs the latter on exl3.Dense (128-row blocks for prompt chunks and decode rows alike), with its scratch grown at init so captured rounds allocate nothing. q, k and g stay three EXL3 projections, written as planar blocks that prep and the gate read at their own strides. Metal refuses a pack.
What this changes
Before, Ripple-65B-Preview (
ricursive, #2171, #2231) ran on Metal only. After, the native CUDA engine serves thepublisher's NVFP4 release as published, with the same bf16 layer math as Metal: prompt chunks and decode, lane rounds as
CUDA graphs, greedy and sampled draws, kept states and the prompt cache. No drafter here; that is the next PR.
d21617008), so this PR now sits directly on main (bdcb6e608). It adds 15commits (
f1c573a57tod31136df0): the 8 of before, rebased; 4 for the review of 11 Nov (8b3b27bd7thecontrols' own header,
94ec3fb56one test entry,f9bde058ethe records' TODO lines,149dc702athe recipe'snear-cap run);
d81feccff, seven comments reworded;19fb5f61e, the serving pin ofzig/src/cuda/kernels.zig, whichtest-gradient-servingneeds once the two Ripple images are registered; andd31136df0, so the root pytest job, which installs no numpy, skips the gate test's KL tests.atc overlap --json: not rerun on this head. This head merges with mainfe6d47a18without a conflict(
git merge-tree). The rebase kept both sides in every shared list: the family list, the kernel images, therecord joins and the control headers.
Checks on this head
d31136df0, on mainbdcb6e608. The GB10 lines below were measured on 22 and 23 Nov on the first 14commits over main
34af03a12; the 15th changes a Python test only. The rebases since changed the merge context oftwo of them only: the changelog entry's place (main released 1.3.4; the entry now sits in the middle of Unreleased)
and the list of control headers.
tools/zig/lean_new.py).zig build test test-kernel-contract test-golden fuzz-cortheon test-ricursive-cuda-host -Dcpu=apple_m1from an empty cache: 1,024 of 1,029 steps;17,906 of 18,055 tests passed, 146 skipped, 3 failed. Main fails the same three tests and the same link check:
persistence identity: tokenizer and template edits reuse only identical canonical token prefixes(main at833d8ec46:zig build test-persistence-identity-host, 24 of 25),deepseek_v41'svision.test.the release's vision_config parses to the defaultsin two test binaries, andtensorfold-native links its own memcpy(bothseen on main at
d21617008).zig build test-ricursive-cuda-host test-gradient-serving check-native-cuda-host:18 of 18 steps (
test-ricursive-cuda-host: 41 of 41). Linux type-check,zig build compile-cuda-tests compile-cuda-cli native -Dtarget=aarch64-linux-gnu: 20 of 20 steps.zig fmt --check build.zig zigandgit diff --check: clean.tf-cuda-test:ricursive-contract77 checks passed and its 24 planted controls failed as planted(
SUMMARY ricursive: 20 kernels, 20 pass gates 1-4, 0 fail; 24 controls: 24 red as planted, 0 missed);ripple-forward35 passed, 0 failed;ripple-serve9 passed, 0 failed.zig build kernel-contract -Dsm=121for every family, this PR and main34af03a12on the same evening.This PR:
SUMMARY 805 kernels: 803 pass gates 1-4, 2 fail, 11 known findings; 495 controls: 495 red as planted, 0 missed; 354 limit problems, exit 1. Main: the same line with 314 limit problems, exit 1. Every gate, control andfailure line is the same on both, the two gate failures included (
tf_me_conv, sums;tf_idol_dec_attention, rows<64, 8>, P to fp16, shapes, 1.07 of its bound). The 40 more are this PR's 8 launches on 5 SMs, pending asthe repo keeps other unmeasured launches (
cuda_pending), with their nvcc 13.3 receipts inmeasurements/pending_133.zig(below). Their live limits pass on GB10 with the recorded values.klpath: Nemotron-3.5-Super-VL-120B NVFP4kllogit dumps (64 rows after a 512-tokenprompt) from main
34af03a12's binary and from this PR's are byte-identical (SHA-256258ab849...for both, thehash of the 7 Nov run).
spark25, asked on 10 Nov): Spark-X2.6-4B at the CUDArecipe's revision (
66e3ae7b), converted withtools/zig/spark25_convert.py --bits 8, served with--context 32768 --parallel 4(server defaults otherwise, copy drafts on) from main34af03a12's binary and from thisPR's. Four greedy replies, thinking off, capped at 1,024 tokens (743, 906, 1,024 and 1,024 tokens, so each runs
past the 512-key window), each alone and all four at once: all 8 token hashes are equal between the two binaries.
--context 262144admits 2 streamsof 16.75 GiB and a 5.3 GiB prompt cache. A 258,331-token prompt with a random four-word passphrase a third of
the way in: the reply names it, first token after 919.1 s (281 tok/s). The prompt cache keeps no state of that
prompt (16.0 GiB, over the 5.3 GiB budget).
19fb5f61eevery check passed exceptpytest, which could not import numpy intools/zig/ricursive_gate_test.py;d31136df0fixes that. Root pytest as CI runs it (Python 3.14, pytest andPyYAML only): that file 2 passed, 10 skipped; with numpy, 11 passed, 1 skipped (jinja2). CI runs again on this head.
tool_choice"required"or named) on CUDA. Theserver refuses them cleanly, because this family has no masked sampling yet; a later PR adds it.
"auto"toolcalls work. The recipe says so.
launch records fit each).
The review of 10 and 11 Nov
From 10 Nov:
zig/src/native/cuda_families.zig, and the record joins are inzig/src/core/contract/registry_joins.zig.spark25): equal to main's, 8 of 8 (above). Nemotronkl: rerun onthe rebased commits, byte-identical (above).
modeling_ricursive.py, and it names the CUDA kernel files and--release-f64.From 11 Nov:
lfm2_moeinzig/src/native/cuda_families.zig.familyInfo(now inzig/src/native/cuda_family_info.zig) appliesF.thinking, and its test checksRipple's rules (think block optional, no budget).
zig/src/native/cuda.zigis main's file, unchanged by this PR.zig/kernels/cuda/contract_ricursive_controls.cuh, included fromcontract_controls_set.cu.contract_controls.cuis main's file, unchanged; the image name is the same.zig/tests/cuda/main.zigis 403 lines. Ripple's three commands go through one entry,ripple_commands.zig, andtheir usage lines are in
main_usage.zig.TODO(spark)comments are gone.--context 262144(above).Receipt
6bc8c6d22, TensorFold 1.2.3),except where a line names a later date. Against that head, the family's CUDA kernels and
window_attention.cuare byte-identical in this one, and the family's Zig files differ in comments only.
ricursiveAI/Ripple-65B-Preview-NVFP4at99eea4477a001a41b86914e41feb4b2ed86105e5.ricursivefamily (new);window_attention.cu(new templateinstantiations for group 10, no existing one changed); the
klcommand's CUDA path (its dump-and-compare loop nowreads rows through an engine-neutral source, which Nemotron's
klalso goes through;--gold-fileand--chunkadded for Ripple); the CUDA host's
familyInfo(one line: a family's own think-block rules). Metal and the other CUDAfamilies are not reached. Ran: GB10 only.
tools/bench_concurrent.py --levels 1,8 --tokens 128 --alone --serial, 0 unequalin 16 comparisons (code and chat prompts, greedy and sampled, each 8-stream reply against itself alone and served
one at a time). Prompt-cache hit against miss: the feature run's multi-turn check sends each of 8 conversations
twice; the repeat reuses 79 to 81 cached tokens (the first, 3) and its reply equals the first bit for bit.
bench_cache --require-coldreplies at 2,048 and 8,192 tokens equal across repeats and two concurrent requests; 60soak replies equal their first. Prompt chunks of 2,048, 1,000 and 333 rows bit-identical; graphs against
--eagerbit-identical.
ricursive_reference.py --release-f64runs the release's own layers in float64 with the NVFP4 MLPs at their exact dequantized values.On a 2,586-token prompt: prompt chunks of 2,048 rows, top-1 98.72% (33 misses), mean KL 0.00069; one-row decode
steps, top-1 98.92% (28 misses), mean KL 0.00076. Every miss is a near-tie: the reference leads the engine's pick by
at most 0.25 nats (decode 0.125), and by under 0.1 in 22 of 33 (decode 20 of 28). A greedy reply of 128 tokens
equals the reference's argmax at every token. The script's own float64 mode equals the release's code (top-1 100%,
max KL 0.0005), so the earlier gates against it hold against the release.
kllogit dumps (64 rows after a 512-tokenprompt), main's binary against this branch's: byte-identical (rerun on 23 Nov, above).
window_attention:tools/zig/cuda_sass_compare.py --images window_attention, main against main with this branch'swindow_attention.cu(the tool refuses trees whoseimage catalogs differ, and this branch adds the two Ripple images; no file that kernel includes changes here): 45
functions over 5 SMs, 35 equal in SASS and encoding (all 7 of main's on every SM) and 10 added
(
tf_window_prompt_h2_pgandwattn_kernel<128, 8, 2, 8>on every SM). The tool exits 1 because the image gainsfunctions. The other shared paths in your list, paged attention, the Q/K norms and the ModelOpt NVFP4 path, are
reused with no change to their source. The CUDA host's one new line is a comptime
@hasDecl(F, "thinking")check,so a family without
thinkingcompiles as before.tools/bench_openai.py, 256 tokens, 3 reps, chat and raw prompts,greedy and sampled); 8 streams 29.3 to 30.9 tok/s together (
bench_concurrent.py, 128 tokens). New family, so no"before".
tools/bench_cache.py --require-cold, the server at--context 131072): coldttft_s3.76 at 2,048tokens, 15.63 at 8,192, 68.4 at 32,768 and 150.7 at 65,536 (545 down to 435 tok/s); each reply equal across a repeat
and two at once. A 114,528-token prompt with a random four-word passphrase a third of the way in: the reply names
it, first token after 300.5 s (381 tok/s).
the family follows.
Kernel contract
SUMMARYline and exit status: CUDA (GB10), exit 0:SUMMARY ricursive: 20 kernels, 20 pass gates 1-4, 0 fail; 24 controls: 24 red as planted, 0 missed. Metal: notreached.
zig build fatbins kernel-contract-fatbins -Dsm=80,86,89,120,121,then
tf-cuda-test kernel-contract-limits(7 Nov, not rerun on this head): every launch fits on all five. The 8 launch records this PR adds (the 6ricursiveandricursive_preplaunches, and window attention'stf_window_prompt_h2_pgandwattn_kernel<128, 8, 2, 8>) are current on all five against their nvcc 13.3 receipts inmeasurements/pending_133.zig; their entries inthe pending list (
cuda_pending, joined inregistry_joins.zig) stay at zero until records from your compilerland, so the every-family check counts them as 40 limit problems (above). The tool's two planted controls are red on all five. The command exits 1 on 677
stale records: 673 in images this PR leaves unchanged (338
exl3_linear, 60qwen4_hc, 50qwen4_ple, 45flashnext_batchand others), and window attention'stf_window_prompt_h4_pgandh8_pgat sm_120 and sm_121 (231registers; main's record says 229), whose SASS this PR leaves unchanged (ask 3).
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.Authored by JRB AI in a private capacity. This contribution does not represent the views or positions of any organisation.