Repository navigation
Diagnose the high-concurrency streaming limit, stream every 4 tokens, record host load - #46
Conversation
bench.frontend launches one server and runs the same load point with several aiperf client settings (per-chunk usage off, records-only export, more workers, non-streaming). Every point now also records the server's own decode rate at full batch from its log, and the client settings used, so the client-observed throughput can be compared with what the GPU sustained and a saturated process is visible in the CPU peaks.
…aselines # Conflicts: # tests/test_bench_harness.py
With one-token chunks SGLang's tokenizer-manager process saturates one core and limits plain decoding at high concurrency. At c=256 on a quiet host the client saw 15.4K tok/s against 18.0K of server-side decode; with --stream-interval 4 the process drops to 0.35 cores and the client sees 16.5K, as with a non-streaming client. The first token is still streamed at once, so TTFT and the last-chunk time behind x and y are unchanged.
At c=256 on a quiet host the tokenizer-manager process saturates one core with one-token chunks; streaming every 4 tokens restores the non-streaming throughput. The earlier 5-6K tok/s probe readings were CPU contention.
bench/hostload.py samples, once per second, the CPU used by every process outside the run's own process tree (server, client, evaluator), and summarises mean, maximum, the busiest foreign processes and the run's own busiest processes. Sweep points and quality runs store the summary; a sweep point whose mean foreign load exceeds 2 cores gets the invalid reason host_contention and stays out of the frontier. Points still wait for a quiet host before they start. The module also wraps any command (python -m bench.hostload record --out load.json -- cmd ...) and can block until the host is quiet, for other workstreams' timed runs. It replaces the session-based sampler in server.py.
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: e9650777c4
ℹ️ 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".
| fe --arm plain --label fe-plain --variants default records-only workers-64 non-streaming | ||
| fe --arm plain --label fe-plain-incremental --set incremental-streaming-output=true --variants default | ||
| fe --arm plain --label fe-plain-interval4 --set stream-interval=4 --variants default |
There was a problem hiding this comment.
Restore the one-token control in the diagnostic
When this campaign is rerun, --arm plain already inherits stream-interval = 4 from the newly changed bench/arms.toml, so the fe-plain control on line 14 and the explicit interval-4 treatment on line 16 use the same server setting. The incremental and worker comparisons likewise no longer match the documented one-token baseline, meaning a fresh run cannot reproduce the experiment that justified changing the default. Explicitly set stream-interval=1 for the control-side runs.
Useful? React with 👍 / 👎.
|
Verdict: REQUEST CHANGES Reviewed head e965077 (0 behind main). The diagnosis is sound, the stream-interval claim holds in SGLang's code at the pin, and the host-load sampler excludes the run's own processes. One Codex comment on this PR is correct and not yet addressed, so it blocks. BlockingB1. The diagnostic campaign no longer has a one-token control (
Checked and correct
Suggestions (not blocking)
|
- Foreign load is now the host's total busy CPU time from /proc/stat minus the run's own process tree, so processes that start and exit within a sampling interval (builds, hooks, compiles) are counted. The per-process lists remain as diagnostics. Test: a short-lived burner outside the tree is counted although it never appears in a per-process snapshot. - The frontend diagnostic pins --stream-interval 1 on its one-token control runs, since the arms now default to 4; the failed MTP comparison is dropped from it. - Campaign scripts source the repository's sglang_env.sh relative to their own location; the 2-core contention threshold is documented as heuristic.
|
Verdict: APPROVE This re-review covers head 29db238. B1 and Codex's P2 are fixed.
Two notes, not blocking:
|
…nel contract The paper now argues in dependency order: setting and what the stock engine computes, the five contracts and the R-stock gap and interval theorems, the certified low-precision head with its measured candidate sets and fallback shares, sampled decisions, transport and its measured failure, exactness under speculation, the stack, drafting and repair hypotheses, the serving protocol, related work, and a discussion that merges the hypothesis and failure tables. Secondary derivations, untested mechanisms, engine notes, CPU evidence, reproduction and attribution move to appendices. Evidence paths, pull request numbers and pending work move to an evidence register and a development record (Appendix A); the text cites [En] for committed evidence and [pending Dn] for designed work, with the scientific status in the prose. Integrates merged evidence: H2 on DFlash-4B (#35) and MTP-4B (#47), the overlapped roofline (#44), the frontend diagnosis (#46), the fifth contract witness (#41) and the precision counts after #43. Folds in the Codex items on #21 (quantiles over all rows), #32 (pooled tau, GSM8K series) and #36. Typography: Charter text, a plain title block with the repository URL, greyscale-safe figures, a new mechanism figure (Figure 1) replacing three overlapping flowcharts, a drift figure and transport table, two-panel candidate and acceptance figures, and tables reorganized instead of shrunk.
This PR fixes how the harness measures high-concurrency serving: it finds what limited streamed throughput, applies the fix to every arm, and makes host CPU load part of every timed run's record.
Frontend diagnosis (evidence/bench/frontend/)
Earlier probes showed clients at c=256-1,024 receiving 5.6-6.6K tok/s while the server's log reported ~16K tok/s of decode.
bench/frontend.pylaunches one server and runs the same point with several client settings, recording for each the client's y, the server's own decode rate while the full batch runs (from its log) and the busiest processes. Plain decoding, c=256, quiet host (other processes at most 0.54 cores):--incremental-streaming-output--stream-interval 4SGLANG_RUST_SERVER=1launch_servermain process: HTTP plus the OpenAI serving layer), at one full core with one-token chunks. aiperf's timing manager is also near one core.stream-interval = 4inbench/arms.tomldefaults, so every arm streams every 4 tokens. The tokenizer manager drops to 0.35 cores and the client gets the non-streaming throughput. SGLang still streams the first token at once, so TTFT and the last-chunk time that define x and y are unchanged.Host load is now part of every timed run
bench/hostload.pysamples, once per second, the CPU used by processes outside the run's own process tree (server, client, evaluator) and summarises mean, maximum, the busiest foreign processes and the run's own busiest processes.point.jsonhost_load,quality.jsonhost_load).host_contentionand stays out of the frontier. Points still wait for a quiet host before starting.python -m bench.hostload record --out load.json -- <cmd>) and can block until the host is quiet (python -m bench.hostload wait).server.py, which missed servers that start their own session.Committed timed points re-examined
The frontend points ran with at most 0.54 foreign cores. The two plain-decoding probe rows predate load recording and ran beside a 41-47-core job; the README labels them contaminated. The MTP and tree probes ran at 0.19-0.39 foreign cores. The natural-length run (24 foreign cores) is a length measurement, not a timing, and is labelled so.
Also here
bench/sweep.pygains--no-streamingand--aiperf-workers(diagnostic use) and records the server's full-batch decode rate from its log on every point.bench/campaigns/frontend_diagnostic.shruns the diagnosis, including a 20-problem quality-pipeline smoke. Result of the smoke: 18/20 correct, mean 5,264 completion tokens, 2 of 20 at the 16,384-token cap even under sampling.Validation
pytest tests/test_bench_harness.py: 25 passed. Tests cover the process-tree exclusion, the contention summary, the host_contention invalid reason and the loop detector.