Repository navigation
Tune the plain, MTP and DFlash baselines and define the tuned arms - #57
Conversation
With a single draft step SGLang produces the draft token in the draft extend pass and captures no draft-decode graph, so the launch check rejected a valid configuration.
Plain decoding and MTP chains of 2-7 steps with and without the radix cache and with SGLang's buffered GDN verify, at c=1, 8, 32, 128. MTP gains 1.65x at c=1 but falls behind plain from c~32; buffered verify recovers 24% for three steps at c=128. Also adds the next tuning slot's campaign scripts.
The evidence README derives the per-draft-token state snapshot size (50.3 MB) and its write rate at c=128 from measured throughput and acceptance (0.5-0.75 TB/s for MTP chains), labelled as derived. The confirmation sweep adds c=48 and c=96 so the plain/speculative crossover can be located.
With the radix cache off and buffered GDN verify, almost no static memory goes to recurrent state, so SGLang gave ~2M tokens to the target KV cache, allocated the draft's KV for the same token count outside the static pool, and ran out of memory in the first prefill. 1M tokens covers a full batch of 128 at 7.8K tokens each.
…DFlash DFlash block 8 is the strongest speculator at c<=8 (686 tok/s at c=1); plain is best at c=128. Triton attention helps MTP at low concurrency and hurts it at c=128; plain is indifferent. DFlash buffered verify is refused on GDN models. Adds the next slot's campaign (DFlash under both backends, blocks 4 and 16, FA4 draft attention, MTP depth 4 under Triton).
The two appended reruns were edited before bash reached them: the MTP depth-4 rerun was replaced by plain decoding under Triton attention, which the shared-backend question needed more.
Tuned arms (tune split, evidence/bench/tuning/): plain, MTP s3 with buffered GDN verify and DFlash (block 8 with FA4 draft attention; block 16 under Triton at capacity 64), each family with a Triton arm for low concurrency and a FlashInfer arm for high concurrency, all without the radix cache. Arms whose numerics differ from stock (buffered GDN state) are marked pending classification against plain. The confirmation campaign runs six arms per repeat with per-arm concurrency lists; a supplementary campaign covers MTP with stock verify and buffered plain decoding; the quality campaign takes a list of arms.
DFlash under Triton leads at low concurrency (block 16: 851 tok/s at c=1) and loses at high concurrency; FA4 draft attention runs on sm_90 and helps block 8 at every valid point. Three points are invalid for host contention and are excluded from the choices.
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a235363c0d
ℹ️ 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".
| --extra-flags "--disable-radix-cache --attention-backend triton" | ||
| cat > ~/vp-data/bench/equality/pairs.json <<'PAIRS' | ||
| [ | ||
| ["floor: plain c1 vs c32", "plain/c1", "plain/c32"], |
There was a problem hiding this comment.
Link the plain reference runs before comparing
On a fresh output directory, the script never links or copies ~/vp-data/state/runs/plain into $RUNS/plain, although these entries are resolved relative to $RUNS. The comparator silently skips missing paths and exits successfully, so five of the six requested comparisons—including every comparison against plain and the c1-vs-c32 floor—are omitted after the expensive GPU runs. Create the documented link or otherwise point the comparator at the reference runs before invoking it.
Useful? React with 👍 / 👎.
|
Verdict: REQUEST CHANGES Reviewed head a235363 against main at a4fb20f. The tuning data supports most of the configuration choices, and the arm definitions match the tuned launches. Two things block: one Codex finding (the equality campaign never links its reference runs), and several README statements that the committed CSVs contradict. Checked and correct
BlockingB1. The equality campaign never links its reference runs (Codex P1,
B2. Several README statements contradict the committed CSVs (
Suggestions (not blocking)
|
… DFlash b4 - equality_tuned.sh links the reference runs into its runs directory, passes run_matrix.py's flags as --extra-flags=... (argparse read a separate value starting with '--' as a new option, so three of four configurations never ran), reruns only missing configurations, uses pair labels without commas (compare.py writes its table unquoted), and fails if compare.py skips a pair or summary.json lacks one. - bench/divergence.py reports each pair's divergence rate per 1K tokens and its ratio to the plain batch-1 vs batch-32 floor with 95% intervals and the event classes. - Host-load sampling counts the run's own CPU including children reaped within the interval (cutime/cstime); before, CPU of the run's own short-lived processes appeared in the host total but not in the own tree and was counted as foreign, which inflated foreign maxima at c>=32. - New arm dflash-tuned-b4 (block 4, FlashInfer): 8% above block 8 at c=128 on the tune split; the confirmation sweep runs it at c=32-128.
Scope the host-load statement per slot and explain the inflated foreign maxima (own short-lived processes counted as foreign before 567ef70); say which runs lacked the KV cap; use 50.3 MB (48 MiB) for a snapshot; name the metric behind 1.64x; report accept length at c=32 throughout; state that block 4 leads DFlash at c=128 and is now the high-concurrency DFlash arm; give block 16's ratio against its matched Triton baseline (3.35x).
|
Verdict: REQUEST CHANGES Re-reviewed head 5a7fe67 (567ef70 and 5a7fe67 on a235363). B1 and B2 are fixed and the suggestions are taken. Two of the new README sentences contradict the run records, so this round has two small blocking items. Earlier items
Blocking
Suggestions (not blocking)
|
envelope.csv names the best arm per concurrency with its lead over the runner-up; pairs.csv pairs repeats of a test arm with its matched-flag baseline (--pair TEST:BASELINE) and reports y and x_e2e ratios.
…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.
The retraction counter read a metric name SGLang does not export (sglang:num_retracted_reqs_total; the counter is sglang:num_retracted_requests_total), so it always reported zero. Each point now also counts the scheduler's KV retractions in its log segment, and points.csv carries the largest logged running batch and the retractions. README: uncapped KV pools ranged from 54K to 2.12M tokens, not 1.1-2M; MTP s5 with the radix cache was KV-limited at c=128 (123 running, four requests retracted), so the depth comparison rests on the three unaffected pairs. Accept length varies by up to 0.24 for DFlash block 16, not 0.1. Block 4 trails block 8 at c<=32; c=64 was not measured.
|
Addressed in ab3d94b:
While checking (1) I found the harness's retraction counter read a metric name SGLang does not export ( |
|
Verdict: APPROVE Re-reviewed head ab3d94b (a67b792 and ab3d94b on 5a7fe67). Both items from the last round are fixed, and nothing new blocks. Last round's items
Other checks. Not blocking, but fix before
|
|
Verdict: REQUEST CHANGES Addendum: e2cbff4 was pushed after my approval. My approval covers ab3d94b. If #57 merges now, merge it at ab3d94b. e2cbff4 needs one fix first. e2cbff4 ("Draw the envelope over all arms and over stock-arithmetic arms") draws a second Pareto envelope over arms with "blank exactness". It treats an arm as stock-arithmetic when it has no Blocking: Triton target attention would count as stock arithmetic without classification (
The rest of e2cbff4 is fine. The worst class per label is taken over launches, the current |
cf4832e to
ab3d94b
Compare
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 baseline tuning (#57)
This PR tunes the speculative and plain baselines on the tune split and defines the arms that the confirmation sweep, the quality check and every later before/after comparison will use. Confirmation results on the held-out split will come in a separate PR.
How the tuning was done
All runs used the tune split of
mixed-v2, client concurrency 1, 8, 32 and 128,max(32, 4c)measured requests per point, 512 fixed output tokens, greedy decoding with thinking on,--stream-interval 4, and host-load recording. Each configuration ran once. Three slots were used (bench/campaigns/tuning_depth.sh,tuning_knobs_dflash.sh,tuning_backend_dflash.sh), 92 points in all. Three points are invalid for host contention (mean foreign load above 2 cores) and were excluded from every choice. Full tables, invalid points and rejected configurations are in thetuning/section ofevidence/bench/README.md.What decided the configuration
--enable-linear-replayssm-specreplaces the snapshots and gains 24% at c=128 for 3% at c=1. Depth barely matters at low concurrency (s3-s5 within 4%), and s3 is best at high concurrency.z-lab/Qwen3.5-4B-DFlashat a pinned revision) is the strongest speculator at low concurrency. Block 16 under Triton reaches 851 tok/s at c=1, or 957 tok/s per user, 3.4x plain. Block 8 with FA4 draft attention, which runs on sm_90 and helped at every valid point, covers capacity 128. Block 16 cannot fit capacity 128: its 16 verify states per request need about 0.8 GB.tc_piecewiseprefill graphs (torch.compile failure on Qwen3.5);Arms (
bench/arms.toml)plain-tuned/plain-tuned-tritonplain-tuned-replayssm--enable-linear-replayssmmtp-tuned/mtp-tuned-triton--enable-linear-replayssm-spec, FlashInfer / Tritonmtp-stockverifydflash-tuneddflash-tuned-b16The arms with buffered GDN state carry
lossy = "pending ...". Their greedy outputs are being classified against plain with the state workstream's comparator, against the 3.42/1K plain batch-1 vs batch-32 floor (bench/campaigns/equality_tuned.sh, queued). Each one stays on the exact-stack frontier only if it falls within that floor.Other changes
--max-total-tokensat 1M. Without it, radix-off configurations with buffered verify ran out of memory in prefill: SGLang gave about 2M tokens to the target KV cache and then allocated the draft KV outside the static pool.Validation
pytest tests/test_bench_harness.py: 27 passed, including a test for the one-step MTP launch check.--no-strictpassed them too (checked fromlaunch.json).Review round 1
bench/campaigns/equality_tuned.sh): the script links the reference runs and passes--extra-flags=.... The skipped arms had a second cause: argparse read a separate value starting with--as a new option, sorun_matrix.pyexited for three of the four configurations. The script reruns only missing configurations, uses labels without commas (compare.pywrites its table unquoted), and fails if any pair is skipped or missing fromsummary.json.bench/divergence.pyreports each pair's rate and its ratio to the floor with 95% intervals and classes. The rerun is in the queue.dflash-tuned-b4and is in the confirmation plan.