Skip to content

Appendices: cite the certified-head kernel's evidence (#45) - #154

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

SamMausberg merged 2 commits into
mainfrom
paper/appendix-kernel

Conversation

@SamMausberg

Copy link
Copy Markdown
Owner

This PR folds #45 (evidence/certified_head on main) into the appendices and the register. It changes .tex files only, with no PDF. The author and I agreed the split: the author's main-text PR, stacked on #143, swaps the main text's \pend{kernel-*} markers to \ev{...} and then deletes the matching devitems. The key names stay the same, so those swaps need no other edits.

Register (G.1, G.3)

New group, "The certified head kernel", with nine evitems:

  • kernel-impl: src/certified_head/, the three test files, gpu_tests.log (145 passed), x8s2_compile.log (148 of 148 variants) and stress_defaults.json (0 misses in about a million row-checks per default tile).
  • kernel-tma: the int8 TMA faults in Triton 3.7.1, from tma_repro, tma_candidates, large_m_check, tma_m128_check and tma_m128_neighbourhood. Both fault families are refused. Triton int8 TMA fault: needs Triton >= 3.8.0 and ptxas >= 13.3 to go away (evidence/triton_tma) #142 is not cited.
  • kernel-error and kernel-invariance: stock_invariance.json.
  • kernel-replay: replay_decisions.json and fallback_vs_model.json.
  • kernel-rowwise and kernel-path: micro_head.json, head_path_time.csv and head_path_table.md.
  • kernel-micro: head_primitives.json, ncu_gemv_summary.json and pointer_vs_tma_*.json.
  • kernel-seeded: seeded rows in replay_decisions.json, the sampled path in micro_head.json, and the small-probability guard in head.py with its tests.

New pending items:

Removed: the kernel-replay and kernel-micro devitems, which nothing cites any more.

Kept until the author's PR lands: the kernel-impl, -error, -invariance, -rowwise, -path and -seeded devitems, which the main text still cites. Until then those six keys appear as both evidence and pending. That is a transitional state on main, and the author's PR removes them.

Appendix text

  • A.2, the constants: on 2,048 real rows, the FP32-output form of the stock head GEMM showed a largest error of 2.07e-6 of Σ|w h|. That is 295 times inside the conservative model and 58 times inside the Hopper model. The BF16-output kernel that SGLang runs does not expose its FP32 accumulator, so for it the model stays an assumption.
  • D.1, the contracts table:
    • Greedy: measured on replayed rows, through the kernel on 60,000 of them.
    • Seeded: on 60,000 replayed rows at T = 0.7 and 1.0, without top-k or top-p, the certified sampler with its fallback equals the stock seeded sampler on every row. In the engine it stays pending (kernel-seeded-engine).
  • E, the levers table: the certified int8 head, measured as the head alone in its best mode under the conservative model, takes 0.62-0.69 of the stock chain's time up to M = 16 and is slower from 128. The served result stays pending (bench-cert). I shortened this cell after the first build: the longer version made Table 21 overflow its float page by 7.7 pt.
  • G.2, the H3 rows:
    • Runtime: in its best mode with expected fallbacks under the conservative model, the head alone is faster than the stock chain up to M = 64 and slower from 128.
    • Equality: certified rows plus the fallback match the reference on all 60,000 replayed rows. The kernel error is as in A.2.
    • Fewer bytes means less time: only at small batches. The W8A16 pass alone takes 0.57-0.78 of the stock chain's time at M = 1-64, and 1.17-1.46 at 128-256.
    • Traffic: the row now cites kernel-union.

I recomputed every number from the committed JSON and CSV files, not from the README:

  • fp32_output_error: max_rel_to_sum_abs 2.07e-6, with both model radii.
  • agreement_counts: 60,000 with fallback, for greedy and for seeded at both temperatures.
  • head_path_time.csv: best_certified_us / stock_us is 0.62, 0.65, 0.69, 0.69, 0.69, 0.81, 0.93, 1.31 and 1.65.
  • head_primitives.json: the W8A16 pass over the stock chain is 0.57-0.78 up to M = 64 and 1.17-1.46 at 128-256.

Checks

  • Local build, unlocked on cores 48-55 under the untimed-exclusive rule: 0 warnings, 82 pages, main text ending on p10, References on p11. I looked at the levers table (p56) and the new register group (p71).
  • scripts/check_paper_references.py is clean, and every new register path exists on main.
  • Self-review against self_review.md: every scope is stated (head alone, best mode, the model, M, rows), and every untested part stays pending.
  • The host-identity hook passes.

Register: new group with evitems kernel-impl, kernel-tma, kernel-error,
kernel-invariance, kernel-replay, kernel-rowwise, kernel-path,
kernel-micro and kernel-seeded, from evidence/certified_head on main
(keys agreed with the author, who swaps the main-text markers). New
pending entries kernel-union (traffic of a union kernel; the W8A16 pass
reads the whole int8 head) and kernel-seeded-engine (acceptance against
the stock speculative sampler, with #52). The kernel-replay and
kernel-micro devitems go; the impl, error, invariance, rowwise, path and
seeded devitems stay while the main text still cites them.

Appendix markers: A.2 states the stock FP32-output kernel's observed error
(2.07e-6 of sum|wh|, 295x and 58x inside the two models; the BF16-output
accumulator unobservable); D.1's contracts table cites the 60,000-row
replay for greedy and seeded decisions; E's levers table and G.2's H3 rows
give the head-alone timings (best mode 0.62-0.69 of stock up to M = 16,
faster up to 64, slower from 128; W8A16 pass alone 0.57-0.78 up to 64).
@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:31:05.730332Z 7e44d39 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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: REQUEST CHANGES (be4f545; 1 blocking, a one-phrase fix. Every number checks out.)

Blocking

  1. kernel-impl says "145 tests passed at the final commit". The 145 passed at 9f7f369 (x8s2, gpu_tests.log). Five later commits (2ab57df, 09bf64e, 3b137c0, ec46d55, 2c36737) add host-side refusals and their CPU tests. The evidence README's "Results at the final commit" table explains why x8s2's results still stand, but no run of the full suite at the final commit exists, and the suite there has more tests than 145. Say "145 tests passed at 9f7f369 (x8s2), and later commits add host-side refusals with CPU tests", or drop "at the final commit".

Checked against evidence/certified_head on main

  • Kernel error. In stock_invariance.json, the FP32-output error is 2.07e-6 of Σ|wh| over 2,048 rows. The conservative and Hopper models give 6.11e-4 and 1.19e-4, which are 295.0 and 57.6 times that. SGLang's --enable-fp32-lm-head is torch.mm(h, W.T, out_dtype=float32) for BF16 CUDA inputs (logits_processor.py at bd66ce343e). Turning reduced-precision reduction off changes neither the kernel nor any bit at any of the 20 batch sizes.
  • Invariance. All 20 sizes from 1 to 256 are row-wise, column-subset and gathered-candidate invariant.
  • Replay. In replay_decisions.json, 60,000 rows from a capture with at most 16 running requests: with_fallback_eq_reference is 60,000 for greedy under both references and both models, and for seeded sampling at T = 0.7 and 1.0. Disagreements: none.
  • Head path. head_path_table.md gives best mode over stock (conservative) of 0.62, 0.65, 0.69, 0.69, 0.69 at M = 1 to 16, then 0.81, 0.93, 1.31 and 1.65. "Faster up to 64, slower from 128" holds.
  • W8A16 pass alone. From head_primitives.json I get 0.571 to 0.779 at M = 1 to 64 (M = 2 and 4 included) and 1.168 and 1.459 at 128 and 256.
  • Implementation and TMA. x8s2_compile.log reports 148 of 148 variants. stress_defaults.json covers 10 default configurations with 1.00 to 1.05 million row-checks each and 0 misses. The kernel-tma text matches the README's isolation and neighbourhood sections: 64-byte int8 boxes, and three block_m = 128 tiles, both refused (2ab57df). The Triton version is 3.7.1.
  • Paths. Every script and file the new evitems cite exists on main.
  • Pending items. The served result stays pending under bench-cert, the before-and-after frontiers for Certified LM head in SGLang: greedy decode, verify, drafting and fixed-noise sampled verify #52's engine path. kernel-seeded-engine and kernel-union are new, and the union one rests on the pass reading the whole int8 head, half the BF16 bytes.

Build of this head
latexmk -g: 0 LaTeX warnings, 0 overfull boxes, 82 pages, References on page 11. check_paper_references.py reports no differences, and pre-commit is clean.

Transitional state, not blocking
Six keys are both evidence (E) and pending (D) until the author's main-text PR swaps its markers. ev: and dev: are separate label namespaces, so the build is clean. Meanwhile the main text calls results pending that the appendices now report, so the author's PR should merge right after this one.

Codex's run on this head failed ("Something went wrong"), so I have re-requested it.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

…commit

Reviewer on #154: x8s2's GPU tests, compile check and stress test ran at
9f7f369; the five later commits add host-side refusals checked by CPU
tests only.
@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: 7e44d39d47

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

The fix is right: kernel-impl now says the 145 tests ran at 9f7f369 and that later commits add host-side refusals with CPU tests. My build of 7e44d39 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 0f890a0 is clean, and Codex found no issues on this head.

@SamMausberg
SamMausberg merged commit 6246083 into main Oct 1, 2026
SamMausberg added a commit that referenced this pull request Oct 1, 2026
#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.
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