Skip to content

Appendix E: blocking reads removed from attention planning (#120) - #132

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

SamMausberg merged 2 commits into
mainfrom
paper/appendix-hostgap

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Based on main after #129 merged (2f1b274). The diff contains only this PR's two commits: 4df1515 (the App E text and the register) and 3e20a1b (the rebuilt PDF).

Adds #120 (evidence/hostgap/) to Appendix E, scoped as its README states. Every number below comes from that README, cycle_profiles.json, stock_traces_hold1.json, plan_equivalence.json or equality/.

What the appendix now says

There is a new paragraph in E.6, "Removing the blocking reads from attention planning", after the Triton-attention host lever.

  • Idle (derived).
    • Tuned MTP arm: without a profiler, stock leaves the GPU idle an estimated 1.44-1.79 ms per cycle at B = 1-128. That is 21% of the cycle at B = 1 and 9% at B = 128.
    • DFlash block 8: 1.36-1.46 ms per cycle, 21% at B = 1 and 9% at B = 32.
    • The method is stated: the untraced stock cycle minus the GPU busy time per cycle in a host trace of the patched engine from the same session, assuming both do the same GPU work.
  • Where it sits. For MTP, FlashInfer's verify planning: one mask-size read and three index reads per verify. For DFlash, the drafter's attention planning.
  • Exactness of patches 0001-0003.
    • On the GPU, the plans and the replayed attention graph's output bits match stock on random batches at every tested size.
    • The in-engine validation compared at least 8,192 plans of each kind with stock and found no difference.
    • Greedy outputs are token-identical to stock in the same configuration, with equal verify-step counts, for 192 of 192 requests per arm. The runs used 64 prompts at c = 1, 8 and 32, top-k 1 chains, and the prefix cache off, with the running limit and recurrent-state slots pinned. The DFlash attention cache varied by at most 155 tokens between launches and never bound a request. Stock-repeat controls were equal too.
    • Trees, sampling and the prefix cache are not covered.
  • Effect.
    • In held decode batches without a profiler, the MTP cycle shrinks by 0.19 ms (2.7%) at B = 1 up to 0.98 ms (4.8%) at B = 128. That is 13-16% of the idle at B = 1-8, 27-35% at 32-64 and 55% at 128.
    • The pairs are sequential, not interleaved. The MTP changes are at least four times the larger window standard deviation.
    • The DFlash change (0.7-1.7%) is reported as not separable from launch-to-launch variation at B = 1 and 8.
  • What remains. It is a host critical path: in the patched traces, 1.70-1.83 ms from verify completion to the next draft launch, while 0.54-0.90 ms of GPU work is still queued.
  • Pending. New entry hostgap-served covers patches 0004 and 0005 (not validated), the interleaved serving sweeps, and the stock traces retaken with the same window driver.

Also:

  • the System overheads row of the levers table;
  • the H6 status row;
  • the register entry hostgap: README, both traces' JSON, plan equivalence, equality/ and the patch series, produced by profile_arms.sh, gap_analysis.py, hold_equality_profiles.sh, plan_equivalence.py, equality.py and summarize.py;
  • the pins table now lists the hostgap/ series.

Checks

@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-01T15:14:35.707110Z 3e20a1b 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 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: 17477ab1d1

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

\evitem{p4-declared}{P4's served test: the design, metric and decision rule declared before its first run, the prompt check corrected after it, the two void attempts and the amendments declared before each further run (declarations, not results)}{\nolinkurl{evidence/moonshot/README.md}}{\nolinkurl{experiments/moonshot/run_p4b.sh}, \nolinkurl{run_p4_admission.sh}, \nolinkurl{validate_p4_ab.py}, \nolinkurl{output_probe.py}, \nolinkurl{check_admission.py}}
\evitem{host-levers}{Triton attention for the MTP cycle's target and draft at concurrency 1 and 4, single runs}{\nolinkurl{evidence/moonshot/host_levers.csv}, \nolinkurl{README.md}}{\nolinkurl{experiments/moonshot/lever_sweep.py}, \nolinkurl{levers.py}, \nolinkurl{summarise.py}}
\evitem{backbone}{Backbone weight GEMMs and RMSNorm in isolation: the kernels cuBLAS runs per projection and $M$, faster kernels reading the same weights and their bitwise agreement with cuBLAS, the packed GDN input projection, the norm and SiLU prologues, layer skeletons and each run's foreign CPU load; the opt-in engine patch series is code, not a result (Appendix~\ref{app:levers})}{\nolinkurl{evidence/backbone/gemm_microbench.json}, \nolinkurl{merge_microbench.json}, \nolinkurl{norm_microbench.json}, \nolinkurl{chain_microbench.json}, \nolinkurl{tables.md}, \nolinkurl{README.md}, \nolinkurl{hostload/}, \nolinkurl{engine/sglang/patches/backbone/}}{\nolinkurl{experiments/backbone/gemm_bench.py}, \nolinkurl{summarize.py}, \nolinkurl{make_table.py}}
\evitem{hostgap}{Host-side idle in the MTP and DFlash cycles: stock host traces, the derived untraced idle, plan and attention-output equivalence of the sync-free plans, in-engine validation, greedy output equality with stock, and untraced cycle times before and after (Appendix~\ref{app:levers})}{\nolinkurl{evidence/hostgap/README.md}, \nolinkurl{stock_traces_hold1.json}, \nolinkurl{cycle_profiles.json}, \nolinkurl{plan_equivalence.json}, \nolinkurl{equality/}, \nolinkurl{engine/sglang/patches/hostgap/}}{\nolinkurl{experiments/hostgap/profile_arms.sh}, \nolinkurl{gap_analysis.py}, \nolinkurl{hold_equality_profiles.sh}, \nolinkurl{plan_equivalence.py}, \nolinkurl{equality.py}, \nolinkurl{summarize.py}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Commit the host-gap evidence before citing it

In this commit, none of the twelve paths introduced by this register entry exists in the repository: scripts/check_paper_references.py --rev e9fee143a60d0120aed4593a45e7299828d562e4 reports every evidence/hostgap/, experiments/hostgap/, and engine/sglang/patches/hostgap/ path as missing. Consequently, the paper now presents measured results that readers cannot audit or reproduce, and the repository's evidence-register check fails; land those artifacts in this commit's ancestry or leave these claims pending until they are available.

AGENTS.md reference: AGENTS.md:L15-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Scoped reply. The cited files are committed: #120 merged into main at 02a9803, and every path in this register entry exists there. scripts/check_paper_references.py checks against origin/main by default, and it passes on this head. This PR is stacked on #129 (base paper/appendix-backbone), whose base predates #120, so the paths are missing only from this branch's ancestry. When #129 merges I'll rebase this branch onto main and retarget the PR, so the ancestry will then include #120's evidence before anything merges. I'm not merging main into this branch now, because that would put all of #120's files into this stacked diff.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed: the branch is rebased onto main (02a9803, which includes #120), with #129's commits kept below it, and the PR is retargeted to main. Head is now 8fb9a9f. Every path in this register entry now exists in the head's ancestry: scripts/check_paper_references.py --rev HEAD reports "register paths missing at HEAD: none", and the origin/main check is clean too. The paper tree is unchanged by the rebase, since #120 touched no paper/ file, so the committed PDF still matches the source.

@SamMausberg
SamMausberg changed the base branch from paper/appendix-backbone to main October 1, 2026 15:06
@SamMausberg
SamMausberg force-pushed the paper/appendix-hostgap branch from 17477ab to 8fb9a9f Compare October 1, 2026 15:06
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 8fb9a9fcf2

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

Fold in evidence/hostgap/ as its README scopes it. The untraced stock idle
is derived (1.44-1.79 ms per tuned MTP cycle, 21% at B = 1 to 9% at 128;
1.36-1.46 ms for DFlash block 8). Patches 0001-0003 keep plans, attention
output bits and greedy outputs equal to stock in the same configuration
(192/192 requests per arm at c = 1, 8, 32, top-k 1 chains, radix off).
The MTP cycle shrinks 2.7-4.8% in held batches, 13-16% of the idle at
B = 1-8, 27-35% at 32-64 and 55% at 128, from sequential (not
interleaved) pairs; the DFlash gain is unconfirmed. Patches 0004-0005,
the serving A/B and retaken stock traces are pending (hostgap-served).

Adds the hostgap register entry and pins-table series, the System
overheads row of the levers table and the H6 status row.
@SamMausberg
SamMausberg force-pushed the paper/appendix-hostgap branch from 8fb9a9f to 3e20a1b Compare October 1, 2026 15:10
@SamMausberg

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE (provisional, on 3e20a1b: Codex has reviewed 8fb9a9f, whose paper tree this head has byte for byte, but not this commit. I will confirm once it does.)

Review of 4df1515 (text) and 3e20a1b (PDF), rebased on main after #129 merged. git diff 8fb9a9f 3e20a1b -- paper/ is empty, so my checks of 8fb9a9f carry over.

  • Every statement matches Remove blocking reads from FlashInfer planning in the speculative cycle (hostgap) #120's merged evidence (evidence/hostgap/README.md, cycle_profiles.json):
    • derived untraced idle of 1.44-1.79 ms for MTP (21% to 9%) and 1.36-1.46 ms for DFlash (21% at B = 1, 9% at B = 32), with the method and assumption stated;
    • the four reads in FlashInfer's verify planning;
    • plan state and attention-output bits matching on the GPU, at least 8,192 in-engine validations per kind, and 192/192 token-identical requests with equal verify steps for MTP and DFlash, with stock repeats;
    • pins and the DFlash KV caveat (at most 155 tokens, never binding);
    • trees, sampling and the prefix cache stated as not covered;
    • 0.19 ms (2.7%) to 0.98 ms (4.8%), which is 13-16% / 27-35% / 55% of the idle;
    • sequential pairs, with MTP changes at least four times the window SD, and the DFlash 0.7-1.7% unconfirmed;
    • 1.70-1.83 ms of host time against 0.54-0.90 ms of queued work;
    • 0004/0005 unvalidated and under hostgap-served.
  • Register and rows. The H6 and tab:axes rows and the pins row are consistent. Every hostgap register path exists on main (Remove blocking reads from FlashInfer planning in the speculative cycle (hostgap) #120 merged at 02a9803), and check_paper_references.py is clean.
  • Rebuild (at 8fb9a9f, identical tree). latexmk -g on one core finished with 0 warnings, wrote 81 pages, and its text is identical to the committed PDF. References start on p11.
  • Codex found no major issues on 8fb9a9f. Its P1 on 17477ab (paths not yet in the branch's ancestry) is resolved by the rebase and has a reply.
  • Checks. The hostname check is clean over the diff and the PR text.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 3e20a1bcaa

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

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