Skip to content

speed-lowc probes: split-KV killed, GDN fusion not built, FA4 sm_90 hd256 backport, FA4 target and drafter attention probes - #220

Merged
SamMausberg merged 12 commits into
mainfrom
speed-lowc/probes
Oct 2, 2026
Merged

SamMausberg merged 12 commits into
mainfrom
speed-lowc/probes

Conversation

@SamMausberg

@SamMausberg SamMausberg commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Kill tests and probes for the low-concurrency levers on tuned DFlash, so the negatives (and the probe results that decide the confirmation's arms) are on main before the confirmation runs. Everything is in evidence/speed_lowc/README.md; scripts in experiments/speed_lowc/; engine patches in engine/sglang/patches/speed-lowc/ (section in engine/sglang/README.md).

Results (measured, one GH200, one session per probe):

  • Split-KV target verify (SGLang's verify_splitkv.py, shipped for AMD gfx95): dropped. It beats Triton's extend kernel only above about 1,000 tokens of context. At context 512, B = 1 it saves 7.6 us per 8-layer forward, where the declared rule needed 200 us.
  • Fused GDN verify chain: not built. The three-kernel chain exceeds the recurrent kernel by 264-366 us per 24-layer verify, which passes the declared rule (250 us at B = 1). Not building it is a judgment: a fused kernel still writes the per-position conv windows, so its derived ceiling is about 5% of the c = 1 cycle.
  • FA4 target attention at head dim 256 on sm_90.
    • Without a fix it does not compile. The vendored paged-KV loader computes 80 // 128 = 0 page entries per thread for the 128 x 80 tile.
    • Upstream flash-attention fixed this in #2745; an open SGLang PR (#35757) proposes the same fix.
    • With the one-line backport (patches/speed-lowc/0001) and its SM90 regression test (0002), FA4 matches Triton's error against FP32 (9.10e-4) and runs 214 -> 101 us (B = 1, context 256) and 1,538 -> 185 us (context 2,048) per 8-layer target forward.
    • Served (probe 4): x +3.9% / +4.2% at c = 1 / 4 on dflash-tuned-b16 with FA4 drafting, and +7.4% / +2.6% at c = 8 / 32 on dflash-tuned. Every ratio is outside the base launches' spread (at most 1.24%).
  • FA4 drafter attention on dflash-tuned-b16 (probe 2, order S0 D D S0): x +2.9% / +2.7% / +3.9% / +4.3% at c = 1 / 2 / 4 / 8.
  • Both FA4 arms change rounding, and their exactness class is pending until the confirmation's equality run (5 of 6 smoke outputs matched stock in each).
  • FA4 drafting and FA4 target attention go into the three-session confirmation (separate PR), with the exact GDN fold.
  • Patch 0003 gives the fold's ring-writing verify narrow value tiles up to 2 sequences, the threshold the drafter's pre-registered kernel sweep declares (N* = 2). It is part of the confirm engine; these probes do not measure it.

Provenance.

  • Probes 1-3 ran hold scripts that were not yet committed. The README states how the committed scripts differ: formatting, plus the tree and clean-worktree checks added later. It also states that probe 3's engine had exactly the tree build_engines.sh fa4 builds, with engine_dirty=0.
  • Probe 4 ran from 09b6dc4 and repeated both microbenchmarks from the committed tree. Against probe 1, Triton rows are within 6.2%, FA4 drafter rows within 3.0% and split-KV rows within 6.7%; FA4 target rows are within 2.2% of probe 3.
  • Probe 4's confirm engine was tree 9a01a622, whose 0003 stopped at 4 sequences. 0003 now stops at 2 (tree 5d6db548). The trees differ only in that cutoff, on a path that runs only with the fold, which no probe 4 arm enables.

Review at 48b2933 (fixed in 3262467 and 5c2e953): 0003's cutoff 4 -> 2 with a corrected comment and commit message, confirm engine rebuilt; FA4 exactness stated as pending; 0001's row names the 192 x 144 tile whose loader count goes from 1 to 2 (untested); 0002's description says page size 16 runs causal only; the rerun comparison names its reference per figure; foreign CPU labelled mean or maximum; conv at B = 8 is 289 us; the holds' unrecorded stock-tree state is stated.

Checks. pre-commit passes on every changed file, including the host-identity guard; SGLang's own hooks pass on the changed engine files. Codex comments so far are answered inline with the fixing commits: gating probe 4 on probe 3's outputs, the smoke's launch checks, non-finite errors, validating the engine probe 4 serves, reproducible engines, clean worktrees, and the rebuild path.

…Flash

Microbenchmarks at the served shapes (Triton extend vs split-KV vs FA4
attention; the GDN verify chain against its recurrent kernel), a server
smoke of FA4 target and draft attention on dflash-tuned-b16, and a served
A/B of FA4 drafter attention. Split-KV verify and the fused GDN chain are
dropped by their declared rules; FA4 target attention does not compile at
head dim 256 on sm_90 (stale vendored paged-KV loader, fixed upstream in
flash-attention #2745); FA4 drafter attention serves 2.7-4.3% faster per
user at c = 1-8 in one session.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 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-02T22:32:42.849332Z d2c1639 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: 75984e33bd

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

Comment thread experiments/speed_lowc/hold_probe4.sh Outdated
) || failed+=(attn)
timeout --foreground 180 python experiments/speed_lowc/gdn_chain_bench.py \
--out "$OUT/gdn_chain_bench.json" > "$OUT/gdn_chain_bench.log" 2>&1 || failed+=(gdn)
if ! grep -q "probe3 end .* failed: none" "$P3"; then

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 Persist probe 3's result before gating probe 4

When these holds are run with their documented scripts/gpu_lock.sh -x ... commands, neither hold_probe3.sh nor gpu_lock.sh creates $HOME/vp-data/speed-lowc/logs/probe3.log; probe 3 only writes its timestamped output directory. Consequently this grep treats the missing file as a failed prerequisite, skips every served A/B, and then exits successfully when the two microbenchmarks passed. Probe 3 should write a known status file, or probe 4 should locate and validate the actual probe 3 output, so a successful prerequisite cannot silently omit the main experiment.

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.

Fixed in 4b075f1. Probe 4 no longer reads a log file. check_probe3.py reads the newest probe3-* output directory and checks four things: the FA4 target numerics against FP32 (at most twice the Triton error), FA4 timing errors, the pytest summary of the SM90 regression test, and the smoke results.

It exits 0 for passed and 1 for failed: probe 3 failed a check, so the served A/B is skipped. It exits 2 when probe 3's outputs are missing or unreadable; that now makes probe 4 exit non-zero, so a run with missing outputs can no longer skip the served A/B and still pass. I tested all three paths on synthetic directories. Probe 3 also writes status.txt in its output directory.

… write

hold_probe4.sh read ~/vp-data/speed-lowc/logs/probe3.log, which only the
detached submission redirect creates; run as documented, probe 4 would skip
the served A/B and still exit 0. check_probe3.py now reads the newest
probe3-* directory (microbenchmark numerics and errors, regression test
summary, smoke) and returns passed, failed or missing; missing outputs make
probe 4 fail. Probe 3 also writes status.txt.
@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: 4b075f1fb0

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

Comment on lines +64 to +66
bad = [r.get('config') for r in smoke if not r.get('ok')]
if not smoke or bad:
failures.append(f'smoke failed: {bad or "empty"}')

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 Reject smoke runs whose launch checks failed

When fa4_smoke.py runs the server with strict=False, a configuration can produce all requested tokens while a required launch check reports that CUDA graphs were not captured or the requested target backend was not selected. This code examines only each record's ok flag, so such a run makes check_probe3.py return 0 and allows probe 4's served A/B to proceed with an invalid prerequisite; also reject required failed entries in checks and confirm that fa4_both resolved both FA4 backends.

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.

Fixed in 80621b2. A smoke record now passes only if it has launch checks and none of its required checks failed. On top of that, fa4_both must report FA4 as both the target and the draft attention backend (attention_backend and speculative_draft_attention_backend from server_info). Tested on synthetic outputs: a failed required check, a target backend other than FA4, and a clean pass. The probe-4 hold tree is at this commit; probe 4 has not been queued yet.

…-FA4 backends

fa4_smoke.py launches with strict=False, so a configuration can decode while
a required launch check (CUDA graphs, overlap, capacity, backend) failed.
Require every required check to pass and fa4_both to resolve FA4 for both
the target and the drafter.
@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: 80621b2f88

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

Comment on lines +50 to +51
elif fa4 > 2 * triton:
failures.append(f'FA4 target max |err| {fa4:.3g} > 2 x Triton {triton:.3g}')

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 Reject non-finite numerical errors before passing probe 3

If the backported FA4 kernel produces NaNs, max().item() records NaN and Python's JSON loader accepts it, but fa4 > 2 * triton evaluates false; the checker therefore reports success and allows probe 4's served A/B to run with numerically invalid attention. Require both error values to be finite before applying the ratio threshold.

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.

Fixed in 54aae93: both errors against the FP32 reference must be finite before the ratio test, so a NaN in the FA4 output fails the check. Tested with a NaN FA4 error, which fails, and a finite one, which passes. The probe-4 hold tree is now at this commit.

A NaN in the FA4 output made max |err| NaN, and NaN > 2 x Triton is false,
so the check passed. Require both errors to be finite first.
@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: 54aae93d40

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

Comment on lines +50 to +51
python experiments/speed_lowc/check_probe3.py | tee "$OUT/probe3_check.txt"
p3=${PIPESTATUS[0]}

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 Validate the engine used by the served A/B

When probe 3 passes on ~/sglang-wt/speed-lowc but $ENGINE points to a different speed-lowc-confirm revision, this gate authorizes the served A/B using results from the former. The preceding microbenchmark does not close the gap because attn_microbench.py catches FA4 compilation and timing errors and still exits successfully, so an incorrect or absent backport in the confirmation engine can proceed to measurement. Check the confirmation engine's own output, or require its SGLang commit/backport to match the engine validated by probe 3.

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.

Fixed in ea03daa. Probe 4 now validates the engine it actually serves:

  • it checks the confirm tree's hash, which build_engines.sh reproduces from the pin plus the committed patches;
  • it requires the confirm tree's paged_kv.py to be the same blob as the tree probe 3 validated;
  • it runs check_probe3.py --microbench-only on its own microbenchmark of the confirm tree.

That last check needs FA4 target numerics that are present, finite and within twice the Triton error, and no FA4 timing errors. All three must pass before any served run.

Comment on lines +9 to +11
export SGLANG_WORKTREE=${ENGINE:-$HOME/sglang-wt/speed-lowc}
# shellcheck disable=SC1091
source scripts/sglang_env.sh

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 Make the backported worktree reproducible from the repository

On a machine containing only the documented pinned ~/sglang clone, this default path does not exist, and even creating a stock worktree with scripts/sglang_worktree.sh speed-lowc does not provide the required loader fix or regression test. A repo-wide search finds no speed-lowc patch or setup command under engine/sglang/patches/, so probe 3 cannot be reproduced from this commit without undocumented local state. Commit the backport/test and document how to construct this worktree before invoking the probe.

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.

Fixed in ea03daa. The backport, its SM90 regression test and the ring-verify tile cutoff are now committed as engine/sglang/patches/speed-lowc/0001-0003, with a section in engine/sglang/README.md.

experiments/speed_lowc/build_engines.sh fa4|confirm builds both trees from the pin and committed patches only. The probe holds check the resulting tree hashes (fa4 dcd97db1, confirm 9a01a622). The local tree that probe 3 runs from has exactly the fa4 build's tree hash.

…/B uses

Codex on #220: probe 3's engine existed only as local state, and probe 4
gated its served A/B on probe 3's engine while running another tree.

- engine/sglang/patches/speed-lowc/0001-0003 (FA4 paged-KV backport, its SM90
  regression test, the ring-verify tile cutoff) and build_engines.sh, which
  builds both trees from the pin and committed patches; README section.
- hold_probe3.sh checks its engine's tree hash; hold_probe4.sh checks the
  confirm tree, requires the same paged_kv.py as probe 3's engine, and reruns
  check_probe3.py --microbench-only on its own microbenchmark of the confirm
  tree before the served A/B.
@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: ea03daa2d5

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

Comment on lines +12 to +13
[ "$(git -C "$SGLANG_WORKTREE" rev-parse 'HEAD^{tree}')" = "$FA4_TREE" ] ||
{ echo "engine tree is not $FA4_TREE"; exit 1; }

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 Reject dirty probe 3 engine worktrees

When ~/sglang-wt/speed-lowc has tracked or untracked edits, HEAD^{tree} still matches this constant, so the probe imports and tests the modified files while merely printing engine_dirty; check_probe3.py can then authorize probe 4 using results that did not come from the claimed engine. Require a clean worktree before running, as probe 4 already does for its confirmation engine.

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.

Fixed in 09b6dc4: hold_probe3.sh refuses an engine worktree with tracked or untracked changes, since git status --porcelain must be empty. Ignored build products such as the copied .so files are allowed. hold_probe4.sh applies the same check to the confirm tree it serves and to the fa4 tree that probe 3 validated. The probe-3 run that is queued now uses an earlier copy without this check; both engine worktrees were clean when I checked them today at 19:30, and its log records the dirty-file count at start.

Comment thread experiments/speed_lowc/build_engines.sh Outdated
Comment on lines +31 to +32
dest=$HOME/sglang-wt/$name
[ ! -e "$dest" ] || { echo "$dest exists; remove it first (git -C ~/sglang worktree remove $dest)" >&2; exit 1; }

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 Remove or reuse the branch when rebuilding an engine

When an operator rebuilds either engine after following this error's suggested git worktree remove, the engine/speed-lowc[-confirm] branch remains, and sglang_worktree.sh subsequently calls git worktree add -b with the same name and fails because the branch already exists. git worktree add -h describes -b as “create a new branch”; delete/reset that branch or reuse it so the documented rebuild path works.

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.

Fixed in 09b6dc4: build_engines.sh now refuses when either the worktree or the engine/<name> branch exists, and prints the two commands that clear both (git worktree remove and git branch -D). With both gone, sglang_worktree.sh creates the branch afresh, so the documented rebuild path works.

Codex on #220: a matching HEAD tree does not rule out local edits, so the
probe holds now refuse an engine worktree with tracked or untracked changes
(probe 4 checks both the served tree and the one probe 3 validated). And
build_engines.sh refuses a leftover engine/<name> branch as well as the
worktree, and prints the two commands that clear both, since
sglang_worktree.sh creates the branch anew.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 09b6dc4878

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

…kport

Compiles and runs at every shape; max |err| against FP32 equals Triton's
(9.10e-4); 8-layer target attention 214 -> 101 us at B = 1, context 256 and
1,538 -> 185 us at 2,048; the SM90 regression test passes; the server smoke
serves FA4 for target and drafter with every required launch check passing.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

…s from the committed tree

On the confirm engine, FA4 target attention raises x by 3.9% / 4.2% at c = 1 / 4
on dflash-tuned-b16 (with FA4 drafting) and 7.4% / 2.6% at c = 8 / 32 on
dflash-tuned, one session, every ratio outside the base launches' spread.
The microbenchmarks reproduce probes 1 and 3 within 6.7% (Triton, FA4).
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@SamMausberg SamMausberg changed the title speed-lowc probes: split-KV and GDN-fusion kills, FA4 sm_90 head-dim-256 compile bug, FA4 drafter attention +3-4% speed-lowc probes: split-KV and GDN-fusion kills, FA4 sm_90 hd256 backport, FA4 target and drafter attention gains Oct 2, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 48b2933bef

ℹ️ 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 at 48b2933

The probe numbers all reproduce, and the provenance and failure handling hold up. Three items block. The first matters before the confirmation runs: patch 0003, which is part of the confirm engine, uses a narrow-tile cutoff that contradicts the pre-registered threshold already on main.

Blocking

  1. Patch 0003's cutoff (4 sequences) contradicts the declared reading on main (N* = 2).

    • Where: engine/sglang/patches/speed-lowc/0003 (RING_VERIFY_NARROW_MAX_N = 4, its code comment and its commit message) and the 0003 row of engine/sglang/README.md.
    • Evidence on main: evidence/drafter/README.md ("Ring-writing verify tiles by batch") pre-registered the threshold rule. Its result is n_star: 2 (ring_tile_sweep/sweep.json): tile 4 / tile 32 = 1.09 and 1.08 at N = 3 and 4 on block 16, and 1.09 and 1.07 on block 8. The section concludes "tile 4 for the ring-writing verify at N ≤ 2, tile 32 above".
    • Comment and commit message. The patch comment says "BV=4 was faster up to 4 sequences and slower from 8". The commit message says "faster than BV=32 at 1-4 sequences". The kernel sweep says the opposite at 3 and 4 sequences. The only support for 4 is the unpaired cross-session comparison at block 16, c = 4: measured 1.013 against the kernel's predicted 0.993. The drafter README calls that gap unexplained.
    • Engine README row. "the cutoff keeps the first and drops the second" is a prediction; nothing here measures it.
    • Fix, one of:
      • (a) set the cutoff to 2, per the declared rule, rebuild the confirm engine and update the tree hash in hold_probe4.sh and the engine README; or
      • (b) keep 4 and say so in the patch comment, the commit message and the README row. State it as a deviation from the pre-registered N* = 2, chosen on the unpaired block-16 c = 4 served result against the kernel sweep, with its served effect unmeasured, and correct "faster up to 4 sequences" to what the sweep shows.
    • Timing: decide before the confirmation sessions, since the confirm engine carries 0003 and the confirmation includes the fold.
  2. The FA4 exactness wording overstates what was checked.

    • Where: evidence/speed_lowc/README.md, probe 2.

    • The problem: "(the verifier decides every token, so outputs stay in the arm's exactness class; their equality run is part of the confirmation)" is stated as established. It is not:

      • probe 1's smoke has 5 of 6 FA4-draft outputs identical to stock (probe1/fa4_smoke.json, identical_to_stock);
      • probe2/launches.csv labels the FA4-draft arm's exactness pending.

      The drafter changes which positions each verify covers, and with that the target's rounding.

    • Replace with: "Accepted tokens per cycle move with the drafter's rounding. The verifier still decides every token, but which positions each verify covers changes, and in probe 1's smoke 5 of 6 outputs matched stock. The arm's exactness class is pending (launches.csv); the confirmation's equality run decides it."

    • Probes 3/4: add one sentence to say the same for FA4 target attention. Its error against FP32 equals Triton's, but it was not compared bitwise; 5 of 6 smoke outputs matched stock; the class is pending in probe4/launches.csv.

  3. The 0001 "Default behaviour" row is inaccurate.

    • Where: engine/sglang/README.md.
    • The problem: "no change elsewhere (tiles whose n is a multiple of 128 compute the same count)". On sm_90 the vendored FA4 also uses a 192 x 144 tile (head dim 65-96, non-causal: interface.py, FwdConfig(192, 144, ...)). With the 128-thread loader the count there goes from 144 // 128 = 1 to 2. No probe here tested that shape.
    • Replace with: "tiles with n below 128 now compile; tiles whose n is a multiple of 128 compute the same count; the 192 x 144 tile (head dim 65-96, non-causal) gets two entries per thread instead of one, a shape these probes did not test."

Optional

  1. Provenance sentence ("within 6.7% of probe 1's ... split-KV up to 13%") mixes references. Against probe 1: Triton ≤ 6.2%, FA4 drafter ≤ 3.0%, split-KV ≤ 6.7%. FA4 target has no probe-1 row and is within 2.2% of probe 3. The 13% (12.6%) is split-KV against probe 3. Name the reference for each figure.
  2. Probe 2's "Foreign CPU 0.35-1.23 cores per point" gives the per-point maxima (foreign_cpu_max); the means are 0.17-0.35. Probe 4's "at most 0.41" is a mean. Label which is which.
  3. 0002 test coverage. In the 0002 description (engine README and commit message), page size 16 runs causal only: "page size 1, causal and not; page size 16, causal".
  4. GDN table: conv at B = 8 is 289.5 µs, so 289, not 290.
  5. "GDN-fusion kill". The chain passed its declared rule (264 ≥ 250 µs); not building it is a judgment from the derived 5% ceiling. The README says so. The PR title and body could say "not built" rather than "kill".
  6. hold_probe4.sh (like probes 1-2) runs gdn_chain_bench.py on ~/sglang without recording that tree's commit or dirty state.

What I checked (head 48b2933, worktree at that SHA)

  • Every table recomputed from the committed JSON/CSV:
    • probe 1 attention (all 32 cells), FA4-drafter speedup 1.34-8.51x, Triton slope 0.745 µs/token, split-KV saving 7.595 µs, numerics 9.097e-4 / 1.024e-3 / 1.074e-3;
    • probe 3 attention (all 16 cells), saving 233.3 µs, FA4 = Triton = 9.097e-4;
    • GDN chain and the excess 263.9 µs, 4.99% of stack/ceiling.json's 5.294 ms;
    • probe 2 ratios 1.029/1.027/1.039/1.043 (y 1.026/1.028/1.036/1.046), S0 spread ≤ 0.15%, per cycle 1.034-1.040, every FA4 launch faster than both S0 launches;
    • probe 4 ratios, spreads (≤ 1.24%), acceptance and per-cycle ratios, all matching;
    • reruns: GDN excess within 2.5 µs; probe 2 rerun within 3.8%.
  • Regeneration: bench.pareto on the raw runs (~/vp-data/speed-lowc/probe{2,4}-*) reproduces points.csv byte for byte for both probes. launches.csv is identical for probe 4 and has the same rows in a different order for probe 2.
  • Provenance: the untracked scripts that ran probes 1-3 are still in ~/vp-wt/speed-lowc (e690b3a), modified before each hold started. Their diff against the committed scripts is ruff formatting, cd ... || exit 1 and direct exit-status checks, plus probe 3's later tree and clean checks and status.txt. No logic changed, as the README says. Probe 4 ran at 09b6dc4, and nothing under experiments/, engine/, bench/ or scripts/ changed between 09b6dc4 and the head.
  • Engine trees:
    • Rebuilding from the pin (bd66ce343e) with the committed patches (git apply --cached, bare shared clone) gives fa4 dcd97db1 and confirm 9a01a622, as stated.
    • Probe 3's engine 1a52b76c and probe 4's d8d93080 have exactly those trees. The probe 3 smoke's required launch checks all pass, with the FA4/FA4 backends.
  • Failure handling: PIPESTATUS[0] is read immediately after each pipeline in all four holds. Failures are collected and decide the exit status. check_probe3.py exits 0/1/2 as documented, and probe 4 skips the A/B on 1 and fails on 2. Probe 1's log records failed: smoke for the expected FA4 failure.
  • Repository checks:
    • pre-commit passes on all 32 files (ruff, mypy, codespell, shellcheck); no file over 1 MB; no hostname; no co-author lines.
    • The PR merges cleanly with main (engine README changed on both sides, no conflict).
    • Codex is clean on 48b2933 (21:04), and all seven threads are answered with their fixing commits.

…ared N* = 2

Review of #220 at 48b2933. Patch 0003 used narrow tiles up to 4 sequences
and said they were faster there; the drafter's pre-registered kernel sweep
(evidence/drafter/ring_tile_sweep) gives N* = 2, with tile 4 slower than
tile 32 at 3 and 4 sequences. 0003 now stops at 2 and its comment and
message give the sweep's numbers. The confirm engine is rebuilt (tree
5d6db548); hold_probe4.sh checks it, and the README states that probe 4
ran on the earlier tree 9a01a622 and that the two differ only in a path
no probe 4 arm runs.

Also from the review: the FA4 draft and FA4 target arms' exactness class
is stated as pending until the confirmation's equality run; patch 0001's
row names the 192 x 144 tile whose loader count changes; 0002's
description says page size 16 runs causal only; the rerun comparison
names its reference for each figure; foreign CPU is labelled mean or
maximum; conv at B = 8 is 289 us; the holds' unrecorded stock-tree
provenance is stated.
SamMausberg added a commit that referenced this pull request Oct 2, 2026
… any hold ran

Patch 0003 now stops the fold's narrow ring-verify tiles at 2 sequences,
the drafter's declared N* = 2 (review of #220). The declared plan names
the new tree and the change, and lever A's row gives the probe evidence
for each tile width. The equality hold queued for the old tree was
cancelled before it started.
@SamMausberg SamMausberg changed the title speed-lowc probes: split-KV and GDN-fusion kills, FA4 sm_90 hd256 backport, FA4 target and drafter attention gains speed-lowc probes: split-KV killed, GDN fusion not built, FA4 sm_90 hd256 backport, FA4 target and drafter attention probes Oct 2, 2026
@SamMausberg

Copy link
Copy Markdown
Owner Author

Thanks. All three blocking items and the optional ones are fixed in 3262467.

  1. 0003's cutoff. Took (a): RING_VERIFY_NARROW_MAX_N = 2. The comment and commit message now give the sweep's numbers (tile 4 at 0.54-0.70 of tile 32's time at 1-2 sequences, 1.03-1.40 from 3 to 64), and the 0003 row cites the declared reading and says these probes do not measure its served effect. The confirm engine is rebuilt (tree 5d6db548; it differs from 9a01a622 only in the constant and comment) and SGLang's hooks pass on it. hold_probe4.sh checks the new tree, with a comment that probe 4 ran on 9a01a622. The README's Provenance says the same and gives 48b2933 as the commit that rebuilds probe 4's exact tree. The change cannot touch probe 4's numbers: the ring-writing verify runs only with the fold, and no probe 4 arm enables it (probe4/launches.csv). The confirmation's equality hold for the old tree was cancelled before it started. It is requeued on the new tree, and its declared README records the change as made before any hold ran.
  2. FA4 exactness. Probe 2 uses your wording. Probe 4 adds the sentence for FA4 target: error against FP32 equal to Triton's, no bitwise comparison, 5 of 6 smoke outputs matching stock, class pending in probe4/launches.csv.
  3. 0001 row. Uses your wording. It adds that kernel checks made while reviewing the upstream fix, which are outside this repository's evidence, found FA4's paged cp.async path giving wrong outputs at that 144-wide tile both with and without the ceil-divide. A reader should not take the row as saying that shape works.

Optional: 4. each rerun figure names its reference (probe 1: Triton 6.2%, FA4 drafter 3.0%, split-KV 6.7%, GDN excess 2.5 us; probe 3: FA4 target 2.2%). 5. Foreign CPU is labelled: probe 2 means 0.17-0.35 (maxima 0.35-1.23), probe 4 means at most 0.41 (maxima 0.63-2.14). 6. 0002's commit message and row now say page size 16 runs causal only. 7. 289. 8. The title and body say "not built" and that the chain passed its rule. 9. The README states that the probe 1-2 microbenchmarks and the GDN-chain runs in probes 1 and 4 import ~/sglang without recording its commit or state. Probe 2's stock launches record the pin, clean. The scripts that ran are left as they ran.

@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

The 192 x 144 tile's loader count goes from one entry per thread to two,
untested here; the row no longer reports kernel checks that are not in
this repository.
@SamMausberg

Copy link
Copy Markdown
Owner Author

Follow-up in 5c2e953: the 0001 row no longer mentions the kernel checks outside this repository. Committed files cite only committed evidence. It keeps "the 192 x 144 tile gets two entries per thread instead of one, a shape these probes did not test".

@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: 5c2e95353a

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

Comment on lines +59 to +61
elif fa4 > 2 * triton:
failures.append(f'FA4 target max |err| {fa4:.3g} > 2 x Triton {triton:.3g}')
fa4_errors = [e for e in attn.get('errors', []) if e.get('arm') == 'fa4']

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 Enforce the target-attention kill threshold

When FA4 remains numerically correct but saves less than the declared 200 µs at B=1/context 512—such as after a kernel, driver, or hardware performance change—attn_microbench.py records killed_target: true, yet this checker examines only numerical and execution errors and returns success. Both the probe-3 gate and the confirm-engine rerun can therefore authorize the served FA4 A/B contrary to the experiment's kill rule; require the FA4 timing to meet the threshold (and the expected timing rows to exist) before passing.

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.

Fixed in 5a2c375. check_probe3.py now requires the target rows at B = 1, context 512 for both Triton and FA4, and an FA4 saving of at least 200 us (the declared kill rule). It applies to both probe 3's outputs and probe 4's own microbenchmark. The check was added after probes 3 and 4 ran, and both pass it: 233.3 and 234.1 us. The README says so.

… A/B

Codex on 5c2e953: the gate checked FA4's numerics and errors but not its
timing, so a correct but slow FA4 would still have authorized probe 4's
served A/B. It now requires both B = 1, context 512 target rows and a
saving of at least 200 us. Added after probes 3 and 4 ran; both of their
microbenchmarks pass (233.3 and 234.1 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: 5a2c375c69

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

Comment thread evidence/speed_lowc/README.md Outdated
| `probe1/attn_microbench.json` | attention microbenchmark, numerics against FP32, per-arm errors | `scripts/gpu_lock.sh -x experiments/speed_lowc/hold_probe1.sh` (`attn_microbench.py`) |
| `probe1/gdn_chain_bench.json` | GDN verify chain against the recurrent kernel alone | same hold (`gdn_chain_bench.py`) |
| `probe1/fa4_smoke.json` | server smoke: stock, FA4 draft, FA4 target + draft on `dflash-tuned-b16`; tokens, verify counts, failure traceback | same hold (`fa4_smoke.py`) |
| `probe1/hold.log`, `probe2/hold.log` | hold logs | - |

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 Record the commands that produced the hold logs

The committed probe1/hold.log and probe2/hold.log are assigned - rather than their capture commands, so an auditor cannot reproduce how these logs were generated or determine whether stdout/stderr redirection and the GPU lock matched the documented runs. Give each log its exact producing command, including any tee or redirection used to create the committed file.

AGENTS.md reference: AGENTS.md:L15-L18

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.

Fixed in d2c1639 (it is pushed once its hooks run in the next CPU window). One Files row now covers all four hold logs, probe1/hold.log to probe4/hold.log. Each is the stdout and stderr of the detached submission, setsid nohup scripts/gpu_lock.sh -x experiments/speed_lowc/hold_probe<N>.sh > ~/vp-data/speed-lowc/logs/probe<N>.log 2>&1 < /dev/null &, copied unchanged with cp. All four committed files are byte-identical to those logs (checked with cmp). The probe 3 and 4 rows no longer list their hold logs separately.

Codex on 5a2c375: probe 1's and probe 2's hold logs had no command. Each
probe<N>/hold.log is the redirect of the detached gpu_lock submission,
copied unchanged (byte-identical to ~/vp-data/speed-lowc/logs/probe<N>.log);
one row now gives that for all four.
@SamMausberg

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: d2c1639061

ℹ️ 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 at d2c1639

I re-checked only the delta from 48b2933 (3262467, 5c2e953, 5a2c375 and d2c1639) against the review there (issuecomment-5961599920). All three blockers are fixed, and nothing new claims more than its evidence supports.

Blockers from 48b2933

  1. 0003's cutoff is fixed.
    • Patch: RING_VERIFY_NARROW_MAX_N = 2. The code comment, the commit message and the engine README row now cite the sweep.
    • Sweep numbers recomputed from evidence/drafter/ring_tile_sweep/sweep.json (ring path, median us per layer):
      • tile 4 / tile 32 is 0.542-0.697 at N = 1 and 2, and 1.033-1.404 at every tested batch from 3 to 64, on blocks 8 and 16;
      • threshold.n_star is 2 on both blocks, and bitwise_failures is empty.
    • Trees rebuilt from the pin with the committed patches (git apply --cached into a temporary index):
      • confirm 5d6db548 from this head;
      • confirm 9a01a622 from 48b2933's patches;
      • fa4 dcd97db1 (0002's change is commit-message only).
    • The two confirm trees differ in one file: the constant and its comment in fused_sigmoid_gating_recurrent.py.
    • No probe 4 arm enables the fold. Every launch in probe4/launches.csv has an empty env, so SGLANG_GDN_REPLAYSSM_FOLD, the fold's switch in drafter 0003, is unset.
    • Disclosure: the README and hold_probe4.sh say probe 4 ran on the earlier tree.
  2. FA4 exactness is now stated as pending.
    • Probe 2 uses the suggested wording.
    • Probe 4 adds the matching sentence for target attention.
    • Both "5 of 6" figures match identical_to_stock in probe1/fa4_smoke.json and probe3/fa4_smoke.json.
    • launches.csv labels the FA4 arms pending in both probes.
  3. The 0001 "Default behaviour" row now uses the suggested text, naming the 192 x 144 tile as untested.

Optional items and new commits

  • Optional items 4-9 are taken.
    • Foreign CPU means are 0.167-0.347 for probe 2 and 0.21-0.412 for probe 4. The per-point maxima are 0.35-1.23 and 0.63-2.14. These match points.csv.
    • Conv at B = 8 is now 289 µs.
    • The unrecorded stock-tree state is now stated. probe2/launches.csv records the pin with sglang_dirty False.
  • 5a2c375, the kill-rule gate.
    • The 200 us threshold matches attn_microbench.json's kill_rule. A missing row or a NaN fails the check.
    • Savings recomputed from the committed JSON: 233.3 us (probe 3) and 234.1 us (probe 4).
    • check_probe3.py at this head passes on both raw directories (--dir probe3-20261002T194252Z, and probe4-20261002T204410Z --microbench-only).
  • d2c1639, the hold logs. All four committed probeN/hold.log files are byte-identical to ~/vp-data/speed-lowc/logs/probeN.log, the files the stated command writes.
  • Checks.
    • Codex: "Didn't find any major issues" on d2c1639. The P2s at 5c2e953 and 5a2c375 are fixed and answered.
    • pre-commit on the delta's files passes, including mypy, shellcheck and the host-identity guard.
    • No hostname or IP appears in the delta or the PR body.
    • No AI attribution.

Optional

  1. Engine README, row 0001. Our fix: FA4 paged-KV zero-size page-table registers on SM90 sgl-project/sglang#35757 comment has since been edited. It now reports that head dims 160 (tile_n 112) and 224 (tile_n 80) compile with the ceil-divide but give wrong output. The row's "tiles with n below 128 now compile" is literally true, but it reads as if those tiles work. Suggest appending: "(at head dim 160 and 224 they compile but give wrong output: fix: FA4 paged-KV zero-size page-table registers on SM90 sgl-project/sglang#35757 (comment))". The paper's engine runs only head dim 256, so nothing measured here changes.
  2. Merge order with engine/sglang: upstream patches for FA4 hd256 (SM90) and the sgl-kernel sm_90a build #226. speed-lowc probes: split-KV killed, GDN fusion not built, FA4 sm_90 hd256 backport, FA4 target and drafter attention probes #220 and engine/sglang: upstream patches for FA4 hd256 (SM90) and the sgl-kernel sm_90a build #226 both add a section at the end of engine/sglang/README.md, and they conflict there (legacy git merge-tree). Each merges cleanly with main on its own, so whichever lands second needs a trivial merge that keeps both sections.

@SamMausberg
SamMausberg merged commit 5a125d9 into main Oct 2, 2026
SamMausberg added a commit that referenced this pull request Oct 3, 2026
…es and the upstream patches

BF16 (#222, evidence/bf16_paths): the served benchmark read both gross
positions as ill-conditioned in BF16. #222 supports that for a4db11ff/333
only. At 579ae7ce/439, the paper's 8.9-nat position, transformers in BF16
keeps FP32's top token in all 16 readings, FP32 under one-rounding noise
moves 1756 by at most 0.52 nats, and no single SGLang kernel swap removes
the miss: an SGLang outlier at a selected position, whose frequency the
unselected positions cannot compare with transformers'. The abstract and
§4.5 add "unlike transformers'"; App E.5, the served README (two places)
and a new notes subsection give the reading; register entry bf16-paths in
both registers.

Low-concurrency probes (#220, evidence/speed_lowc): one notes paragraph
(split-KV verify dropped by its rule; FA4's head-dim-256 compile failure
and backport; one-session served FA4 probes, exactness not classified;
fused GDN chain passed its rule but not built), H6, "What did not work",
register entry speed-lowc, and the missing index rows.

Upstream (#226): one notes paragraph and register entry upstream-patches
(the FA4 test as a comment on sgl-project/sglang#35757; the sgl-kernel
sm_90a build fix open as sgl-project/sglang#42263). The two FP8 lines say
the CUTLASS GEMM "fails" rather than "aborts", consistent with the engine
README.

Reviewer's optional item from #227: "calls of up to 30-64 positions" in
the abstract and §4.5 (largest certified calls at each point).

Paid for in §4.5's paragraph with no claim dropped; the main text still
ends at the foot of p10.
SamMausberg added a commit that referenced this pull request Oct 3, 2026
… any hold ran

Patch 0003 now stops the fold's narrow ring-verify tiles at 2 sequences,
the drafter's declared N* = 2 (review of #220). The declared plan names
the new tree and the change, and lever A's row gives the probe evidence
for each tile width. The equality hold queued for the old tree was
cancelled before it started.
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