Repository navigation
Moonshot: P4 strict replay is bit-exact (1.22x kernel), host-gap flag 1.18x, P7 rejection tests - #60
Conversation
The server's logged gen throughput while ~c requests run sits beside the client throughput, so a front-end limit shows as a gap between the two.
…n byte arithmetic With PR #13 merged, bandwidth, kernel attribution and the MTP idle share cite evidence/profiles. README section 2b derives the MTP cycle at c = 128 from bench's tuning throughput and shows that snapshot-free verification beyond ReplaySSM-spec is worth ~4% of the cycle, while the cycle is 2-2.7x the sum of its parts.
On the mixed-v2 confirm outputs of the plain sweep (172k tokens), bench's tune maps cover 89.1% (4,096 rows), 93.3% (8,192), 96.3% (16,384) and 97.5% (22,936) of the target's tokens; in-sample coverage was 97-100%. README cites the bandwidth sweep configuration as reused at the head's size.
…d chunked GDN verify per width
…ejection tests - Exact replay (patch 0007) matches SGLang's packed decode on every state and output word at every step (L = 4, 16; layers 0 and 20); ReplaySSM does not. Kernel time 1.22x at B = 128 and 256 with L = 4; derived ~1.08x end to end, below the pre-registered 1.10x. - Triton attention for target and draft removes FlashInfer planning from the MTP cycle: 1.18x at c = 1, 1.14x at c = 4; the plan-stream arm fails on the GDN hybrid. - P7: the chunked GDN verify disagrees with the recurrent path in 52-55% of BF16 output words and is slower than it at one request up to T = 256. - make_long_prompts.py builds the 2,048-token workload for the server-side P4 A/B; quality_arms drops the arm's 640-slot default when the radix cache is off.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Verdict: REQUEST CHANGES Reviewed head f0c13b6 against main (merge base 0f0c025, with main merged in at 05ef9c9). The measurements are sound and the numbers match their files. Four claims need tighter scope, and one section cites a branch that has not merged. Checked and correct
BlockingB1. "Bit-identical" needs its scope, and the end-to-end probe has dropped out of the table (integrator check 1). This affects the PR body, lever row 4, and section 2c's first sentence.
B2. Say which engine the one_batch crash happened in (integrator check 3; section 2c, last sentence; PR body).
B3. The Triton-attention host-gap result is labelled exact, but it changes the attention arithmetic (integrator check 4; lever row 2, "exact"; section 2d).
B4. P7: scope the conclusion to SGLang's kernel and the synthetic inputs (integrator check 5; section 2e, "by P7's own rejection rule the design is rejected with this kernel"; the PR body).
B5. Section 2b cites evidence from an unmerged branch ("Bench's depth tuning (bench workstream,
Suggestions (not blocking)
Codex's review of f0c13b6 is still running; I'll check its comments before the re-review. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0c13b6ca2
ℹ️ 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".
| concs = sorted({p['concurrency'] for p in data.get('points', [])}) | ||
| rates = server_decode_rates(sweep_json.parent / 'server/server.log', concs) |
There was a problem hiding this comment.
Read server decode rates from each point's log segment
When a sweep contains multiple concurrency points, this reads the entire server log, including server warmup and every other point. A higher-concurrency run emits lower #running-req values while draining, so those samples are incorrectly attributed to lower-concurrency rows and can bias server_decode_tok_s and paired server ratios. bench/sweep.py already records the exact per-point segment in point['server_log']['logged_gen_tps_full_batch_p50']; aggregate that value instead of reparsing the run-wide log.
Useful? React with 👍 / 👎.
| + BV = min( | ||
| + triton.next_power_of_2(V), | ||
| + int(os.environ.get("SGLANG_GDN_EXACT_REPLAY_BV", "32")), | ||
| + ) |
There was a problem hiding this comment.
Reject invalid replay tile sizes before launching Triton
When SGLANG_GDN_EXACT_REPLAY_BV is set to 0 or to a non-power-of-two value such as 24, the value is passed directly to triton.cdiv and tl.arange(0, BV). The former divides by zero and the latter requires a power-of-two extent, so plausible settings of the newly advertised selector crash rather than select a tile. Validate that the parsed value is a supported positive power of two before constructing the grid.
Useful? React with 👍 / 👎.
…ing, pending tuning evidence - 2c and lever row 4: bit-identical at kernel level on synthetic activations, one layer; the end-to-end bitwise probe has not run (first attempt failed before serving) and is queued; both one_batch arms aborted on the patched engine, stock not tried. - Lever row 2: Triton attention for the target is pending bench's equality classification; draft-only Triton is exact. - 2e: SGLang's chunked kernel is not a usable fast path for P7 (synthetic, one layer, one request); a purpose-built kernel is untested. - 2b is marked pending bench's PR #57 and shows the cycle/GPU-busy derivation.
|
Verdict: REQUEST CHANGES Re-reviewed head ed4682d (one commit on f0c13b6). B1-B5 and both suggestions are addressed. What remains is Codex's two P2 comments, which landed after my first review and are not yet addressed, and one mislabelled floor in the new text. Earlier items
BlockingC1. Codex P2: per-point server decode rates come from the whole log (
C2. Codex P2: patch 0009 does not validate
N1. The floor in the new text is mislabelled, and the pair it cites does not isolate Triton (section 2d, last paragraph, and row 2).
Merge noteThe "Pending bench's PR #57" paragraph in section 2b should come out when this rebases after #57 merges, so that main does not say "not merged yet". Otherwise main ends up with a stale pending note about an evidence directory it already contains. |
…Triton pair wording - summarise.py sweeps takes each point's server_log.logged_gen_tps_full_batch_p50 instead of parsing the whole server log, so drain-phase rates no longer leak into lower concurrencies; it also reports TTFT and ITL p50/p99. host_levers.csv regenerated. - Patch 0009: SGLANG_GDN_EXACT_REPLAY_BV must be a positive power of two (ValueError otherwise); tests cover the default, an override and rejected values. The 9-patch series still reproduces the engine branch tree. - 2d and lever row 2: the 3.42/1K floor is plain decoding at client concurrency 1 vs 32, and bench's 3.80/1K pair combines Triton with ReplaySSM-spec, so it does not isolate Triton.
|
Verdict: REQUEST CHANGES Re-reviewed head 8585e67 (one commit on ed4682d). C1, C2 and N1 are fixed. #57 has now merged (feba087), so one edit is left before merge: the pending note about it. Fixed in 8585e67
Blocking (merge-time edit)
|
|
Verdict: APPROVE Approving head 2d3a0c0. It sits on 8585e67 (C1, C2 and N1, reviewed above) plus two commits:
All items from the three rounds are closed:
The integrator's six checks hold:
|
Address review B1 on #64. Merged evidence does not support the "exact up to the noise floor" class for replayed verification. Moonshot lever 5 (#60) calls it pending, with a mechanism that suggests lossy, because its verify outputs come from a chunked transform on TF32 tensor cores. bench/arms.toml (#57) also marks those arms lossy = "pending". The levers table's class and footnote and the chosen-arms sentence now say this. Triton attention for the target changes the target's arithmetic, as ruled in #60, so the Triton arms and the attention-backend lever are pending too, and bench-equality covers them.
Appendix E: integrate the moonshot phase-3 results (#60)
Moonshot Phase 2, first results: the strict write-avoiding GDN decode (P4) is bit-identical
to SGLang's packed decode, the speculative host gap has a configuration-level fix worth
1.18x at c = 1, and block-parallel GDN verification (P7) fails its first rejection tests
with SGLang's existing kernel. Also the review follow-ups from #27/#44.
Results (details and tables in
evidence/moonshot/README.md2b-2e)q/k/v/a/b and prefilled state, the checkpoint's A_log/dt_bias), one layer at a time
(layer 0 at L = 4 and 16, layer 20 at L = 4): 0 of 201,326,592 state words and 0 of
1,572,864 output words differ from the packed decode at every step
(
gdn_exact_replay_check_*.json). The end-to-end bitwise probe has not run yet (its firstattempt failed before serving) and is queued. ReplaySSM on the same inputs differs in 465k
output words. Kernel time 1.22x at B = 128 and 256 with L = 4 (
gdn_exact_replay_bench.json);longer rings lose to replay compute. Derived end-to-end gain ~1.08x at B = 128, below the
pre-registered 1.10x gate (derived); the server-side paired A/B with 2,048-token prompts is
pending (run_p4b.sh). The one_batch attempt aborted in both arms (patched engine, exact
replay off in the base arm; stock not tried): a 262k-token single prefill hits an illegal
memory access in
fused_qk_gemma_rmsnorm_rope_gate.--attention-backend tritonfor target and draft gives 1.18x at c = 1and 1.14x at c = 4 (class pending bench's equality classification, since it changes the
target's attention arithmetic); Triton for the draft only gives 1.08x / 1.06x and is
exact; the plan-stream arm
fails on the GDN hybrid (
update_verify_buffers_to_fill_after_draftnot implemented)(
host_levers.csv).one request): it disagrees with the recurrent path in 52-55% of BF16 output words and is
slower than the recurrent verify for T = 4-256 (
p7_fast_verify_check.json,p7_verify_width_bench.json). A purpose-built block-parallel kernel is untested.evidence/bench/tuning/points.csv): from bench's tuning throughput, the MTPcycle at c = 128 is 35-44 ms against ~13-22 ms of derived components; snapshot-free verify
beyond ReplaySSM-spec would be worth ~4% of it, so it is not built.
97.5% for 4k / 8k / 16k / 22.9k rows (
token_map_coverage.csv); newhot23klever.Review follow-ups
evidence/profiles/(merged in Profile SGLang decode and MTP on GH200: attribution, head baseline, bytes per step #13);the bandwidth is described as the 4 GiB sweep's configuration reused at the head's size.
Tooling
lever_sweep.py --stream-interval,--workload,--warmup-pool;summarise.py sweepsreports each point's server-logged full-batch decode rate (bench's per-point log segment),
TTFT and ITL p50/p99 and foreign CPU beside client throughput;
summarise.py paired-sweepsfor A B B A comparisons;make_long_prompts.py.SGLANG_GDN_EXACT_REPLAY_BV(exact-replay value tile, default 32; apositive power of two, anything else raises).
Testing
pre-commit runon the changed files passes.tests/test_gdn_exact_replay.py(3 bitwise tests passed on the GH200 in the P4 hold; the6 BV-validation tests pass) and
tests/test_moonshot_levers.py(5 passed in the SGLang venv).git amonbd66ce343eand reproduces the branch tree.