Skip to content

Paper: fold the certified int8 head (#45) into the main text - #160

Merged
SamMausberg merged 3 commits into
mainfrom
paper/certified-head-fold
Oct 1, 2026
Merged

SamMausberg merged 3 commits into
mainfrom
paper/certified-head-fold

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Folds the certified int8 LM head (#45, evidence in evidence/certified_head) into the main text. #154 already added the evidence register entries under the old pending keys; this PR swaps every main-text \pend{kernel-*} for its \ev{kernel-*} and deletes the six pending entries that are now resolved (own commit). kernel-seeded-engine (acceptance in the engine, which needs #52) and kernel-union stay pending. #142 (evidence/triton_tma) has since merged and is cited for the named violation, with triton-lang/triton#9433 (see below).

What changes

Table 1 (numerical assumptions), status column

  • Stock accumulation error. Still assumed: the BF16-output kernel the engine runs hides its accumulator. The table now adds that the assumption is consistent with the FP32-output kernel's observed error, 58× inside the Hopper model (stock_invariance.json), and that the implementation adds a $2^{-100}$ absolute floor, larger than the paper's η ($2^{-113}$; bounds.py, ABS_FLOOR).
  • Row invariance. Measured bitwise on this build at 20 batch sizes from 1 to 256, and re-checked at start-up (stock_invariance.json). §2.3's row-wise fallback caveat now says the same.
  • Low-precision kernel computes the modelled arithmetic. Still required and not proved, but now checked for each compiled variant, by a self-test before it certifies and by runtime probes on every call. The table names the measured violation: under Triton 3.7.1, int8 TMA tiles with a 64-byte inner box gave wrong raw products, and such tiles are now refused (kernel-tma: tma_repro.json, tma_candidates.json, tma_m128_*).
  • Re-scoring. The table now says "Implemented and tested". The FP64 refine kernel matches the design in §4.5.
  • Seeded noise. The chain's rounding is bounded with CUDA's documented expf and logf accuracy, and the certified sampler with its fallback matches SGLang's seeded sampler on 60,000 replayed rows at T = 0.7 and 1 (replay_decisions.json).

Abstract and contributions

  • Contribution 2 names the TMA violation.
  • The abstract and contribution 3 replace "runtime pending" with the head-only result: about 0.7 of the stock head's time up to 16 rows, slower from 128.

§4.5 and the register: the Triton evidence (#142, added at 2f7c528). §4.5 now says why the 64-byte int8 TMA tiles stay refused. Under Triton 3.7.1 they gave wrong raw products. Of the seven builds #142 tested, the four without both Triton ≥ 3.8.0 and ptxas ≥ 13.3 did, and the three with both did not. That version pattern matches the closed issue triton-lang/triton#9433; the README's attribution rests on the pattern alone, and the text says "matches", not "is".

A new register entry, triton-tma, sits right after kernel-tma (agreed with the appendix editor). Its files are evidence/triton_tma/int8_tma_summary.json, cases/ and README.md, generated by experiments/triton_tma/. The issue is named in the text, not cited, so references.bib and sources/ are unchanged. To pay for the extra line, §4.5 drops a parenthetical on how compaction keeps whole tiles.

§4.3. Seeded agreement on 60,000 replayed rows. Acceptance in the engine stays \pend{kernel-seeded-engine}.

§4.4: reconciling #45's fallback rates with the held-out ones

  • On the first 60,000 capture rows (all splits), replayed at each engine step's own shape, the GPU kernel leaves 0.28% (Hopper model) and 1.46% (conservative) to the stock kernel. The held-out 6,005 rows give 0.35% and 1.40%. With the fallback, every token equals the engine's.
  • On batches of 128 consecutive rows the kernel's measured fallback shares are 27% and 77%. That is below the 30% and 85% that independent rows would give at its own rates (derived: $1-(1-166/60000)^{128}$ and $1-(1-878/60000)^{128}$).

§4.5. The pipeline is described as implemented, with the self-test, runtime probes and refused tiles. Then the microbenchmark (head_path_time.csv; CUDA graphs, warm L2, real decode rows, probes on):

  • 239.6 µs on a decided batch at M = 1, against 370.5 µs for the stock head and argmax.
  • With the column fallback's expected cost, 0.67–0.70 of the stock time up to 16 rows, 0.81 at 32 and 0.93 at 64 under the conservative model.
  • Every mode loses from 128, where the int8 pass alone is slower than the stock chain (head_primitives.json).
  • These are head-only times. The served effect is \pend{bench-cert}.

§7.

  • The error-model paragraph gives the measured FP32-output kernel error and says the BF16-output kernel's accumulator is not observable.
  • The open-question sentence now says what the microbenchmark settles: ahead up to 64 rows with the row-wise fallback, behind from 128. The served frontiers decide the rest.

Figure 3 has three panels.

  • (c), new. Time per call over the stock head and argmax, read from head_path_time.csv. It shows four W8A16 cases: a decided batch, the whole-batch fallback under each model, and the column fallback under the conservative model.
  • (b). The GPU kernel's measured per-M batch fallback rates (batch_fallback_rate, hopper_batch_fallback_rate) replace the single capture-step markers. Its lines stay the derived independence curves.
  • Styling. Colours follow (b): conservative is green, Hopper ink, the int8 pass blue.

Cuts (page budget)

  • Two tables move to Appendix A.7 (app:candidates), unchanged, agreed with the appendix editor: the candidate-rows table (tab:candidates) and the fallback-share table (tab:rstock). Figure 3a plots the same CCDFs, and §4.4's text keeps the headline numbers. Every reference to both tables stays valid, including the register's.
  • §4.5 drops the gather-size sentence, which the measured runtime supersedes.
  • Figures 3 and 4 are slightly shorter.
  • §7's open-question sentence is shorter.

Self-review

Every number is recomputed from the committed files, not copied from notes:

  • Column-fallback ratios: 249.3/370.5 to 271.5/395.1 gives 0.67–0.70; 331.8/411.6 gives 0.81; 420.5/451.6 gives 0.93.
  • Fallback shares: 878 and 166 of 60,000; 0.7735 and 0.2735 at M = 128.
  • Kernel error: 58× (README and stock_invariance.json).
  • Floor and probes: $2^{-100}$ (bounds.py); eight probe rows (head.py).
  • Scope is stated next to each number: head-only microbenchmark, not served; the conservative model for the ratios; the capture's first 60,000 rows against the held-out 6,005.

Build

Local build of 2f7c528, rebased on main 3528dfc after #142 (cores 40–47 under an untimed hold): latexmk -pdf gives 85 pages and 0 warnings. The main text ends on page 10, and References start at the top of page 11. scripts/check_paper_references.py is clean, including register paths at origin/main. codespell is clean on the changed files. The PR changes sources only; there is no paper/paper.pdf in the diff.

@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:51:37.463097Z 2f7c528 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.

#45's evidence (evidence/certified_head) resolves most of the pending kernel entries.

- Table 1 statuses:
  - The stock-error row is still assumed, now consistent with the FP32-output kernel's
    observed error, 58 times inside the Hopper model, and with the implemented 2^-100 floor.
  - Row invariance is measured at 20 batch sizes and re-checked at start-up.
  - The low-precision kernel is still not proved, but is checked per compiled variant at
    start-up and by runtime probes. The measured violation is named: int8 TMA tiles with a
    64-byte box gave wrong raw products under Triton 3.7.1 and are refused.
  - Re-scoring is implemented and tested.
  - The seeded chain's rounding is bounded by CUDA's documented expf and logf accuracy and
    matched on 60,000 replayed rows.
- Abstract and contributions: the TMA violation in contribution 2; the head-path runtime,
  timed alone, in place of "pending" (about 0.7 of the stock head's time up to 16 rows,
  slower from 128).
- Section 4.3: seeded agreement on 60,000 replayed rows; acceptance in the engine stays
  pending (kernel-seeded-engine).
- Section 4.4, reconciled with the held-out rates: the GPU kernel leaves 0.28% and 1.46% of
  the first 60,000 capture rows to the stock kernel (held-out: 0.35% and 1.40%), and with
  the fallback every token equals the engine's. On batches of 128 consecutive rows its
  measured fallback shares (27% and 77%) fall below what independent rows at its own rates
  give (30% and 85%).
- Section 4.5: the pipeline as implemented (self-test, runtime probes, refused tiles), then
  the microbenchmark. 239.6 against 370.5 us at M = 1. With the column fallback's expected
  cost the path takes 0.67-0.70 of the stock time up to 16 rows, 0.81 at 32 and 0.93 at
  64 (conservative model). Every mode loses from 128, where the int8 pass alone is slower
  than the stock chain. Head-only times; the served effect is pending.
- Discussion: the measured error, and the open question narrowed by the microbenchmark.
- Figure 3 gains panel (c), time per call over the stock head from head_path_time.csv. In
  (b), the kernel's measured per-M batch fallback rates replace the single capture-step
  markers.

Cuts to stay within ten pages:
- The candidate table and the fallback-share table move unchanged into Appendix A.3
  (agreed with the appendix editor). Figure 3 and Section 4.4's text keep their headline
  numbers.
- Section 4.5 loses the gather-size sentence.
- Figures 3 and 4 are slightly shorter.
#154 added evidence entries for the certified head under the same keys and kept these
devitems (kernel-impl, -error, -invariance, -rowwise, -path, -seeded) while the main text
still cited them as pending. The previous commit swaps every one of those markers to the
evidence entry, so the devitems go. kernel-seeded-engine and kernel-union stay pending.
#142 (evidence/triton_tma) tested the certified head's int8 TMA kernel on seven Triton and
ptxas builds: the four without both Triton >= 3.8.0 and ptxas >= 13.3 gave wrong products,
the three with both did not, a version pattern that matches the closed issue
triton-lang/triton#9433 (the README's attribution rests on that pattern alone). Section 4.5
now says so with a new register entry, triton-tma, added after kernel-tma with the appendix
editor's agreement; the issue is named in text, not cited, so references.bib is unchanged.
To keep the page budget, Section 4.5 drops a parenthetical on how compaction keeps whole
tiles.
@SamMausberg
SamMausberg force-pushed the paper/certified-head-fold branch from bd3b1fe to 2f7c528 Compare October 1, 2026 19:49
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 2f7c52873a

ℹ️ 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 (2f7c528)

Every number the fold adds traces to committed evidence:

  • Replay (evidence/certified_head/replay_decisions.json): 166 and 878 of 60,000 rows undecided, so 0.28% and 1.46%; with_fallback_eq_reference 60,000 under both models; bf16_ref_eq_engine 60,000.
  • Batches of 128 (head_path_time.csv): 27% and 77% need a fallback, against 1 - (1 - p)^128 = 30% and 85% at the kernel's own rates.
  • Head path (head_path_table.md):
    • 239.6 against 370.5 µs at M = 1;
    • with the column fallback (conservative) 0.673-0.696 of stock up to M = 16, 0.806 at 32 and 0.931 at 64;
    • every mode slower at 128 and 256, where the W8A16 pass alone is slower (676.3 against 562.2).
  • Error, invariance and implementation.
    • The FP32-output error is 57.6 times inside the Hopper model, and the invariance holds at 20 sizes.
    • The implemented floor is 2^-100 (kernels.py:723-725), and PROBES = 8.
    • expf (2 ulp) and logf (1 ulp) are as the evidence README states.
    • The micro conditions are as stated: CUDA graphs, warm L2, real rows, probes on.
  • Triton (evidence/triton_tma/README.md): of 7 builds, the 4 without both Triton >= 3.8.0 and ptxas >= 13.3 gave wrong head products and the 3 with both did not. The attribution to RAW hazard with pipelined wgmma and LHS in register triton-lang/triton#9433 is stated as a version pattern.
  • Moves and deletions.
    • Tables tab:candidates and tab:rstock move to Appendix A.7 unchanged.
    • No \pend still names one of the six deleted devitems.
    • Figure 3(b)'s markers and 3(c) read head_path_time.csv, and the captions say which values are derived and which measured.
  • Build. My build of 2f7c528 with latexmk -g has 0 LaTeX warnings, 0 overfull boxes and 85 pages, with References on page 11. check_paper_references.py reports no differences.
  • Checks. Pre-commit from main is clean, Codex found no issues on this head, and there is no hostname or AI attribution.

Optional. The rewrite of the pipeline paragraph in head.tex drops "On capture steps with 5 to 16 held-out rows the 128-group candidates cover 9.5--12.5 distinct head rows, so the gather reads tens of kilobytes beside a 636~MB int8 pass" and "(all rows of a tile whose remaining bound reaches it)". These numbers now appear nowhere in the paper. If the cut is deliberate, fine. The sentence is the only place that sizes the row-wise fallback's gather, so the editorial pass may want it in the appendix.

@SamMausberg
SamMausberg merged commit 6c445f3 into main Oct 1, 2026
SamMausberg added a commit that referenced this pull request Oct 1, 2026
The editor shortens Table 1, Table 2, Section 3's accumulation lemma, the kernel
checks, Section 2.5 and Figure 5 in the main text; their full versions land here
in the same milestone as those cuts:

- A.1: the full numerical-assumptions table, verbatim, as tab:assumptions-full;
- A.3: the statement of Lemma lem:tree before its proof, the sentence on what the
  tree's shape distinguishes, and that the conservative model covers the Hopper
  model's gamma about sixfold;
- A.8: the outlier-column, PCA and centring results (selfevidence-csv, stats) and
  the gather-size sentence that #160 dropped, traced to selfevidence_plain4b.json's
  batch unions (9.45 and 12.51 entries on steps with 5-8 and 9-16 positions);
- A.9 (new, app:kernel-checks): the per-variant self-test, runtime probes and
  tests, the measured int8 TMA violation and the seven-build version pattern that
  matches triton-lang/triton#9433 (kernel-impl, kernel-tma, triton-tma);
- C.5: the capture prompts' datasets and domains from prompt_manifest.csv;
- C.7: the full transport table, verbatim, as tab:transport-full;
- E.8: Figure fig:frontier with its detail (four of nine arms, 3.45x per-request
  rate, 0.98x and 0.86x, run-to-run variation), and the divergence-given-
  perturbation result of #162 with its intervals and exceptions, cited through
  a new register entry state-perturb.

The app-scope glossary terms "Capture and replay", "Certified row" and
"Enclosure" go: the main-text block now defines them.

Built alone, the branch shows lem:tree and fig:frontier defined twice; the
editor's cuts remove the main-text copies in the same push. Checker clean.
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