Repository navigation
Conversation
|
Thanks, @jrb-ai, for the drafter, and for keeping it in the family's folder. Drafted against plain at 1, 2 and 8 streams, greedy and sampled, with plain's logits unchanged from #2302, is what we'd want. It can only land after its stack (#2231, then #2302 and #2260), so here's what to do when you rebase:
Moving the config parse into |
|
Thanks @jrb-ai for the resumed cell with the drafter, which is what we hoped to see. #2171 now has a yes, so this lands last of the four, after #2302 and after our 1.2.6 release. What's left:
Then we run it on a GB10. We can't promise a date.
|
|
Thanks @jrb-ai, and thanks for saying on #2302 that you'll rebase it and this one once #2231 lands. That's still the right plan, so we haven't pushed anything to your branch: every item left on this PR sits on that rebase. Where the stack stands: #2231 is ready on our side and waits on our own Mac run; #2260, #2302 and then this PR follow it in that order. So the list is the one from 10 Nov, with one pointer for the rebase:
After the rebase we'll recheck
|
|
Thanks @ashhart. The plan stands: I rebase #2302 and this PR once #2231 lands. The answer to item 2 is ready now, so here it is ahead of the rebase. Item 2, the structured-output offer. The head reads
Measured on GB10, on my local restack: #2231's head (
The base there is #2231's head, not main. I run the same compare against main after the rebase and post it with the push. Items 1 and 3 are ready on the local restack and come with the rebase: the drafter's |
|
Thanks @jrb-ai for answering item 2 ahead of the rebase, and for confirming the plan. Your reading matches main at
So the one offer that changes is Ripple's own with Your 8 of 8 token hashes and the equal structured-output reply are against #2231's head. As you say, the compare against main comes with the rebase, and that is the one we'll check. With items 1 and 3 ready on your restack, nothing more is needed until #2231 lands. After the rebase we'll recheck
|
f243fcb to
3fd4942
Compare
|
One detail worth preserving in the agreed rebase. The current I checked the actual The #2475 trial passed all 64 checks below on M5 Max. The newer zig build test-ricursive-cuda-host test-gradient-serving check-native-cuda-host \
-Dcpu=apple_m1 --summary allIgor Lessio - AIFLOW LABS |
3fd4942 to
f12afe3
Compare
calibrate() copied the measured window and lane costs into the facts but not the shared-round costs, so rows past the widest window were priced as one stream's widest window scaled by rows. At 8 Ripple streams that made every round past 16 rows look 1.5x dearer than measured, and the allocator held one draft a stream. Drafters that time no shared rounds are unchanged.
…CUDA The drafted wrapper forwards first_row to its target only with first_rows set, so a Ripple server with --drafter lost the first token's logprob row that it serves without one. Metal's entry sets first_rows on its wrapper. On CUDA the wrapper comes from the shared cuda_drafted.wrap, so a family asks for it through an optional Opened.first_rows, and Ripple's openDrafter does; families whose Opened has no such field (Qwen3.5, Gemma 4) keep main's wrapper table. test-cuda-host: through wrap with the fake target, a family that asks serves first_row with drafting on and off, and one that does not keeps main's table when drafting. Without the wrap line, the drafted case serves none.
…tokens too run_kl read the reference's fed tokens (ref_fed) and never checked them, so a kl dump of the reference that fed other tokens than the chat's ids compared silently. After truncating to the ids' rows, the reference's fed tokens are now checked as the engine's are: each row's fed token must be the chat's next id. Byte-compiled here; the PR's Python tools were not run.
…ks too Check 3 (GB10): each stream's reply stays in a test grammar with no end, odd tokens at even steps and even tokens at odd steps, so each row of a window has its own mask and a mask at the wrong row gives a token the grammar rejects. Plain Ripple's replies stay in the grammar and differ from those with no grammar; with the DFlash2 drafter, replies equal plain's under the same grammar at 1, 2 and 8 streams, greedy and sampled. Needs the masked draws of ashhart#5252.
…alls are served as without it The drafter's changelog line said they are refused up front; the masked draws under it serve them. The recipe gains the GB10 result: a --drafter server's structured and tool replies equal the plain server's, and structured requests alone, 2 at once and 8 at once equal it with drafts accepted at each level.
8fd1b9f to
ee6d581
Compare
|
Rebased on main |
|
Thanks for the rebase and for keeping the authorship through it. Decision: the review's open item was the rebase against main's newer pricing, then the GB10 run - both ours. The run checks What stands: the drafter is the publisher's own DFlash2 as published, the target verifies every draft, the shared-round prices are measured at load, and structured output and forced tool calls are served with the drafter as without it. The GB10 receipts stand: logits bit-identical on 2,586 rows, 32/32 token IDs, 1,696/5,943 drafts accepted, and the kernel contracts with their controls red. Main's CUDA
|
Synthena Initial Review — Performance receipt required (
|
What this changes
Before, the CUDA
ricursivefamily (#2302) served Ripple-65B-Preview without a drafter. After,--drafterserves thepublisher's DFlash2 drafter (
ricursiveAI/Ripple-65B-Preview-DFlash2) as published, read in place, and the targetverifies every draft, so a drafted reply equals the plain one bit for bit. The code is the family's own, as #2260 is on
Metal; no shared Qwen DFlash2 path changes.
With several streams, the drafter also times shared rounds of every admitted stream at load, and the depth rule prices
a shared round past the one-stream sweep's 16 rows by those times. Without them, the rule extended the one-stream sweep
in proportion and priced a 64-row round at about 1,010 ms against 292 ms measured, so at eight streams each stream
drafted about 1 token a round. The lanes take the times through one new drafter fact,
shared_costs, empty unless adrafter gives it; only this family's drafter does.
With #5363 under it, structured output and forced tool calls are served with the drafter as without it: the drafted
wrapper forwards the grammar's masks to the family's masked draws, and a drafted reply under a grammar equals the
plain one.
this PR lands ricursive cuda: structured output and forced tool calls for Ripple-65B-Preview #5363's change too. ricursive: Ripple-65B-Preview on native Metal (NVFP4 and bf16 releases) #2231, ricursive: the publisher's DFlash2 drafter for Ripple-65B (stacked on #2231) #2260 and ricursive: Ripple-65B-Preview on native CUDA (NVFP4) #2302 are in main. The branch is 26 commits on main
6c2254635:ricursive cuda: structured output and forced tool calls for Ripple-65B-Preview #5363's five; 15 of mine from before the rebases (the drafter, its contract entries, the shared-round prices, the
recipe, the changelog line); three of the maintainers' from 21 and 23 Nov (main's behaviour kept and files within
600 lines; logprobs' first row on a drafter server; the gate compare's fed tokens); two of 27 Nov (the drafted GPU
test under a grammar; the recipe's and the changelog's lines on structured output with the drafter); and one of
29 Nov that puts the two changelog lines back under Unreleased (main cut 1.3.7 and the rebases had left them under
it). The maintainer rebased the branch on 28 Nov (
57cd2a937); I rebased it three more times as main moved.Against
5a3580e04, the head this description named before, the lines this PR adds and removes are the same inevery file but one:
zig/tests/fixtures/gradient-serving.tsv, where the pins follow main. Four of themaintainers' commits on the branch as it was before 27 Nov are not in it, because main has their changes: the
two-stream default of a drafter server (
e85c96a30) and the single free when a drafter fails to load(
8570d2c48), both through ricursive: the publisher's DFlash2 drafter for Ripple-65B (stacked on #2231) #2260; Ripple in the CUDA prompt-cache profile list (f12afe37f); and the pin ofkernels.zig(4f3cd815d), which a commit of this branch sets. The stack does not changenative/ricursive.zigor
core/profile.zig.atc overlap --base upstream/main --json(29 Nov, onbace121aa, main at6c2254635, after the last rebase):incomplete (
pullRequestsLimit,otherPullRequestsLimit,pullFilesUnavailable,timeLimit). Of the 43 openPRs that share a file with this branch it tried 10: Implement GLP control vectors with a fused Metal kernel for Qwen3.8-27B #1835, gemma4 Metal: Gemma 4 E4B (NVIDIA Nemotron 3.5 Bolt E4B) on M1 to M4, per-layer inputs and shared KV #2273, glm cuda: TF_GLM_GRAPHS=1 replays verify windows as CUDA graphs (#1490) #2279, hip: ModelOpt NVFP4 and FP8 checkpoints keep their codes and decode in flight #2490 and lane host: --stall-seconds marks a stalled engine unavailable, --stall-exit restarts it #3165 merge clean, and five
conflict. Ling-3.1-flash on CUDA, on one or two GB10s #2340 and qwen3_5 cuda: SenseNova-Loop-9B (sensenova_loop) in BF16, text only #3723 conflict in the serving pins (
zig/tests/fixtures/gradient-serving.tsv); logit_bias: token biases and -100 bans on each row's draw for Qwen CUDA, Qwen3.5-2B Metal and Nemotron Parse HIP #3146 inzig/src/native/cuda.zig; kolibri1: the published EAGLE-3 drafter behind --drafter on CUDA (don't land yet: c=8 -1.1 %, a cold prompt's second token 58 ms later) #3590 inzig/src/native/cuda_drafted.zig; ricursive: load Ripple's EXL3 packs through main's shared EXL3 code #2514, which is stacked on this PR, in 11files (the family, its GPU tests, the recipe and the pins). It did not try 33 more in the time limit, ricursive: serve Ripple-65B on two GB10s with up to 1M tokens of context #2522,
ricursive: speed up Ripple-65B on two GB10s #2523, CUDA (GB10): Flash Next KV in the display carveout, opt-in #2763 and hip ranks: every byte after the key proof crosses the link in sealed records #3075 among them; the run of 28 Nov on
384ce2f83reported ricursive: serve Ripple-65B on two GB10s with up to 1M tokens of context #2522 and hip ranks: every byte after the key proof crosses the link in sealed records #3075 as conflicting.6c2254635(29 Nov): the branch is rebased on it and merges clean. Two conflicts came up in the rebases,and neither needed a code change:
zig/build/cuda_kernels.zig(both lines kept, this PR'sricursive_dflash2entry and main's Inkling 2 comment) and the pin of
zig/src/cuda/kernels.ziginzig/tests/fixtures/gradient-serving.tsv(main's ernie5_5 images and this PR both change that file; the pin isthe hash of the merged file, and all 181 pins match their files). That pin conflicts again each time another PR
that registers a CUDA kernel image merges first.
The review's items (10 and 12 Nov)
6c2254635, with ricursive cuda: structured output and forced tool calls for Ripple-65B-Preview #5363's commits under it. The drafter'scuda_pendingjoin is inzig/src/core/contract/registry_joins.zigbeside the other ricursive lines.zig/src/native/cuda.zigreads.structuresfrom the family's own vtable, not thedrafted wrapper's. On main the families with
openDraftereach havefirst_masked, so none of their offerschange; measured on GB10 on 26 Nov on this PR's code on main
e63912221(ae7b7ba40) against that main, withnvidia/Qwen3.6-35B-A3B-NVFP4andincoai/Qwen3.6-35B-A3B-DFlash2(--context 32768 --parallel 4 --drafter):(
362ea30ec37e5996,16e253366af54a2a,aa862a2410b8b1d5,4db2b06e71a111d0).response_formatjson_schema reply (temperature 0, thinking off): both give the same 41 tokens(
f612b719086989a3) and the same text, and it fits the schema.--drafter: on that base the server refusedresponse_formatup front (HTTP 400), as it didwithout the drafter. With ricursive cuda: structured output and forced tool calls for Ripple-65B-Preview #5363 under this PR the family has
first_masked, so the offer is on and the requestis served (below).
Checks on this head
bace121aa, on main6c2254635. GB10 ran on two earlier rebases of the same commits:384ce2f83(on main
53f24ba5a, 28 Nov) andfa95da583(on main98a901f01, 29 Nov). The head differs fromfa95da583bymain's three newer commits under it and by the place of the two changelog lines, and it has had no GB10 build of
its own. Those three commits change neither the family nor the lanes. Between mains
53f24ba5aand98a901f01,main changed seven lines of
zig/src/core/lanes/accept.zigand the family's Metal drafter kernels;ripple-draftedonfa95da583ran with that under it. The recipe's served checks, the grammar checks and the five-SM limits ran on 27 Nov on1353bbd55(onmain
2713f2791), which lacks only changelog lines and one recipe sentence of this branch, no code. The speeds,the resumed-prompt check, the 22-reply compare and every family's kernel contract ran on 26 Nov on
ae7b7ba40,this PR's code on main
e63912221, before ricursive cuda: structured output and forced tool calls for Ripple-65B-Preview #5363 was under it.6c2254635) and on this head: 93 and 93, 0 new (tools/zig/lean_new.py).tools/pr_check.py --base 6c2254635 --pr 2475: 0 errors.zig fmt --check build.zig zigandgit diff --check:clean.
zig build test test-kernel-contract test-golden -Dcpu=apple_m1, onfa95da583(29 Nov; 32of the 1,205 steps came from the cache): 1,200 of 1,205 steps; 19,643 of 19,811 tests pass, 166 skip, 2 fail.
Main
98a901f01fails the same two on this Mac (an Inkling 2 Metal capabilities test and "info prices aQwen3.8-27B start ...") and the same build step (
lfm3's tests): 1,200 of 1,205 steps; 19,613 of 19,781 pass.On this head, with most steps from the cache: 1,200 of 1,205 steps and the same three failures.
zig build compile-cuda-tests compile-cuda-cli native -Dtarget=aarch64-linux-gnu): 25 of 25 steps.tf-cuda-testonfa95da583(29 Nov), built there for sm_121:ricursive-contract23 kernels passgates 1-4, 0 fail, 28 controls red as planted;
ricursive-dflash2-contract10 and 19;ricursive-dflash2-attn-contract3 and 6;ripple-forward40 passed, 0 failed;ripple-serve13 and 0;ripple-drafted17 and 0. The same lines on384ce2f83(28 Nov).384ce2f83against main53f24ba5a, both built in onewindow (28 Nov;
--context 32768, 8 streams; 32 requests, 16 plain and 16 under a grammar). Plain: the headequals main alone, 16 of 16, in each phase (alone, 8 at once, mixed rounds of 2 and of 8), with equal logprob
rows. Under a grammar: main refuses all 16 (HTTP 400); on the head each reply is valid, and in mixed rounds of 2
and of 8 each equals the same request alone, 16 of 16. With
--drafter: the same results against main, and eachof the 16 replies under a grammar equals the plain server's; 1,696 of 5,943 drafts accepted.
zig build fatbins kernel-contract-fatbins -Dsm=80,86,89,120,121, thentf-cuda-test kernel-contract-limits, on1353bbd55(27 Nov): the 15 ricursive kernels pass on all five targets with theirrecords current (75 of 75), and the two planted controls are red on all five. The run as a whole fails with 821
stale register records, all on kernels this PR does not change (GLM, qmmf, moss image, tfq3, prompt attention and
others;
git diff --stat 6c2254635 HEAD -- zig/kernels/lists only ricursive files). The same run on the old baseon 26 Nov gave 689 of the same kind. I did not run main's limits in this window.
zig build kernel-contract -Dsm=121), onae7b7ba40(26 Nov): 908 kernels, 906pass gates 1-4, 2 fail, 12 known findings; 589 of 589 controls red as planted. Main
e63912221gives the sameline the same day; the 2 failures are GLM's on both.
launch records fit each). Draft trees (several drafts a stream): not done; chain verify only.
Receipt
rows, and one-row decode) against the reference dumps that main gives too, on
384ce2f83(28 Nov); the 256-tokengreedy run's token hash is equal, at 248.188 ms a token (main
e63912221: 247.954 ms, 26 Nov).6c2254635under the head (the GB10 runs were on mains53f24ba5aand98a901f01),with ricursive cuda: structured output and forced tool calls for Ripple-65B-Preview #5363's commits, Zig 0.17.0, CUDA 13 (nvcc 13.3, V13.3.73), DGX Spark (GB10,
sm_121, 121.7 GiB shared),
ricursiveAI/Ripple-65B-Preview-NVFP4at99eea4477a001a41b86914e41feb4b2ed86105e5,ricursiveAI/Ripple-65B-Preview-DFlash2at35609b3be3dd08a822b3ba1257c1ea5dd6f87632,--context 32768.ricursivefamily (the taps after layers 1, 20, 39, 58 and 77, andthe drafter); ricursive: the publisher's DFlash2 drafter for Ripple-65B (stacked on #2231) #2260's backend-independent DFlash2 config parse, read unchanged; the contract registry and the CUDA
kernel list (new entries only); the drafted lanes and the CUDA calibration (
core/lanes/drafter.zig,core/lanes/drafted.zig,native/cuda_startup_costs.zig), which take a drafter'sshared_costswhen it gives them;native/cuda.zig's structured-output offer (item 2 above). Metal and the shared DFlash2 code are not reached. Theother CUDA families' drafters give no
shared_costs, so their rounds are priced as before. Run: sm_121. Not run:sm_80, 86, 89, 120.
ae7b7ba40(26 Nov): the server with--drafteragainst the same binary without it, 22 of 22 replies equal(greedy and sampled at fixed seeds, at 1, 2 and 8 streams).
tools/bench_concurrent.py --levels 1,8 --alone --serialwith the drafter (256 tokens, 3 reps, T 1.0 and 0): 0 unequal in 144 comparisons, each reply againstitself alone (108) and against
"draft": false(36), with drafts accepted in every cell (167 to 1,575).Cold 2,048- and 8,192-token prompts: the drafted reply equals the plain one.
1353bbd55(27 Nov), the recipe's served checks (157 requests) on a--drafterserver against ricursive cuda: structured output and forced tool calls for Ripple-65B-Preview #5363's plainserver: 157 of 157 equal by status, finish reason and reply hash; the 73 logprob rows equal the plain server's
and the rows with
"draft": false.1353bbd55(27 Nov):plain server's. On the structured requests 233 of 499 drafts were accepted (386 tokens in 135 rounds, against
402 tokens in 376 rounds with
"draft": false); on the tool requests 104 of 188.grammar forms), greedy and sampled with a seed each, sent alone, then 2 at once, then 8 at once. On the plain
server each of the 36 replies is valid for its form and equals the same request alone. On the
--drafterservereach also equals the plain server's reply, and the server's
donelines show 158 of 339, 42 of 89 and 149 of 365drafts accepted at the three levels.
ripple-draftedcheck 3): under a test grammar that gives every window row its own mask,drafted replies equal plain ones token for token at 1, 2 and 8 streams, greedy and sampled. The fixture's
drafter is random, so no draft is accepted there (0 of 2,209 without a grammar too): that test covers the
rejecting verify, and the served check above covers accepted drafts.
ae7b7ba40(26 Nov): 8 conversations of 52 to 2,287 prompt tokens (greedy and sampledat fixed seeds). Each reply resumed from the prompt cache (49 to 2,284 cached rows) equals its fresh reply and its
"draft": falsereply, alone and with eight streams at once: 8 of 8 conversations, 32 requests.--drafter, onae7b7ba40(26 Nov; 256 tokens, median of 3; code is a rawtext completion, prose a chat reply). One stream from
tools/bench_openai.py; eight streams together fromtools/bench_concurrent.py --levels 8, counting all eight streams' tokens:tools/bench_cache.py --require-cold, median of 3), onae7b7ba40(26 Nov):time to first token, and prefill as prompt tokens over that time:
the drafter follows.
Weaknesses and open questions
drafter rows that round (
shared_drafts.budgets), so code may run on short copies in place of the drafter. Notmeasured: the server has no copy counters.
420 ms at 128 (the drafter's load-time times). That is a lead for kernel tuning, not part of this PR.
this PR does not tune. With
--drafterthe first token comes 0.03 s later at 2,048 tokens and 0.13 s later at 8,192(0.7% and 0.8%), so the checklist's last item is not met for prompts.
fa95da583(29 Nov); the CLI and token-ID checks from
384ce2f83(28 Nov); the recipe's served checks and the five-SM limitsfrom
1353bbd55(27 Nov); the speeds, the resumed-prompt check and every family's contract fromae7b7ba40(26 Nov, on main
e63912221). Not measured at all: a resumed prompt under a grammar.Kernel contract
ricursive, 10 inricursive dflash2, 3 inricursive dflash2 attention); none replaced.SUMMARYline and exit status: CUDA (GB10), onfa95da583(29 Nov), each exit 0:SUMMARY ricursive: 23 kernels, 23 pass gates 1-4, 0 fail; 28 controls: 28 red as planted, 0 missedSUMMARY ricursive dflash2: 10 kernels, 10 pass gates 1-4, 0 fail; 19 controls: 19 red as planted, 0 missedSUMMARY ricursive dflash2 attention: 3 kernels, 3 pass gates 1-4, 0 fail; 6 controls: 6 red as planted, 0 missed(
ricursive's line counts ricursive cuda: structured output and forced tool calls for Ripple-65B-Preview #5363's mask case and its control: 22 kernels and 27 controls are this family's withoutthem.) Metal: ricursive: the publisher's DFlash2 drafter for Ripple-65B (stacked on #2231) #2260's.
Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.--drafter, no slower than without it, greedy and sampled (Decode holds. A cold prompt's first token comes 0.7% to 0.8% later with--drafter.)Authored by JRB AI in a private capacity. This contribution does not represent the views or positions of any organisation.