Summary
Two related observations about the weka_trace_replay load type, opening this for discussion:
- A stage only finishes when all loaded sessions run to completion - there is no request-count or duration-based exit. On real traces this means runs measured in many hours, and without clear documentation users may conclude the benchmark is hung.
- Because the session pool is a fixed set with no backfill at the end of the corpus, concurrency decays during the drain-down phase, and throughput is averaged over the full wall-clock span with no steady-state windowing - so the reported numbers understate what the system can do at target concurrency.
1. Exit condition and expected run duration
The session-stage loop exits only when every dispatched session has completed (or failed): run_session_stage in inference_perf/loadgen/load_generator.py (the "All N sessions completed" check). num_sessions defaults to all loaded sessions.
Some napkin math on a real trace file we profiled:
| Stat |
Value |
| traces (sessions) |
393 |
| main turns |
28,444 |
| subagent inner requests |
39,822 |
| total model requests |
68,266 |
| total input tokens |
~6.89B |
| total output tokens |
~58.7M |
Even on a very powerful serving system - e.g. 32 GB200 chips sustaining ~200K tokens/sec with high KV-cache hit rates - the pure token-throughput floor is:
(6,891,228,864 + 58,728,807) tokens / 200,000 tok/s ≈ 34,750 s ≈ 9.7 hours
And that is a floor, not an estimate: turns within a session are strictly sequential (~72 main turns per session on average here), and the replay preserves recorded inter-turn delays via wait_ms (idle gaps capped at trace_idle_gap_cap_seconds, default 60s, which still adds up across tens of thousands of turns).
Nothing in the current docs/weka_trace_replay.md warns about this. A user pointing this datagen at a real trace with default config gets a run that looks stuck for hours.
2. Drain-down tail skews throughput results
should_start_next_session() only backfills the pool while pending sessions remain. Once the corpus is exhausted, active sessions monotonically decrease (e.g. 80 -> 20 -> 1), and since main turns are sequential, a tail session often contributes only ~1 in-flight request. Meanwhile the report computes throughput over the full span from first request start to last request end (summarize_requests in inference_perf/reportgen/base.py):
total_time = max(x.end_time for x in metrics) - min(x.start_time for x in metrics)
output_tokens_per_sec = sum(output_tokens) / total_time
There is no steady-state windowing or warmup/drain-down trimming, so one long tail session (session durations in agentic traces are heavy-tailed) dilutes *_tokens_per_sec and requests_per_sec for the whole stage. Latency percentiles are less affected - if anything the tail sees an unloaded system and improves them.
Related interaction: if num_sessions <= concurrent_sessions, the concurrency cap is inert and the entire run is effectively ramp-down.
Ideas for discussion
- Docs (cheap, high value): add a "Run duration expectations" section to
docs/weka_trace_replay.md with the math above as a worked example, and document the existing bounding knobs: num_sessions, stage timeout (noting the stage reports FAILED but metrics are kept), trace_idle_gap_cap_seconds, num_dataset_entries.
- Steady-state windowing: optionally compute throughput over a trimmed window (e.g. exclude ramp-up/drain-down, or timestamp-based post-filtering guidance using
per_request_lifecycle_metrics).
- Better progress signal: periodic log line with completed/active sessions and a rough ETA so long runs do not look hung.
- Session recycling / backfill option: keep concurrency saturated by reusing corpus sessions (with unique-session ID injection) until a duration or request budget is hit.
Happy to contribute the doc update and discuss the rest.
/kind documentation
/kind feature
Summary
Two related observations about the
weka_trace_replayload type, opening this for discussion:1. Exit condition and expected run duration
The session-stage loop exits only when every dispatched session has completed (or failed):
run_session_stageininference_perf/loadgen/load_generator.py(the "All N sessions completed" check).num_sessionsdefaults to all loaded sessions.Some napkin math on a real trace file we profiled:
Even on a very powerful serving system - e.g. 32 GB200 chips sustaining ~200K tokens/sec with high KV-cache hit rates - the pure token-throughput floor is:
And that is a floor, not an estimate: turns within a session are strictly sequential (~72 main turns per session on average here), and the replay preserves recorded inter-turn delays via
wait_ms(idle gaps capped attrace_idle_gap_cap_seconds, default 60s, which still adds up across tens of thousands of turns).Nothing in the current
docs/weka_trace_replay.mdwarns about this. A user pointing this datagen at a real trace with default config gets a run that looks stuck for hours.2. Drain-down tail skews throughput results
should_start_next_session()only backfills the pool while pending sessions remain. Once the corpus is exhausted, active sessions monotonically decrease (e.g. 80 -> 20 -> 1), and since main turns are sequential, a tail session often contributes only ~1 in-flight request. Meanwhile the report computes throughput over the full span from first request start to last request end (summarize_requestsininference_perf/reportgen/base.py):There is no steady-state windowing or warmup/drain-down trimming, so one long tail session (session durations in agentic traces are heavy-tailed) dilutes
*_tokens_per_secandrequests_per_secfor the whole stage. Latency percentiles are less affected - if anything the tail sees an unloaded system and improves them.Related interaction: if
num_sessions<=concurrent_sessions, the concurrency cap is inert and the entire run is effectively ramp-down.Ideas for discussion
docs/weka_trace_replay.mdwith the math above as a worked example, and document the existing bounding knobs:num_sessions, stagetimeout(noting the stage reports FAILED but metrics are kept),trace_idle_gap_cap_seconds,num_dataset_entries.per_request_lifecycle_metrics).Happy to contribute the doc update and discuss the rest.
/kind documentation
/kind feature