Repository navigation
[FEAT] Add GuideLLM trace replay benchmark profile - #38
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new GuideLLM trace replay benchmark mode to auto-tune-vllm, introducing a small “benchmark profile” abstraction so the existing concurrent GuideLLM path can remain unchanged while enabling production-like traffic replay from trace files.
Changes:
- Introduces
BenchmarkProfileabstraction withConcurrentProfileandReplayProfile, plus a newGuideLLMTraceReplayBenchmarkprovider that appends replay-specific--data/--data-loaderargs. - Updates benchmark config schema to support
benchmark.profile, normalizesbenchmark_type→ profile kind, and widensbenchmark.ratetoOptional[float]with profile-specific defaults. - Adds tests, documentation, and an end-to-end example config + sample trace dataset.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/benchmarks/test_guidellm_trace_replay.py | Adds unit tests for replay config normalization/validation and CLI construction. |
| tests/benchmarks/test_guidellm_command.py | Adds a test for concurrent default rate when omitted. |
| examples/trace_replay/sample.jsonl | Adds a synthetic JSONL trace used by the replay example. |
| examples/study_config_trace_replay.yaml | Adds an end-to-end study config example using guidellm_trace_replay. |
| docs/configuration.md | Documents the new benchmark type, profile schema, and replay-specific fields/semantics. |
| auto_tune_vllm/execution/trial_controller.py | Dispatches guidellm_trace_replay to the new provider. |
| auto_tune_vllm/core/config.py | Adjusts baseline concurrency defaults for replay vs concurrent benchmarks. |
| auto_tune_vllm/benchmarks/trace_replay.py | Implements the GuideLLMTraceReplayBenchmark provider. |
| auto_tune_vllm/benchmarks/providers.py | Refactors GuideLLM command construction into base + data-args appenders. |
| auto_tune_vllm/benchmarks/profiles.py | Adds profile classes and replay --data CLI rendering. |
| auto_tune_vllm/benchmarks/config.py | Adds benchmark.profile, profile normalization, and rate defaulting/validation. |
| auto_tune_vllm/benchmarks/init.py | Exports new profile/provider symbols. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
3 tasks done
VincentG1234
added a commit
that referenced
this pull request
Jul 21, 2026
## Summary Add optional `benchmark.prewarm` for `guidellm_trace_replay`: a short concurrent GuideLLM run before the replay benchmark so vLLM kernel autotuners (CUDA graphs, torch.compile, etc.) can settle before timed trace requests. ## Why Trace replay measures inter-arrival timing faithfully, but the first requests after vLLM startup can pay one-time kernel compilation and graph-capture costs. That skews early replay metrics unless the server is warmed up separately. `benchmark.warmup` does not apply to the replay profile, so this adds a dedicated pre-run phase. ## What changed - `auto_tune_vllm/benchmarks/config.py` — `benchmark.prewarm` field with validation (`duration`, `concurrency`; trace replay only) - `auto_tune_vllm/benchmarks/profiles.py` — derive prompt/output token mean+stdev from local trace files; `render_prewarm_args()` for synthetic concurrent prewarm data - `auto_tune_vllm/benchmarks/trace_replay.py` — run prewarm subprocess before replay; fail the trial on prewarm error/timeout/cancellation - `auto_tune_vllm/benchmarks/providers.py` — optional `log_path` on `_launch_subprocess()` for separate prewarm logs - `tests/benchmarks/test_guidellm_trace_replay.py` — config validation, token-stat derivation, CLI args, failure/timeout behavior - `docs/configuration.md` — Prewarm section under trace replay - `examples/study_config_trace_replay.yaml` — commented prewarm example ## How tested - [x] `ruff check .` - [x] `pytest -v tests/` (108 passed) - [x] Manual E2E (maintainer): `auto-tune-vllm optimize` with `examples/study_config_trace_replay.yaml` and `benchmark.prewarm` enabled ## Risks / limitations - Prewarm adds wall time per trial (`duration` seconds + subprocess overhead). - Token statistics are auto-derived from the local trace file; for `hf://` datasets or missing files, falls back to `benchmark.prompt_tokens` / `benchmark.output_tokens` with a warning. ## Links - Follow-up to #38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces a new
guidellm_trace_replaybenchmark type that runs GuideLLM inkind=replaymode, replaying inter-arrival intervals from a JSONL/CSV/Parquettrace file. Refactors GuideLLM CLI construction behind a small
BenchmarkProfileabstraction (concurrent vs. replay) so the existing concurrent path is unchanged.
Why
benchmark_type: "guidellm"only exercises the concurrent profile (fixedstreams=rate). Realistic tuning against production-like traffic needs replayof recorded timestamps + token lengths, not a synthetic constant-concurrency
load. This PR wires GuideLLM's replay profile into auto-tune-vllm with a
dedicated provider, config schema, and baseline handling.
What changed
auto_tune_vllm/benchmarks/profiles.py— new file:BenchmarkProfile,ConcurrentProfile,ReplayProfile,profile_from_dict,render_replay_data_cli.auto_tune_vllm/benchmarks/trace_replay.py— newGuideLLMTraceReplayBenchmarkprovider that reuses the shared base commandand appends replay-specific
--data/--data-loaderargs.auto_tune_vllm/benchmarks/providers.py— split_build_guidellm_commandinto
_build_guidellm_base_command+_append_standard_data_argsso thereplay provider can share the base and swap the data section.
auto_tune_vllm/benchmarks/config.py— addbenchmark.profilefield, add_normalize_benchmark_profile(single source of truth:benchmark_type→profile.kind), validaterate > 0, widenratetoOptional[float]forfractional
time_scalesupport, and add profile-specific defaults via_apply_default_rate: 50 for concurrent profiles, 1.0 (real-time)for trace replay when
rateis omitted.auto_tune_vllm/benchmarks/__init__.py— export new profile / providersymbols.
auto_tune_vllm/core/config.py— new_default_baseline_concurrencyhelperso baselines default to
[1]for trace replay (concurrency doesn't apply)and
[int(rate)]otherwise.auto_tune_vllm/execution/trial_controller.py— dispatchguidellm_trace_replay→GuideLLMTraceReplayBenchmark.tests/benchmarks/test_guidellm_trace_replay.py— new unit tests coveringconfig normalization, validation errors, CLI construction, fractional
rate/time_scaleprecedence, Mooncake fields,data_samples, andreplay default
rate.tests/benchmarks/test_guidellm_command.py— add test for concurrentdefault
rate=50when omitted.docs/configuration.md— documentbenchmark_type: "guidellm_trace_replay",the
benchmark.profileschema, replay-specific field table,rate-as-time_scalefallback, and profile-specific defaultratevalues.examples/study_config_trace_replay.yaml— end-to-end example study usingthe new profile.
examples/trace_replay/sample.jsonl— 247-row (~200 s) synthetic trace forthe example.
How tested
ruff check .pytest -v tests/benchmarks/(32 passed)auto-tune-vllm optimize --study-config examples/study_config_trace_replay.yamlagainst a real vLLM server.Risks / limitations
benchmark.ratewidens frominttoOptional[float]to support fractional
time_scalein replay. Concurrent studies that setrateexplicitly are unaffected; omittedratestill defaults to 50for concurrent profiles and 1.0 for trace replay.