Repository navigation
backbone: routing table against mtp-tuned-triton (hold 4): no material gain - #210
Conversation
Paired serving of the routing table against bench's low-concurrency MTP arm (Triton attention), B A A B at c = 1, 8 and 32 in one exclusive hold. B/A throughput 1.0006/1.0007 at c = 1 (0.06%, below the stock confirmation's 0.15% session spread), straddling 1 at c = 8 and 32: no material gain on either MTP arm. Adds served/mtp_triton_v1/ (bench.pareto output), the README section with the derived verify-cycle and TTFT observations, and the commands behind the files. Exactness under MTP remains unmeasured.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Verdict: APPROVE (head 632f4cc) No blocking items. Five optional items are listed at the end. I understand a streamed-text A/B comparison is being added at main's request; a new head voids this verdict, and I will review the delta when it lands. What I checkedRegeneration. Validity, from the raw files under
Ratios and spreads, recomputed from
Every value in the README table and the PR body matches. Acceptance repeats exactly within each arm at c = 1 and 8. B differs from A by +0.030% at c = 1 and +0.060% at c = 8. Derived numbers.
Framing. The c = 1 result is reported as measured (+0.06% in both pairs, above A's own spread) and then judged immaterial against the cross-session spread. That is the conservative direction. The single session is stated in the README, the body and the TASKS line. B's exactness class stays Other checks. Codex found no major issues on 632f4cc, and the PR has no inline threads. The hostname grep found nothing in the diff, the commit messages or the PR body. All three commits have author and committer Samuel Mausberg, with no attribution lines. Pre-commit applies only to Optional
|
Rebuilds every profiling request's greedy text from aiperf's raw export (reasoning_content and content deltas in arrival order), matches the requests of two bench.sweep runs by prompt id, and reports identical prompts per sweep point and where the first difference falls. This is streamed-text identity, not token ids or logprobs. A failed request, missing usage, repeated prompt or mismatched prompt set is an error and nothing is written. Two CPU tests cover the divergence position and the refusals.
text_identity.json (stream_text_identity.py at 47c7ccd): each arm reproduces its own streamed text at c = 1 and 8, while A and B differ on 7 of 64 prompts at c = 1 and 15 of 64 at c = 8, the same prompts in both sessions; c = 32 runs of one arm already differ. Streamed text only, so the exactness class stays pending. Reviewer items: cycle differences from the unrounded acceptance (5.3 and 10.9 us, 7-13% of the 81 us prediction), the served preamble names Triton attention for hold 4, acceptance moves "probably at near ties", A's 1.0 ms TTFT spread beside the gap, and "no material gain" in H6.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 43a1bc2134
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| s.reasoning += delta.get('reasoning_content') or '' | ||
| s.content += delta.get('content') or '' |
There was a problem hiding this comment.
Preserve delta arrival order when reconstructing text
When reasoning_content and content deltas interleave, accumulating them into separate buffers reorders the stream: for example, reasoning a, content c, reasoning b is reconstructed as abc rather than the emitted acb. Two requests with different arrival-ordered text can consequently compare as identical, contrary to the tool's stated semantics; retain a single ordered text buffer (while optionally tracking channels separately).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 1e7b6b3. The stream is now one buffer in arrival order, with a per-character channel map (r or c). A prompt counts as identical only when both the text and the channel map match, so reasoning a, content c, reasoning b rebuilds as acb, and the same text split differently between the channels also differs. Within a single delta, the fields keep the order they were sent in. Two new tests cover both cases (test_stream_text_identity_keeps_the_arrival_order_of_both_channels). For this evidence, the order could not have mattered: all 1,536 requests in the four runs streamed content deltas only (reasoning_content is always null or empty). The regenerated text_identity.json (6633b33, repo_commit 1e7b6b3) has the same counts and divergence positions as before.
| same = ( | ||
| sa.reasoning == sb.reasoning | ||
| and sa.content == sb.content | ||
| and sa.completion_tokens == sb.completion_tokens | ||
| ) |
There was a problem hiding this comment.
Compare text independently of completion-token counts
When two token sequences detokenize to the same streamed text but have different token counts, this condition marks them as differing solely because completion_tokens differs. That contradicts the documented text-only contract that such sequences count as identical and can inflate divergence counts in exactly the alternative-tokenization case this tool is intended to distinguish from token-id equality.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 1e7b6b3, in the code rather than the docstring. Identity is now text only (text plus channel map); completion-token counts no longer enter it. Prompts whose counts differ are listed separately in a new completion_tokens_differ field, and the docstring and the JSON's comparison field say so. A new test (test_stream_text_identity_reports_token_counts_outside_the_identity) checks that identical text with different counts is identical and listed. In this evidence every request has 512 completion tokens, so completion_tokens_differ is empty at every point and no count changed.
|
Verdict: REQUEST CHANGES (head 43a1bc2) This is a delta review of 632f4cc..43a1bc2. The new evidence and wording hold up. The only blocking item is that Codex's two new P2s on 43a1bc2 have no reply or fix. My pytest and pre-commit run on the changed files is waiting for the next CPU window (a timed hold is running), and I'll add the result here. What I checkedRegeneration. Independent recount. I reparsed the raw aiperf exports with my own parser, matched requests by
The first-difference statistics match the JSON in both sessions: at least 177 tokens and a median of 329 at c = 1, at least 1 and a median of 253 at c = 8. Consistency with acceptance. At c = 1 the 7 text-differing prompts are a subset of the 9 whose verify count differs. At c = 8 they are not a subset (15 against 19), so text can differ at an equal verify count. Within each arm, verify counts are identical at c = 1 and 8. Nothing in the README depends on this. Wording. Calling c = 32 uninformative is right, given the within-arm counts. "Class pending" is kept: the README says streamed text only, not token ids or logprobs, and leaves "rounding-level flips at near ties" to the logprob comparison against stock MTP. The causal claim is limited to c = 1, where the verify always runs 4 rows. All five of my earlier items are folded in correctly:
Blocking
Optional
|
Codex review on #210. Buffering reasoning_content and content separately reorders interleaved deltas (reasoning a, content c, reasoning b came back as abc); the stream is now one buffer in arrival order with a per-character channel map, and a prompt is identical when text and channels match. Completion token counts no longer enter the identity, as the docstring says; prompts whose counts differ are listed in completion_tokens_differ. Two tests cover the interleaved order, the channel split and the counts.
…changed; content deltas only)
|
@codex review |
|
Verdict: APPROVE (head 6633b33; provisional on Codex, which is running on this head) This is a delta review of 43a1bc2..6633b33. My only blocking items at 43a1bc2 were Codex's two P2s, and both are fixed in the code and answered (4166755912, 4166756159).
Everything I approved at 632f4cc and checked at 43a1bc2 still holds. This approval becomes final once Codex is clean on 6633b33. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Conflict in TASKS.md only, between adjacent rows: main (#210) changed H6 and this branch changed H7; both kept (H6 from main, H7 from this branch).
…easurements Several top-level documents still described merged work as pending, in review or not merged. Each statement below was rechecked against the committed evidence it now cites. - README.md: a short map of where the serving measurements are (harness and commands, the Pareto frontiers, Nsight profiles, quality checks, before and after, engine patches). The main results replace "Hopper model, whose justification is pending", "the certified-head kernels and their engine integration are still in review" and "the confirmation sweeps ... are not merged yet" with the results: the kernel replay and the served certified head (evidence/certified_head/, served/), the confirmed frontier and GSM8K (evidence/bench/). One new bullet gives the engine changes against the tuned arms with their conditions (hostgap, the DFlash fold, the composed stack, the two lossy levers), as the paper's Section 4.5 states them. The backbone bullet reports the mtp-tuned-triton pairs (#210) instead of "untested". - README.md attribution: shortened to what Sam asked for: AI tools (Claude Opus 5.5 and GPT-6 Astra Pro) were used in developing the paper and the code; Samuel Mausberg is the author and is responsible for its claims. - RUNBOOK.md: results enter the paper or the notes only after their pull requests merge (no "pending items"). - engine/sglang/README.md, moonshot 0007: "validation pending" becomes the kernel-level bit-exactness result and the served output probe, with its limit. - evidence/README.md: the citation column names the paper's current sections and register groups; "not cited yet" rows (certified_head, backbone, triton_tma, stack) now say what cites them; moonshot, repair and frontier are cited by the research notes only; new rows for hostgap/ and lossy/; bench/ and certified_head/ list confirm/, equality/, quality/ and served/. - experiments/README.md: rows for benchcert/, hostgap/ and lossy/.
…easurements Several top-level documents still described merged work as pending, in review or not merged. Each statement below was rechecked against the committed evidence it now cites. - README.md: a short map of where the serving measurements are (harness and commands, the Pareto frontiers, Nsight profiles, quality checks, before and after, engine patches). The main results replace "Hopper model, whose justification is pending", "the certified-head kernels and their engine integration are still in review" and "the confirmation sweeps ... are not merged yet" with the results: the kernel replay and the served certified head (evidence/certified_head/, served/), the confirmed frontier and GSM8K (evidence/bench/). One new bullet gives the engine changes against the tuned arms with their conditions (hostgap, the DFlash fold, the composed stack, the two lossy levers), as the paper's Section 4.5 states them. The backbone bullet reports the mtp-tuned-triton pairs (#210) instead of "untested". - README.md attribution: shortened to what Sam asked for: AI tools (Claude Opus 5.5 and GPT-6 Astra Pro) were used in developing the paper and the code; Samuel Mausberg is the author and is responsible for its claims. - RUNBOOK.md: results enter the paper or the notes only after their pull requests merge (no "pending items"). - engine/sglang/README.md, moonshot 0007: "validation pending" becomes the kernel-level bit-exactness result and the served output probe, with its limit. - evidence/README.md: the citation column names the paper's current sections and register groups; "not cited yet" rows (certified_head, backbone, triton_tma, stack) now say what cites them; moonshot, repair and frontier are cited by the research notes only; new rows for hostgap/ and lossy/; bench/ and certified_head/ list confirm/, equality/, quality/ and served/. - experiments/README.md: rows for benchcert/, hostgap/ and lossy/.
PR #166 measured the backbone routing table (lever v1: the Hopper GEMV at one row, the Triton kernel with PDL at 2-16 rows, cuBLAS otherwise, the packed GDN input projection from 64 rows) against
mtp-tuned, MTP with FlashInfer attention, and found no gain. Codex pointed out that bench's low-concurrency MTP arm ismtp-tuned-triton(532 against 456 tokens/s at c = 1), which #166 did not test, so #166 was scoped tomtp-tuned. Hold 4 ran the same paired design onmtp-tuned-triton. This PR adds its evidence, plus a small CPU tool that compares the two arms' streamed text.Result (measured, one session, two pairs)
Both arms ran the backbone engine (
59deb68e29, clean), with A switches off and B setting lever v1's four variables. The order was B A A B, sessions abba-1 (B1, A1) and abba-2 (A2, B2), on bench's mixed-v2 confirmation workload with 512 output tokens.experiments/backbone/stream_text_identity.py; streamed text only, not token ids or logprobs). At c = 1 and 8 each arm reproduces its own text on all 64 prompts across its two launches. A and B differ on 7 of 64 prompts at c = 1 and 15 of 64 at c = 8, the same prompts in both sessions. At c = 1 every first difference comes after at least 177 of 512 tokens (median 329). c = 32 is not informative, because two runs of the same arm already differ there (45 and 131 of 256).Derived and secondary observations (in the README)
accept_length / x_decode) drops from 5.786 to 5.778 ms, 5.3 and 10.9 us per pair (from the unrounded acceptance in each run'ssweep.json;points.csv's four decimals give 5.4 and 11.0). In isolation, the target verify's 88 routed GEMMs at 4 rows save 81 us (the in-situ section's method, which reproduces its 197 and 120 us). The served cycle keeps 7-13% of that, and none of it is traced.mtp-tunedpairs show +0.4 and +1.3 ms), while on plain decoding B's TTFT is shorter. It is about the gap between the decode-rate gain (+0.12% and +0.22%) and the throughput gain (+0.06%). The cause is not traced.Validity
53e39a3, engine59deb68e29(no uncommitted changes) and the table's SHA-256607479de…, the same table as Backbone: served exactness of each switch and paired plain serving of the routing table #153 and Backbone: routing table against tuned MTP, and which GEMM kernels the served engine runs #166.launches.csvrecords the same commits for each launch.osl_mismatchand 0 retractions.points.csvhas both.Files
evidence/backbone/served/mtp_triton_v1/{points,pairs,launches,frontier}.csvare thebench.paretooutput, with the same flags as Backbone: routing table against tuned MTP, and which GEMM kernels the served engine runs #166'smtp_v1/.text_identity.jsonis the output ofstream_text_identity.py, generated at 1e7b6b3 (the script's fixed commit) from a clean tree. Each file's command is in the README's hold 4 block.experiments/backbone/stream_text_identity.pywith two CPU tests intests/test_backbone_served_tools.py, and its row inexperiments/backbone/README.md.evidence/backbone/README.md: a new hold 4 section, an updated status line, served preamble and Pending list, and the hold 4 commands.evidence/README.md: the backbone row.TASKS.md: the H6 row, the backbone workstream row and the backbone task line.Checks:
pytest tests/test_backbone_served_tools.py: 10 passed. pre-commit passed on the script, tests,TASKS.mdand the experiments README; on the evidence files only the host-identity guard runs (the other hooks excludeevidence/), and it passed. Raw outputs stay in~/vp-data/backbone/e2e/mtp-triton-v1/.Review round 1 (reviewer 1 approved 632f4cc; Codex clean on 632f4cc)
Head 43a1bc2 folds in reviewer 1's optional items: cycle differences from the unrounded acceptance (5.3 and 10.9 us, 7-13%); the served preamble names Triton attention for hold 4; "moves acceptance at near ties" is now "probably at near ties; not traced"; A's 1.0 ms TTFT spread sits beside the B-A gap; and the H6 row in TASKS.md says "no material gain". The streamed-text comparison, which main requested, is new in 47c7ccd and 43a1bc2.
Review round 2 (reviewer 1 requested changes on 43a1bc2 for Codex's two P2s)
contentdeltas only, so order could not have mattered.completion_tokens_differ(empty everywhere here: all 512 tokens).text_identity.jsonat 1e7b6b3. Counts and divergence positions are unchanged.