Repository navigation
Prefill on a GB10, decode on a Mac: long prompts for Qwen3.8-27B handed over ConnectX (#1594, step 2b) - #2648
ThinkOffApp wants to merge 17 commits into
Conversation
|
Design and hardware runs for this PR (moved out of the description for GitHub's length limit). 1. MKVH protocol 2: a recurrent layer's state, part by part
What a protocol 1 peer does with protocol 2Until MCDMA's own change, a protocol 2 hand-off is TensorFold to TensorFold. Protocol 2 is not MKVH's first layout for recurrent state: at c07ca4e, MCDMA's protocol 1 already carries Qwen3.8 Flash Next's hybrid state as named entries (kinds
2. One order for the hybrid state:
|
| Case | Prompt, cut | Pull, run 11 (GB10 prefill incl.) | Hand-off KL max / mean | Floor KL max / mean | Ratio max / mean | Top-1 | First token | Worst logit diff | Tool (0.02 nats) | Verdict |
|---|---|---|---|---|---|---|---|---|---|---|
| R1 | P1 2048, 1024 | 1.15 s | 4.212e-3 / 6.865e-4 | 1.736e-2 / 1.568e-3 | 0.24x / 0.44x | 32 | equal | 0.81 | pass | PASS |
| R2 | P1 2048, 2032 | 2.12 s | 9.110e-3 / 1.200e-3 | 1.736e-2 / 1.568e-3 | 0.52x / 0.77x | 32 | equal | 0.75 | pass | PASS |
| R3 | P2 2048, 1488 | 1.55 s | 7.536e-3 / 7.378e-4 | 2.659e-3 / 6.756e-4 | 2.83x / 1.09x | 32 | equal | 1.43 | pass | FAIL (rule 3, max) |
| R4 | P3 4096, 4000 | 3.48 s | 4.052e-3 / 7.694e-4 | 3.848e-3 / 6.249e-4 | 1.05x / 1.23x | 32 | equal | 1.08 | pass | PASS |
| R5 | P4 16400, 16384 | 13.93 s | 7.648e-2 / 3.731e-3 | 1.244e-1 / 5.626e-3 | 0.61x / 0.66x | 31 | equal | 11.0 | ImportTooFar | PASS |
P1 to P3 are fixed prompts of 2048, 2048 and 4096 tokens, raw text with no chat template: P1 is eight short synthetic prompts (a chat request, a Python task, a GPU explanation, a word problem, meeting notes to summarise, a translation, a checklist and a reading question), each cut to 128 tokens, in turn and twice over; P2 is P1's sixteen 128-token blocks in reverse order; P3 is P1 then P2. The four prompts' token arrays, P4's included, are in the description's pr-1594-2b-inputs.zip (gate/, sha256 c14c4116, 5455ab19, 68efa171 and 7687ef57). P4 is synthetic: the first 16,400 tokens of agent 0's 22,528-token first turn in the campaign's padded 32k chat fixture (chat-l32768-t0), a 57-token system and user opening followed by one padding word, reference, 16,343 times; the cut falls inside the padding, so the Mac's reply starts by closing the user's turn. The cases' cuts were fixed in the frozen file on 16-token page rows, so run 2's cuts of 2047 and 1500 moved down to the row below (2032 and 1488).
4 of 5 pass; R3 fails rule 3 on its worst step.
- R3: P2's own floor is the tightest of the four (KL max 0.0027), so a small absolute distance gives a large ratio: the hand-off's KL max is 0.0075 nats, 0.0049 above that floor (0.0035 over the 1.5x bound) and under P1's floor (0.0174). Under the frozen rule it is a FAIL. Run 2 failed the same prompt at cut 1500, moved by file, at 3.07x. The two results are not independent: the cuts are 12 tokens apart, and both are measured against the same 32-step floor (run 2's GB10 tail for P2, which does not depend on the cut). Both pass on the mean (1.09x here, 1.42x in run 2) and fail on one worst step, at a KL (0.0075, 0.0082) within the passing P1 cases' range (0.0042 to 0.0194, the latter from run 2's P1 at cut 2047). Whether this is a per-prompt effect of a GB10-made state under Metal's continuation or an artifact of one short floor sample is open.
- R5 (16k, the synthetic padded prompt): the 16k pull lands whole, and the hand-off's distance is under the floor's on the same steps (0.0765 against 0.124 nats at worst); each agrees with the Mac's own top-1 on 31 of 32 steps. The tool's absolute 0.02-nats check stops R5 (ImportTooFar, one step at 0.0765, worst logit difference 11.0), where the GB10-only floor on the same steps reaches 0.124. On this one prompt the backends' own gap is larger and the hand-off stays within it; it is not evidence about real 16k text.
- Every pull landed whole at the expected cut.
- Controls (from run 2; they test the metric, which is unchanged): a zeroed KV, swapped layers and a zeroed recurrence each fail rule 3 by 5 to 360x.
The served hand-off on hardware (runs 9 and 9b)
Both servers as a user runs them: the GB10 serve MODEL --context 16384 --parallel 1 --mcdma-produce tf2b, the Mac serve MODEL --context 16384 --parallel 1 --prompt-cache-gib 0 --prefill-from http://GB10:8000 --mcdma-link tf2b with TF_PREFILL_MIN=1024 and TF_PREFILL_CHUNK=512. mcdma-rpcd 487d4c7: the GB10 listen tf2b rocep1s0f1 1 1024 ADDR:18620 64 64, the Mac connect tf2b,ADDR,18620,rdma_mcrdma0,0,1024,64,64. A 2048-token prompt as a completion, 32 tokens, temperature 0: the remote prefix is 1536 tokens, and the GB10 is asked for 1537.
Run 9 found two bugs on the hardware, each fixed in this PR. Run 9's last attempt, on a build with both fixes, pulled the 1536-token prefix over the link with the same 32 tokens as the Mac's own reply, and passed the GB10 stop and restart cases. Neither fix has a unit test: both sit in the CUDA producer's serving loop (native/cuda_produce.zig), which no test drives, so these hardware runs are their only check.
- The producer never registered as its link's service, and mcdma-rpcd's listen daemon sends no staged reply without one, so the Mac's pull timed out and it prefilled locally (e983407).
- The listen daemon zeroes the request word on each new connection and the client counts from 1, but the producer's service kept its old count (7d3bebb).
Run 9 ran the branch before the rebase onto main (the content of 1ef044e here on the Mac, 7d3bebb on the GB10). Run 9b ran the source with the first review's fixes, before the rebase onto main: this PR's commits through 82b73c4, then on main at ab4b2f0. The served fault cases were not rerun on 48f6cac.
| Case | Mac log | exact_mode / tensorfold.remote_prefix |
Reply against Mac-only | Wall |
|---|---|---|---|---|
| hand-off | no warning | remote_prefix / 1536 |
identical | 4.35 s (the first request after start) |
| GB10 server stopped | "remote prefill failed (ConnectionRefused); the prompt is prefilled here" | exact / none |
identical | 3.11 s |
| GB10 server back | no warning | remote_prefix / 1536 |
identical | 3.07 s |
At stop the Mac logged "remote prefill: 2 prefixes pulled, 1584.7 ms each on average". No restart of the Mac was needed when the GB10 came back. At 2k tokens a hand-off costs about what the Mac's own prefill does; the gain is for long prompts (below).
Long-prompt timings
A synthetic 32k chat replayed turn by turn, one request in flight, 256 tokens out per turn: a cold 22,528-token first turn, then six follow-ups adding 512, 1,536, 3,072, 512, 1,536 and 3,072 tokens, ending at 32,768. Its text is filler, not ordinary prose: a fixed one-line system message, then for each turn a fixed one-line assistant message (not the model's reply) and a user message padded to its exact length with one repeated word, so 98.6 to 99.7% of every prompt is that one token. The timings below are for this fixed synthetic input only; they were not repeated on prose or code (the main-against-branch cells above use both, without a hand-off).
Three arms on the same build (48f6cac), with TF_PREFILL_MIN at its old default, 1024. Each Mac arm ran serve MODEL --context 33024 --parallel 1 --prompt-cache-gib 16 --temperature 0 --snapshot-dir none --max-snapshots 0; the hand-off arms added --prefill-from URL --mcdma-link LINK with TF_PREFILL_CHUNK=512 and TF_PREFILL_KEEP=0 or 1. The GB10 ran serve MODEL --context 131328 --parallel 1 --prompt-cache-gib 24 --mcdma-produce LINK, restarted before every hand-off sequence. The Mac alone's follow-ups resume from its prompt cache. Five blocks with the arm order rotating, every request checked for its token counts and cache use, resources sampled on both hosts; all 105 requests passed. The MacBook Pro M5 Max ran in a desktop session with apps paused; the Mac and the GB10 were on a MikroTik switch (ConnectX at both ends). Times are the replay client's, from sending a streamed chat request to its first content. Medians of the five blocks, in seconds:
| Turn (prompt tokens) | Mac alone | Hand-off | Hand-off, TF_PREFILL_KEEP=1 |
|---|---|---|---|
| 1, cold (22,528) | 39.55 | 20.28 | 20.35 |
| 2 (+512) | 0.99 | 5.66 | 1.01 |
| 3 (+1,536) | 2.93 | 7.01 | 5.49 |
| 4 (+3,072) | 6.32 | 10.11 | 8.75 |
| 5 (+512) | 1.12 | 6.91 | 0.98 |
| 6 (+1,536) | 3.40 | 8.90 | 7.19 |
| 7 (+3,072, 32,768) | 7.25 | 7.81 | 6.49 |
| Each block's first-token waits, summed (median block) | 60.52 | 66.73 | 50.26 |
| Each block's HTTP time, summed (median block) | 146.63 | 140.21 | 127.08 |
The last two rows are the median block's own totals, so they can differ slightly from the column sums (61.56, 66.68 and 50.26 for the first-token rows).
- A cold long prompt is where the hand-off pays: 1.95x sooner at the medians (20.28 s against 39.55 s), 1.47x to 2.08x block by block. The Mac alone's cold turn took 29.9 s in the first block and 37.8 to 42.1 s in the other four (the cause was not measured, and the Mac's thermal state was not recorded); the hand-off's took 20.2 to 20.5 s.
- With the defaults (TF_PREFILL_KEEP off), every follow-up pulls its whole prefix again, so follow-ups lose: a 512-token follow-up took 5.66 s against 0.99 s on the Mac alone. With TF_PREFILL_KEEP=1, a small follow-up resumes on the Mac (1.01 and 0.98 s, as the Mac alone does). A larger one still pulled whenever the GB10's prefix beat the kept state by 1024 tokens, and that lost at 24k to 30k context but won at 32k (6.49 against 7.25 s).
- Median decode per turn over the blocks: 18.4 to 23.4 tok/s for the Mac alone, 23.5 to 26.0 with a hand-off and 22.6 to 24.5 with TF_PREFILL_KEEP=1. One request at a time, so this is not batched throughput, and the Mac alone's later turns ran slower for reasons not measured.
- The hand-off arms' replies differed from the Mac alone's in 5 of 7 turns (see "Exactness").
The 4096 default
1024 pulled too eagerly for chat follow-ups, so this PR's default is 4096 (875efd5). That is a judgment from the table above, not a scored winner. One unscored pass each at 4096 and 8192, TF_PREFILL_KEEP=1, set by environment on the same 48f6cac binary, seconds to the first content:
| Turn | 4096 | 8192 |
|---|---|---|
| 1, cold (22,528) | 19.97 | 20.70 |
| 2 (+512) | 0.78 | 1.15 |
| 3 (+1,536) | 2.29 | 3.26 |
| 4 (+3,072) | 5.25 | 6.68 |
| 5 (+512) | 0.93 | 1.05 |
| 6 (+1,536) | 2.59 | 3.18 |
| 7 (+3,072, 32,768) | 6.76 | 7.18 |
| Sum of the unrounded times | 38.56 | 43.19 |
In both passes only the cold turn pulled (22,016 tokens), and every follow-up resumed its kept remote state on the Mac. The two did the same work, so the gap between them is run-to-run spread (the Mac's thermal state was not recorded), not the threshold; they differ only for a follow-up that adds between 4,096 and 8,192 tokens, which this chat does not have. Single passes, so they are not set against the five-block medians above.
The default keeps a pulled chat's small follow-ups on the Mac only with TF_PREFILL_KEEP=1. Without it the Mac keeps nothing a pulled prefix built, so a follow-up has nothing local to resume and pulls its whole prefix again, at any threshold below its length.
128k
One diagnostic pass, not scored, on 48f6cac, both servers with --context 131328, the Mac with TF_PREFILL_KEEP=1, TF_PREFILL_MIN=8192 and a 16 GiB prompt cache: a cold 120,832-token first turn reached its first content in 136.1 s (120,320 tokens pulled, 512 prefilled on the Mac, then 20.1 tok/s decode). Its first follow-up did not finish: about 10 s in, before its first token, the timing harness's own guard stopped the run and the server, as it does when the Mac's free plus inactive memory falls below 32 GiB (it reached 30.2 GiB; macOS memory pressure stayed normal, and the server had logged no error). Scoring long 128k chats needs a smaller footprint or a lower floor. Mac-alone runs earlier that day took 375 to 380 s to the first content of a cold 128k first turn, on an older build in another window, so that is not a matched comparison. The Mac's thermal state was not recorded in this pass or in those runs.
Refusals
Every plan refused today is still refused. Nothing under zig/src/cluster changes; the cluster's CUDA build only takes the fabric module it now shares with the engines (one file, one module). Step 2a's eight hardware refusals, rerun on the Mac with this PR's tf-cluster (built from a clean archive of 48f6cac): 8 of 8 pass (a converged model refused naming the Shard, exit 1, from node and serve; no library and no library field, exit 3; a Mac GID index 1 and a relative bin refused; unknown flags refused, exit 2). zig build test-cluster at this head: 115 passed, 0 failed, 6 skipped. The hand-off adds its own refusals, by name, listed in sections 3 and 4.
|
Prompt inputs named in the description: pr-1594-2b-inputs.zip |
6f3fac8 to
7016e4e
Compare
|
@ThinkOffApp thanks for the design write-up and the runs. Off by default with the default path gated, state moved byte for byte in native dtypes, a CRC a frame, and refusals on model, checkpoint, token sha, TP, geometry and protocol: the shape is right. Before this can land:
With 83 commits, could you also squash it into a handful? We'll write the CHANGELOG line. |
7016e4e to
f3e7991
Compare
|
@ashhart thank you for the review! All six points are done on the new head, f3e7991: five commits on today's main. The description is refreshed to match. Description: updated the new head, keep on by default, the 400 and exact_mode: "remote_prefix". Tokens Six prompts (mixed and code, at 2k, 8k and 32k tokens), 256 positions each, on one fixed Mac history. The hand-off differs from the Mac at 0 to 8 positions, about as often as the GB10 alone does, and always where the top two choices are within 0.25 logits. Pulling the same prompt twice, and importing the same state from a file, gave identical bytes and tokens. The table is in the description; I can post every position with its margins too. Auth and limits The trigger sends TF_PREFILL_API_KEY_FILE as a Bearer token, and a 401 names that setting. Held exports are capped by TF_PRODUCE_HELD_GIB (default 32) and refused by name past it. Both have tests. Scope the disk-read fix is now #2694. Qwen3.5-9B is refused at start. Provenance The line is in the description. A short script rebuilds the gate's prompts from text, byte for byte; I can post it here if you'd like it in the thread. Tests on this head: Mac golden 12,342 passed, Linux 9,040 passed, 0 failed. |
|
Thanks @ThinkOffApp. That's a thorough round: the Bearer key with its 401, the held-export cap, the new tests, the 9B refused at start, #2694 split out, and five clean commits. A few small things before we run it:
On the teacher-forced gate, where R3 fails rule 3 on its worst step: we're deciding how to weigh it against the token table, and we'll come back to you here. After the rebase, we'll run main against this branch with the flags off on an M5 Ultra and a GB10.
|
|
@ashhart thanks. Points 1 and 2 here, with the full lists in the attached file. Points 3 and 4 follow separately. 1. Margins. Over the six prompts, 256 positions each, 20 positions have any two of the three setups picking different tokens:
At every one of the 20, at least one setup's own top-1 minus top-2 margin is 0 (equal recorded logits), and the largest margin on any side is 0.25 raw logit. All three setups were fed the same Mac-generated history, so a difference does not carry into the next position. The file lists each of the 20: prompt, step, position, the three tokens (id and text) and the three margins. 2. Inputs. The file holds The script that first made the prompts was not kept, so this is a rebuild from the published token ids. All of it is synthetic. Details in attachment |
|
Thanks @ThinkOffApp for the margins table and the prompt rebuild script. 20 differing positions, each with a zero margin on at least one side and none above 0.25, is what we asked for. Still open, as you said:
On the teacher-forced gate: we keep the rule as it was frozen before the run, so R3 counts as a fail, and we won't widen the bound after seeing the numbers. Its mean is inside (1.09x); it's the worst step that is 2.83x. To tell a seam problem from a near-tie, could you post:
A spike on the first steps after the cut would point at the hand-off seam (position, layout or a conversion at the boundary), and that would need a fix. One far from the cut, at a near-tie, is a case we can weigh with the tables in front of us.
|
f3e7991 to
f99c102
Compare
|
Thanks @ashhart . All three, on the branch rebased onto 14dea6c (head f99c102).
So one cut of three fails on max, at a step far from the cut. I am not asking to change the bound. Please say how you would like to treat it: R3 recorded as a fail in the PR text, or more prompts at cut 1488 under a rule frozen first. The per-step table, top-5 lines, receipt tables, test counts and two known limits are attached: |
|
Thanks @ThinkOffApp for the rebase, the resumed-against-fresh receipt and the per-step gate output. That covers everything we asked for.
Thanks for the CHANGELOG line too. We may adjust the wording when it lands. Now that it's rebased, we'll run main against this
|
|
Hi @ashhart! Thanks for the careful review. Here is where each point stands on 5e39931. 1. The gate, frozen first. The rule file is below, sha256 2. The description is now on 5e39931. It has the 1024 and 2032 results with the commits each end ran (two separate runs, and it says that the second one reused its floor), what the eight new commits change, and the lane_host_prefix change. 3. Flags off at this head, main 222f038 against the branch, on the GB10 and on the Mac. Resumed against fresh: 72 of 72 rows on each machine, all four equalities hold. Concurrent against solo: every token comparison matches (180 on the GB10, 120 on the Mac). Prompt and decode tok/s for main and the branch are tabled in the description, two runs per build, with no equivalence test; we make no speed claim either way. The concurrency prompts are 14 and 31 tokens, too short for a follower to wait on a leader's mark, so we added a pair that shares an 8.8k system prompt, the second sent during the first one's pass: cached 0 solo, 8192 (GB10) and 8829 (Mac) behind the leader, and one token hash for solo, concurrent, main and branch on each machine. The follow-up that resumes slot 0 in place while a second request arrives: we tried and could not produce the changed case live. Right after a 32k turn the cache held entries at 32761 and 29720 with the reply ending at 32787, 26 tokens away and under the mark spacing; once the warm pass was idle it held 32787 and 32761, so the follow-up's stored state sits where slot 0 stands. A mark below slot 0's start needs the cache to have lost that conversation's entries while slot 0 still stands, and we found no deterministic sequence for that. So the clause rests on its two host tests. On the CUDA server that serves this model it cannot arise, since a pass there starts at 0 or exactly at the restored entry ( We kept One aside from an earlier CI run here: The pair run at the rack comes next, once you are fine with the file. Cheers
|
Keep both sides of the six conflicts: ashhart#2648 changelog and remote-prefill fields, plus main's wait_reason ledger, refusals.count, and new host tests. Map a remote fill wait to Wait.remote_prefix. HIP ashhart#2961 already sits in the released notes, so it is not repeated under Unreleased. Local only; not pushed.
…nto their own files
|
Thanks @ThinkOffApp for the frozen rules and the flags-off checks. We cannot accept the current handoff mode because it changes output tokens. A KL threshold or an opt-in label does not qualify it. We will handle the current-main integration and consider a design that preserves the Mac-only reply exactly; please hold the proposed quality-gate run.
|
Summary
A Mac serving Qwen3.8-27B normally works through the whole prompt itself before the reply can start, which is slow for long prompts. With this change a GB10 can work through the long start of the prompt instead and send the result to the Mac over ConnectX, through a switch or a direct cable; the Mac then finishes the prompt and writes the reply. It is off unless both machines are started with the new options. In a test with a made-up 120,000-token chat, the time to first token (TTFT) was 136 seconds instead of 385 (2.8 times faster), and over the seven-turn chat the summed TTFT was 55.5% lower, though one long follow-up was slower. A GB10 serving the chat on its own was quicker still. The Mac keeps what the GB10 sent, so short follow-ups stay on the Mac. A reply built on the GB10's work can differ from one the Mac makes alone. On the same fixed Mac-generated history, its next-token choice differed from the Mac at 0 to 8 of 256 positions across six prompts of 2k to 32k tokens, always where the top two choices were within 0.25 logits, and about as often as the GB10 alone differs from the Mac; free-running replies can diverge after the first changed choice. One of five teacher-forced correctness checks still fails.
Speed
Mac M5 Max plus one GB10, Qwen3.8-27B, one chat at a time; the hand-off runs went through a MikroTik switch. TTFT is the time to first token, in seconds: from sending a request to the first words of its reply. "Faster" is against the Mac alone on the same build.
128k chat, measured on 7016e4e (before later review fixes, not re-timed, and not re-run on 5e39931), the defaults (keep on, threshold 4,096). A made-up 120,832-token first message, then six follow-ups up to 131,072 tokens. Each turn replays fixed assistant text rather than the previous generated answer. 20 GiB prompt cache, room for two saved states of this one chat (each about 8.5 GiB at 128k). Median of 3 scored blocks.
TTFT in seconds; the last column compares the default hand-off with the faster single machine on that turn (the GB10 on every turn here):
Reply speed, decode tokens per second of each 256-token reply (medians); the last column compares the default hand-off with the faster single machine on that turn (the GB10 on the first three, the Mac on the last four):
The Mac decodes the hand-off's early replies faster than it does alone at the same lengths (about 20 against 14 tok/s); this is measured, not yet explained.
* GB10 alone is a separate, later set of 3 runs, not interleaved with the other three: same build, chat and cache, with the Mac's client reaching the GB10 over the home LAN.
Next: faster follow-ups (planned, a separate PR). After the first message, we suspect the hand-off's TTFT is mostly the Mac prefilling a follow-up's new tokens itself, which at 128k context is slower than on the GB10 (the Mac alone took 1.1 to 3.7 times the GB10 alone's TTFT on the follow-ups above). The plan: the GB10 keeps each chat's state in its own prompt cache, prefills only a follow-up's new tokens, and sends the Mac just what changed (the recurrent layers' state and the new attention rows: by the state's layout about 355 MB for a 3,072-token follow-up, rather than the whole 8.5 GiB; not yet measured). The aim is a TTFT close to the GB10 alone on every turn, with the reply still decoded on the Mac. Profiling the last turn's time (restore, Mac prefill and the rest) comes first, to test where the time goes.
32k chat, an earlier build (48f6cac) with a 1,024-token threshold. First message 20.28 s against 39.55 s (1.95x faster, median of 5 blocks). With keep on, the whole chat waited 50.3 s against 60.5 s (17% less); with keep off the follow-ups were slower at the medians (one of 30 requests was faster). One unscored pass at today's 4,096 threshold with keep on: 38.6 s summed.
What this changes
Opt-in, Qwen3.8-27B only: with
serve --mcdma-produce LINKon a GB10 andserve --prefill-from URL --mcdma-link LINKon a Mac serving the same checkpoint, the GB10 prefills a long prompt's prefix and hands the model state to the Mac over ConnectX, through a switch or a direct cable (MKVH protocol 2, through mcdma-rpcd); the Mac prefills the rest and decodes. Two changes every server sees: it readskv_transfer_params.mcdma_handoffon /v1/completions and /v1/chat/completions, and a malformed one, or one sent to a server without--mcdma-produce, now gets a 400; and a reply'sexact_modecan now be"remote_prefix"(only on a server started with--prefill-from), with its fields in docs/api.md. The disk-read fix that was in earlier heads (resume the RAM state after two failed disk reads) is now its own PR, #2694.atc overlap --json: of 105 open PRs sharing files, atc test-merged ten before its file and time limits; three conflicted in the environment registry's table rows this PR adds to: Persistence: the key gaps #2163 leaves, for every family (closes #2131) #2287, native: Drama 3's CUDA settings get table rows, so its open no longer panics #2658 and train 1109071719: #2658 #2642 (CI only) #2659. native: Drama 3's CUDA settings get table rows, so its open no longer panics #2658 has since landed and this head is rebased past it; Persistence: the key gaps #2163 leaves, for every family (closes #2131) #2287 and train 1109071719: #2658 #2642 (CI only) #2659 still overlap, and whichever lands second rebases. (Run on an earlier head; not rerun after the squash.)Eight new commits
The branch is 15 commits. Seven of them were there at the last review: fabric, core, native, serve, the tests on real weights, the changelog line, the refused-keep test. The eight new ones:
d12ea374dqwen27: a hand-off turn leaves slot 0 resumable, so the follow-up resumes on the Mac instead of pulling the whole prompt againf0cd32dd1tests: that resume pinned through the lane host and attach (qwen27_handoff_test.zig, 4 tests)db68372d9lanes: a request no longer waits for a leader's cut at or below where the leader's pass began (core/lane_host_prefix.zig, 2 host tests); every server's path. We tried to produce the changed case live with flags off and could not. Right after a 32k turn the prompt cache held entries at 32761 and 29720 with the reply ending at 32787, 26 tokens away and under the 256-token mark spacing; once the warm pass was idle it held 32787 and 32761, so a follow-up's stored state sits where slot 0 stands. A mark below slot 0's start needs the cache to have lost that conversation's entries while slot 0 still stands, which we could not produce deterministically. The clause is covered by its two host tests. On the CUDA server that serves this model the case cannot arise, because a pass there starts at 0 or exactly at the restored entry (families/qwen3_5/cuda_prefill.zig:132-143).376577d84build: the rounds tool's census build imports hybrid_state, so compile-qwen35-rounds-host builds againef2b14b96qwen27: one rule (inherit) decides which resumed plan takes its rows' origin, local or remotee0010c4fctests: the hand-off resume tests assert what the code sets, not what the fixture set04c2fa869rebase: keeps main's current reply-priority rule in the reply-cache test and moves the --mcdma-produce refusal into cuda_refusal.zig to keep cuda.zig under the size limit5e399316dfmt: realigned environment test rows after the rebase, no behaviourqwen27_resume_remote_test.zig (7 pure-rule tests) runs in plain
zig build teston every OS. qwen27_handoff_test.zig (4 tests) needs the Metal served module and runs only under test-qwen27-reply-cache-host on macOS.Frozen gate at 1024 and 2032
These are two separate runs. The gate file itself will sit in the review thread before any case is run: GATE2-RULES.md, sha256 536442f580b3dbbacacc6390725608ab41a05bee031aba1dc562daa60de503d2 (4267 bytes, one trailing newline); both ends named in that file are 5e39931.
Run 11. R1 and R2 at cuts 1024 and 2032. Both ends 3d427dbf8 (later rewritten as 48f6cac). R3 in that run used chunk 1488, not 1024/2032.
Run 12 (10 Nov 17:06 to 17:11Z). P2 at C1024 PASS (KL max 3.228e-3, mean 5.240e-4) and C2032 PASS (KL max 3.669e-3, mean 8.148e-4); R3 FAIL. Two pairs: Mac tool 76ddde0ff with producer 3d427dbf8, and Mac tool d6e458372 with producer d88ade1. Run 12's GB10-alone floor was reused from run 10 and recomputed on each Mac build; it is not a new GB10 floor. The new gate requires floors from the same builds, so these 1024/2032 numbers are not that gate.
Flags off at this head
Main 222f038 against branch 5e39931. No hand-off flags.
Resume vs fresh. 72 of 72 rows on each machine, all four verdicts PASS: main equals branch resumed, main equals branch fresh, resumed equals fresh on main, resumed equals fresh on the branch.
Concurrent vs solo. All comparisons match (180 on the GB10, 120 on the Mac). Two runs per build, no equivalence test; the rates are tabled below and we make no speed claim either way. GB10 default cache 29.6 GiB; Mac 20.7 GiB. The short concurrency prompts (14 and 31 tokens) do not exercise a follower waiting on a leader's mark: on the GB10 they report cached 0; on the Mac, code cached 0, chat at one stream cached 24, chat at four streams mixed 0/24.
Medians of the two runs per build, default prompt cache. Prompt rate is prompt tokens over client TTFT, not engine prefill throughput.
GB10:
Mac:
n/a: 24 prompt tokens were cached in that cell, so there is no cold prompt-rate sample.
Shared 8.8k system prefix, follower sent during the leader's pass. Solo follower cached 0 on both machines. Concurrent follower cached 8192 on the GB10 and 8829 on the Mac, the same on main and the branch. One token hash for solo, concurrent, main and branch on each machine (GB10
c41a9529c2484073be9217a7150b8cba2506e91948de9d9e045d2e5f5769974d, Macc21c2f7d10138b2c46e35845887a607e71e3f1870cd747034a850836260b3e68). Direct evidence is the follower's submit inside the leader's fill span and the reused cached count. GB10 follower TTFT 7.264 to 7.278 s. Mac follower TTFT 14.3 to 16.1 s; the laptop was running other work during these runs, and with main at both ends of the spread we read it as noise, not a difference between builds.Checks on this head
zig build testwas not repeated on this base.--drafterwith the hand-off (refused).Receipt
fibonacci-rawdecode, 8-streamcode) stayed inconclusive.--prefill-from URL,--mcdma-link LINK,--mcdma-produce LINK, off by default.TF_PREFILL_MIN(4096),TF_PREFILL_CHUNK(512),TF_PREFILL_KEEP(1),TF_PREFILL_AHEAD(4),TF_PREFILL_TIMEOUT_S(60 s plus 1 s per 400 tokens),TF_PREFILL_API_KEY_FILE(the Mac sends the key in it as a Bearer token; a 401 names the setting) andTF_PRODUCE_HELD_GIB(32: the GB10 refuses an export past it by name) are in main's environment registry and docs/environment.md.TensorFold/Qwen3.8-27B-MLX-4bitat 70ae7fac; mcdma-rpcd 487d4c7 (MCDMA's codex/cuda-vulkan-rdma plus one local macOS build fix).--alone --serialandtoken_shaequal main. With them, a reply on a pulled prefix comes from the GB10's arithmetic, can differ from the Mac's own, and saysexact_mode: "remote_prefix". The frozen teacher-forced gate, last run on an earlier head, passes 4 of 5 cases; R3 fails its worst step at 2.83x the GB10-alone floor (the same prompt failed at 3.07x in an earlier run). Not re-run on 5e39931. Tokens, on one fixed history (every setup fed the Mac's own greedy reply, so a difference doesn't carry forward; free-running replies can diverge after one) over 256 reply positions, six prompts (mixed public docs and source, and code only, at 2k, 8k and 32k tokens; the 2k pulls were forced below the default threshold, as a diagnostic): the hand-off differs from the Mac alone at 8, 2, 0, 1, 1 and 1 positions, the GB10 alone from the Mac at 8, 3, 0, 1, 2 and 1, and the hand-off from the GB10 alone at 8, 1, 0, 2, 1 and 0. At every one the winning top-1/top-2 gap is at most 0.25 raw logit, and some are exact ties; every position with its margins is in the receipt. The same prompt pulled twice gave identical state bytes and tokens, and a served pull equalled an import of the same state from a file, for all six.Checklist
--prefill-fromrefuses--drafter."draft": false, a resumed prompt equals a fresh one, and concurrent equals solo: with the flags off at this head, resumed equals fresh (72 of 72 rows, all four verdicts) and concurrent equals solo (180 comparisons on the GB10, 120 on the Mac); the"draft": falsecheck was last run on an earlier head and not repeated here; not on a pulled prefix (above).Known gaps: the trigger and the link carry no encryption (the API key travels in clear), so keep both machines on a private network; replies on a pulled prefix are not bit-exact with the Mac's own (above).