Skip to content

Appendix E: backbone switches served, exact up to rounding; 3.4% at c = 1 on tuned plain decoding (#153) - #157

Merged
SamMausberg merged 2 commits into
mainfrom
paper/appendix-bbserved
Oct 1, 2026
Merged

SamMausberg merged 2 commits into
mainfrom
paper/appendix-bbserved

Conversation

@SamMausberg

Copy link
Copy Markdown
Owner

Folds #153 (evidence/backbone/README.md, section "Served results", and evidence/backbone/served/) into Appendix E. This resolves most of backbone-served. Source-only. The items come from the backbone agent; I checked each against the merged README and recomputed the throughput ratios from served/plain_v1/points.csv.

Appendix E, "Backbone GEMMs and RMSNorm"

Exactness. Each switch was compared with stock plain decoding on the 320 divergence prompts (256 greedy tokens, top-5 logprobs, prefix cache on).

  • With every switch off, and with the packed GDN input projection alone, all 320 prompts give the same output tokens and the same top-5 logprob arrays as stock at c = 1. That is checked on the raw runs by bitwise_runs.py. For the packed projection this covers prefill only, because decode at c = 1 stays below its 64-row cutoff.
  • SGLang's Hopper GEMV backend diverges at 3.75 per 1,000 tokens: 164 ties, 8 one-step, 2 near, 0 large. The floor it is set against is 3.42 at a cap of 16.
  • The routing table, with pools pinned at a cap of 8, diverges at 3.40 at c = 1 and 3.82 at c = 32. That is five to six times the 0.63 floor at that cap.
  • Both are exact up to rounding, and no run committed a token that was not its own top-1.

Paired serving on tuned plain decoding. One session, order B A A B, routing table against the same engine with every switch off.

c B/A, per pair Decode step Predicted saving
1 1.035 and 1.034 116 µs shorter 197 µs bound from the microbenchmarks
8 1.004 in both 10 µs shorter 90-98 µs; the gap is not traced, and the text gives no reason for it
32 1.003 and 1.001 within the 0.11% spread of the two A runs, so no claim
128 1.010 in both 86 µs shorter 81 µs; only the packed projection acts here

These are two pairs from one session, and the text says so.

Folding. Two further variants, the single-pass norm prologue and the SiLU fold alone, take 103-257 µs per layer from M = 2 to 16, against 31-52 µs for the stock and Triton layers. At M = 1 only the SiLU fold ties. The same sentence is added under "What did not work".

Levers table, H6 row and register

  • Levers table, backbone row. The class becomes "exact up to rounding (packed projection alone: identical outputs at c = 1)". The status now gives the served result: 3.4% faster at c = 1, 0.4% at 8 and 1.0% at 128. Serving against tuned MTP remains pending.
  • H6 row. It now gives the served result: 3.4% faster at c = 1 and 1.0% at 128, exact up to rounding, one session.
  • backbone-served is narrowed to the two things still pending: paired serving against tuned MTP, and a trace of the GEMM kernels the served engine runs.
  • backbone evitem. Its files gain chain_fold_variants_microbench.json, gpu_tests_hold2.log and served/. Its producers gain bitwise_runs.py, experiments/state_safety/compare.py and bench/pareto.py.

Checks

  • Local build (cores 48-55, untimed-exclusive rule): 0 warnings, 82 pages, main text ending on p10, References on p11. Table 21 still fits its float page.
  • scripts/check_paper_references.py is clean.
  • Self-review: every ratio to a floor names its cap. The serving numbers are labelled as one session with two pairs. The c = 8 shortfall is left unexplained, as in the README.
  • The host-identity hook passes.

… = 1 on tuned plain decoding (#153)

From evidence/backbone/README.md "Served results" and served/ (#153):
- Exactness on the 320 divergence prompts: every switch off and the packed
  GDN input projection give identical tokens and top-5 logprob arrays at
  c = 1 (packed projection: prefill only); the Hopper GEMV backend 3.75/1K
  against the 3.42 floor at cap 16; the routing table, pools pinned at cap
  8, 3.40 and 3.82/1K against 0.63 at cap 8; all rounding-level.
- Paired serving on tuned plain decoding, one session B A A B: 1.035/1.034
  at c = 1 (step -116 us against the 197 us bound), 1.004 at 8 (-10 us
  against 90-98 predicted, untraced), no claim at 32, 1.010 at 128 (-86 us
  against 81 predicted for the packed projection).
- Folding variants (single-pass norm, SiLU-only) also lose from M = 2 to 16.
Levers table class becomes exact up to rounding; H6 row cites the served
result; backbone-served narrows to serving against tuned MTP and a trace of
the served engine's GEMM kernels; the backbone evitem gains served/, the
fold variants, the hold-2 GPU tests and their scripts.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T19:36:06.554770Z cdc731f Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: REQUEST CHANGES (af624a7; 2 blocking, both one-word fixes. The build of this head is queued in the CPU window, because a timed exclusive hold is running.)

Blocking

  1. c = 32: "within the 0.11% spread" is not right. The pair ratios are 6,253.2/6,236.2 = 1.0027 and 6,237.7/6,229.3 = 1.0013. Both gains, 0.27% and 0.13%, exceed the 0.11% A1-A2 spread. "No claim" is still the right call, but write "about the 0.11% spread", as evidence/backbone/README.md does, or give the two gains beside the spread.
  2. "against 31 to 52 µs for the stock and Triton layers" should be 32 to 52. From M = 2 to 16 the lowest stock or Triton layer is GDN Triton + PDL at M = 2, 31.88 µs. 31 is M = 1's 30.77, which the sentence excludes. The variants' 103 to 257 µs is right (SiLU fold 102.58 at M = 16; both folded 257.14 at M = 2).

Checked against evidence/backbone/README.md (#153)

  • Exactness.
    • Off and merge are 320/320 on token ids and top-5 arrays at c = 1, and merge covers prefill only (decode stays below the 64-row cutoff).
    • Gemv diverges at 3.75 per 1,000 (164/8/2/0) against the 3.42 floor at cap 16.
    • Lever v1 with pinned pools diverges at 3.40 and 3.82 against 0.63 at cap 8.
    • No run committed a token that was not its own top-1.
    • The setup matches: 256 new tokens, top-5, radix cache on, the routing table as make_table.py --gemv-m1 --pdl --max-m 16 plus the packed projection.
  • Serving.
    • The order is B A A B, with A running the same engine with every switch off.
    • c = 1: 1.035 and 1.034, and the step is 116 µs shorter against the 197 µs bound.
    • c = 8: 1.004 in both pairs, -10 µs against 90 to 98 µs predicted, with the reason untraced.
    • c = 128: 1.010 in both pairs, -86 µs against 81 µs.
    • "Two pairs from one session" is stated.
  • Folding variants. At M = 1 only the SiLU fold ties (46.98 against 46.81 Triton), and "no folding variant pays" matches the README.
  • Status, levers and register. The H6 row, the levers row (3.4%, 0.4% and 1.0%), the class in tab:axes and the narrowed backbone-served item (MTP serving and the in-situ GEMM trace) agree with the README's Pending list. Every file the evitem cites exists on main.
  • No hostname and no AI attribution.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af624a73ca

ℹ️ 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".

Concurrency and state & One state slot per request (lifts the 133-request cap) & exact & \pend{bench-capacity}\\
& FP16 state; replayed decoding; rounding-preserving replay (P4) & lossy, exact up to rounding, exact & FP16: $1.24\times$ at $c=128$ (single run, quality pending); replayed decoding: $1.08\times$ at $c=128$ on the confirmation split in one session~\ev{bench-frontier}, outputs rounding-level~\ev{bench-equality}, more sessions \pend{bench-replayssm}; P4: kernel $1.22\times$ at $B=128$, derived about $1.08\times$ per decode step~\ev{p4-replay}; served test \pend{moonshot-p4}\\
Backbone GEMMs and norms & Kernel routing per projection and $M$ (Hopper GEMV, Triton with programmatic dependent launch, cuBLASLt); packed GDN input projection; norm and SiLU folded into the GEMM & pending & Isolated microbenchmarks, best kernel per call up to $M=16$: 0.77--0.92 of cuBLAS's time on the output projections, 0.91--1.00 on the other large ones; packed projection bitwise equal per GEMM; folding 12--90~\textmu s per layer slower up to $M=32$, more above~\ev{backbone}; served \pend{backbone-served}\\
Backbone GEMMs and norms & Kernel routing per projection and $M$ (Hopper GEMV, Triton with programmatic dependent launch, cuBLASLt); packed GDN input projection; norm and SiLU folded into the GEMM & exact up to rounding (packed projection alone: identical outputs at $c=1$) & Isolated microbenchmarks, best kernel per call up to $M=16$: 0.77--0.92 of cuBLAS's time on the output projections, 0.91--1.00 on the other large ones; no folding variant pays; served on tuned plain decoding, one session: 3.4\% faster at $c=1$, 0.4\% at 8, 1.0\% at 128~\ev{backbone}; against tuned MTP \pend{backbone-served}\\

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep unserved backbone variants pending

This class applies to every lever named in the row, but the committed exactness pairs only exercise merge, GEMV, and lever_v1; that routing table uses GEMV, Triton, and merge, not cuBLASLt or either SGLANG_BACKBONE_FUSE_* path. In particular, the evidence README says the scaled norm prologue changes operand rounding, so its served exactness cannot be inferred from the tested routing table. Readers could therefore admit the untested cuBLASLt and norm/SiLU-folding variants into the exact stack; split this row or retain pending for variants absent from the exactness runs.

Useful? React with 👍 / 👎.

… = 2

Reviewer on #157: the c = 32 pair gains (0.27% and 0.13%) are about, not
within, the 0.11% spread of the A runs; the stock and Triton layers' range
from M = 2 to 16 starts at 31.88 us.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af624a73ca

ℹ️ 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".

Concurrency and state & One state slot per request (lifts the 133-request cap) & exact & \pend{bench-capacity}\\
& FP16 state; replayed decoding; rounding-preserving replay (P4) & lossy, exact up to rounding, exact & FP16: $1.24\times$ at $c=128$ (single run, quality pending); replayed decoding: $1.08\times$ at $c=128$ on the confirmation split in one session~\ev{bench-frontier}, outputs rounding-level~\ev{bench-equality}, more sessions \pend{bench-replayssm}; P4: kernel $1.22\times$ at $B=128$, derived about $1.08\times$ per decode step~\ev{p4-replay}; served test \pend{moonshot-p4}\\
Backbone GEMMs and norms & Kernel routing per projection and $M$ (Hopper GEMV, Triton with programmatic dependent launch, cuBLASLt); packed GDN input projection; norm and SiLU folded into the GEMM & pending & Isolated microbenchmarks, best kernel per call up to $M=16$: 0.77--0.92 of cuBLAS's time on the output projections, 0.91--1.00 on the other large ones; packed projection bitwise equal per GEMM; folding 12--90~\textmu s per layer slower up to $M=32$, more above~\ev{backbone}; served \pend{backbone-served}\\
Backbone GEMMs and norms & Kernel routing per projection and $M$ (Hopper GEMV, Triton with programmatic dependent launch, cuBLASLt); packed GDN input projection; norm and SiLU folded into the GEMM & exact up to rounding (packed projection alone: identical outputs at $c=1$) & Isolated microbenchmarks, best kernel per call up to $M=16$: 0.77--0.92 of cuBLAS's time on the output projections, 0.91--1.00 on the other large ones; no folding variant pays; served on tuned plain decoding, one session: 3.4\% faster at $c=1$, 0.4\% at 8, 1.0\% at 128~\ev{backbone}; against tuned MTP \pend{backbone-served}\\

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude untested folds from the exactness class

This class applies to the whole row, including the norm and SiLU folds, but the exactness matrix in evidence/backbone/README.md only exercises off, merge, gemv, and lever v1; lever v1 enables routing/PDL/merge, not SGLANG_BACKBONE_FUSE_NORM or SGLANG_BACKBONE_FUSE_ACT. The scaled norm evidence even notes that it rounds differently from stock, so there is no served-output comparison supporting “exact up to rounding” for these switches. Narrow the class to routing/merge or leave the folding switches pending.

Useful? React with 👍 / 👎.

Comment thread paper/sections/app_stack.tex Outdated
\paragraph{Backbone GEMMs and RMSNorm} The weight GEMMs' time above the head GEMM's bandwidth and the 65 RMSNorm launches are the fourth and seventh rows of Table~\ref{tab:profile-ranked}. Isolated microbenchmarks under CUDA graphs locate the slow GEMMs and test faster kernels that read the same BF16 weights~\ev{backbone}. Each timed call multiplies every layer's own checkpoint weight by its own input, so the weights stream from HBM as in the model; times are medians of 30 timings of 10 graph replays each, in one exclusive session, include any split-$K$ reduction and the gap to the next kernel, and are compared only within these files. The three projections with 2,560 outputs, the GDN and attention output projections and the MLP down-projection, run as split-$K$ kernels followed by a reduction kernel up to $M=32$ (128 for the down-projection) and reach 49\% (output projections) and 68\% (down-projection) of the measured 3.79~TB/s read bandwidth~\ev{profile-bw} at $M=1$, against 80--87\% for the large projections; disabling cuBLAS's reduced-precision reduction changes neither their time nor any output bit. At $M=1$ SGLang's own Hopper GEMV is the fastest kernel for every projection: it takes 0.77 of cuBLAS's time on the output projections (8.57 against 11.20~\textmu s per call for the GDN one), 0.91 on the down-projection, 0.95--0.97 on the other large projections and 0.51 on the 64-row GDN projection, which cuBLAS runs on a single block. At the pin it is unreachable: \code{-{}-bf16-gemm-backend gemv} loads it, but the unquantized linear layers call the dispatcher only for another backend (code reading; patch \path{engine/sglang/patches/backbone/0001} lets them reach it). At $M=2$--16 a Triton skinny GEMM pays only with programmatic dependent launch, at 0.88--0.92 of cuBLAS's time on the output projections and 0.96--0.99 on the GDN input and MLP projections, with no gain on the attention QKV projection; in this benchmark each call overlaps its successor, which in the model is a different kernel. From $M=64$ cuBLAS, or a cuBLASLt algorithm within 2--5\% of it, is best, except on the down-projection, where PyTorch's cuBLASLt choice takes 0.92 of the time. None of these routes leaves the target's arithmetic unchanged in general: the GEMV and the Triton kernel are bitwise equal to cuBLAS on 99.6 to 100\% of output elements, and the cuBLASLt choice differs from it on the down-projection from $M=16$, while all arms lie within the same distance of a float64 product. If every projection ran at its best isolated time, a plain step's backbone GEMMs would take 197~\textmu s less at $M=1$, at most 5.7\% of the 3,460~\textmu s step, and 92 to 120~\textmu s less at $M=2$--16 (derived from the microbenchmarks, not a served result).

SGLang's packed GDN input projection, one GEMM over the concatenated $12{,}352\times2{,}560$ weight instead of a $12{,}288$-row and a 64-row GEMM, gives every output element bitwise equal to the separate pair's at each tested $M$, the powers of two from 1 to 1,024, with the real weights of all 24 GDN layers and random BF16 inputs, under cuBLAS 13.1 on this GPU~\ev{backbone}. That is a statement about one isolated GEMM, not about served tokens. Against the stock pair, which runs the 64-row GEMM on a side stream, it is as fast up to $M=16$, 3\% slower at 32 and 5 to 13\% faster from 64. The stock fused add-RMSNorm takes 1.47~\textmu s per launch at $M=1$ and 2.0 to 2.2~\textmu s at $M=4$--32 inside a graph of 64 norms. Folding the norm and the SiLU into the next GEMM's prologue reproduces the stock norm bit for bit up to $M=32$ (one element in $10^5$ is one BF16 step away at $M=64$ and 128) and the stock SiLU bit for bit, but as built it makes each layer slower in MLP and GDN layer skeletons, by 12 to 90~\textmu s up to $M=32$, with or without programmatic dependent launch, and by 82 to 543~\textmu s at $M=64$ and 128, far more than the two launches of about 1.5 to 2~\textmu s that it removes. In the same skeletons the Triton kernel with programmatic dependent launch saves 1.2 to 2.3~\textmu s per MLP layer and 1.4 to 1.8~\textmu s per GDN layer up to $M=16$, except the GDN layer at $M=4$, and loses at 32. The engine patches that route each projection by a table are committed and off by default; the exactness class of each switch, from greedy outputs against stock plain decoding compared with the noise floor, and paired serving runs against the tuned arms are \pend{backbone-served}.
SGLang's packed GDN input projection, one GEMM over the concatenated $12{,}352\times2{,}560$ weight instead of a $12{,}288$-row and a 64-row GEMM, gives every output element bitwise equal to the separate pair's at each tested $M$, the powers of two from 1 to 1,024, with the real weights of all 24 GDN layers and random BF16 inputs, under cuBLAS 13.1 on this GPU~\ev{backbone}. That is a statement about one isolated GEMM, not about served tokens. Against the stock pair, which runs the 64-row GEMM on a side stream, it is as fast up to $M=16$, 3\% slower at 32 and 5 to 13\% faster from 64. The stock fused add-RMSNorm takes 1.47~\textmu s per launch at $M=1$ and 2.0 to 2.2~\textmu s at $M=4$--32 inside a graph of 64 norms. Folding the norm and the SiLU into the next GEMM's prologue reproduces the stock norm bit for bit up to $M=32$ (one element in $10^5$ is one BF16 step away at $M=64$ and 128) and the stock SiLU bit for bit, but as built it makes each layer slower in MLP and GDN layer skeletons, by 12 to 90~\textmu s up to $M=32$, with or without programmatic dependent launch, and by 82 to 543~\textmu s at $M=64$ and 128, far more than the two launches of about 1.5 to 2~\textmu s that it removes. Two further variants, a single-pass norm prologue that scales the product and the SiLU fold alone, also lose: from $M=2$ to 16 they take 103 to 257~\textmu s per layer against 31 to 52~\textmu s for the stock and Triton layers, and at $M=1$ only the SiLU fold ties. In the same skeletons the Triton kernel with programmatic dependent launch saves 1.2 to 2.3~\textmu s per MLP layer and 1.4 to 1.8~\textmu s per GDN layer up to $M=16$, except the GDN layer at $M=4$, and loses at 32. The engine patches that route each projection by a table are committed and off by default. Served, each switch was compared with stock plain decoding on the 320 divergence prompts (256 greedy tokens, top-five log-probabilities, prefix cache on)~\ev{backbone}. With every switch off, and with the packed GDN input projection alone, all 320 prompts return the same output tokens and the same top-five log-probability arrays as stock at concurrency 1; for the packed projection that covers prefill only, since decode at concurrency 1 stays below its 64-row cutoff. SGLang's Hopper GEMV backend diverges at 3.75 per 1,000 compared tokens (164 ties, 8 one-step and 2 near events, none large), against the 3.42 floor at a cap of 16, and the routing table (the Hopper GEMV at $M=1$, the Triton kernel with programmatic dependent launch at $M=2$--16, the packed projection from 64 rows), with pools pinned at a cap of 8, diverges at 3.40 at concurrency 1 and 3.82 at 32, five to six times the 0.63 floor at that cap. Both are exact up to rounding, and no run committed a token that was not its own top-1. In one session of paired serving on tuned plain decoding (order B A A B, the routing table against the same engine with every switch off), the routing table delivered 1.035 and 1.034 times the throughput at concurrency 1, a decode step 116~\textmu s shorter against the 197~\textmu s the microbenchmarks bound; 1.004 in both pairs at concurrency 8, where the decode step is 10~\textmu s shorter against 90 to 98~\textmu s predicted, for a reason not yet traced; 1.003 and 1.001 at 32, within the 0.11\% spread of the two baseline runs, so no claim; and 1.010 in both pairs at 128, where only the packed projection acts and the step is 86~\textmu s shorter against 81 predicted. These are two pairs from one session; serving against tuned MTP and a trace of the GEMM kernels the served engine runs are \pend{backbone-served}.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid calling the c=32 gain within the baseline spread

At concurrency 32, the committed paired results report B/A ratios of 1.0027 and 1.0013 while the two baseline runs differ by 0.11%; the first observed gain is therefore 0.27%, not within that spread. The decision to make no claim may still be conservative, but this stated justification contradicts served/plain_v1/pairs.csv and should instead describe the ratios as merely comparable to the spread or provide another reason.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: cdc731f941

ℹ️ 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".

@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (cdc731f)

The fix is right: c = 32 now reads "about" the 0.11% spread, and the M = 2 to 16 range starts at 32 µs. My build of cdc731f with latexmk -g has 0 LaTeX warnings, 0 overfull boxes and 82 pages, with References on page 11, and check_paper_references.py reports no differences. Pre-commit from 3daaf2e is clean, and Codex found no issues on this head.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant