Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The fork baseline is commit [`3c4264d`](https://github.com/InseeFrLab/auto-tunin
### Benchmarking (GuideLLM)

- **`benchmark.warmup` / `benchmark.cooldown`** — exclude cold-start and shutdown phases from reported metrics to reduce variance ([#24](https://github.com/InseeFrLab/auto-tuning-vllm/pull/24))
- **`benchmark.rampup`** — linear load ramp-up duration in seconds before reaching target concurrency
- **`benchmark.sample_requests`** — control per-request samples in benchmark JSON output (default `0` keeps files small; requires GuideLLM `>= 0.5.4`) ([#27](https://github.com/InseeFrLab/auto-tuning-vllm/pull/27))

### Bug fixes
Expand Down
9 changes: 8 additions & 1 deletion auto_tune_vllm/benchmarks/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class BenchmarkConfig:
warmup: Optional[float] = None
cooldown: Optional[float] = None

# GuideLLM ramp-up duration in seconds (linear increase to target rate). Omit to disable.
rampup: Optional[float] = None

# Max detailed request samples stored in benchmark JSON output (GuideLLM --sample-requests).
sample_requests: int = 0

Expand All @@ -42,7 +45,11 @@ class BenchmarkConfig:
logging_level: Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"] = "INFO"

def __post_init__(self) -> None:
for name, value in (("warmup", self.warmup), ("cooldown", self.cooldown)):
for name, value in (
("warmup", self.warmup),
("cooldown", self.cooldown),
("rampup", self.rampup),
):
if value is None:
continue
if value <= 0:
Expand Down
2 changes: 2 additions & 0 deletions auto_tune_vllm/benchmarks/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ def _build_guidellm_command(
cmd.extend(["--warmup", str(config.warmup)])
if config.cooldown is not None:
cmd.extend(["--cooldown", str(config.cooldown)])
if config.rampup is not None:
cmd.extend(["--rampup", str(config.rampup)])

# Add dataset or synthetic data configuration
if config.use_synthetic_data:
Expand Down
10 changes: 10 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,14 @@ When both `warmup` and `cooldown` are fractional, their sum must stay below `1`
#### `cooldown` (number, optional)
GuideLLM cooldown period at the end of the run, also excluded from metrics. Same format as `warmup` (e.g. `0.1` for the last 10%).

#### `rampup` (number, optional)
GuideLLM ramp-up duration in seconds. Requests are spread linearly from zero up to the target concurrency (`rate`) over this period at the start of the benchmark.

- **Seconds**: e.g. `rampup: 10` = 10 seconds to reach full concurrency.
- Omit or set to `null` to disable (GuideLLM default).

Unlike `warmup`, ramp-up requests are included in reported metrics — it controls how load increases, not which phase is measured. See [GuideLLM benchmark docs](https://github.com/vllm-project/guidellm/blob/main/docs/getting-started/benchmark.md).

#### `sample_requests` (integer, optional)
Maximum number of detailed request samples stored in GuideLLM benchmark JSON output (`--sample-requests`). Default: `0` (no per-request samples; keeps result files small). Set to a positive value when you need request-level timings for debugging or deeper analysis. Requires [GuideLLM](https://github.com/vllm-project/guidellm) `>= 0.5.4` (fix for `--sample-requests` in [v0.5.4](https://github.com/vllm-project/guidellm/releases/tag/v0.5.4)).

Expand All @@ -318,6 +326,7 @@ benchmark:
rate: 16
warmup: 0.1
cooldown: 0.1
rampup: 10
# sample_requests: 20 # optional; default 0
```

Expand Down Expand Up @@ -691,6 +700,7 @@ benchmark:
rate: 100
# warmup: 0.1
# cooldown: 0.1
# rampup: 10
# sample_requests: 0 # default; increase to keep detailed request samples in benchmark JSON

logging:
Expand Down
1 change: 1 addition & 0 deletions examples/study_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ benchmark:
# Optional: reduce metric variance (requires recent GuideLLM CLI)
# warmup: 0.1
# cooldown: 0.1
# rampup: 10
# sample_requests: 0 # default; increase to keep detailed request samples in benchmark JSON

logging:
Expand Down
1 change: 1 addition & 0 deletions examples/study_config_minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ benchmark:
output_tokens: 100
# warmup: 0.1
# cooldown: 0.1
# rampup: 10
# sample_requests: 0 # default; increase to keep detailed request samples in benchmark JSON

# No logging section specified - will use console logging only
Expand Down
20 changes: 20 additions & 0 deletions tests/benchmarks/test_guidellm_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,23 @@ def test_fraction_warmup_plus_cooldown_must_leave_measured_window():

def test_mixed_fraction_and_absolute_skips_sum_check():
BenchmarkConfig(model="m", warmup=0.1, cooldown=10)


def test_rampup_included_when_set():
cmd = _build_cmd(rampup=10)
assert cmd[cmd.index("--rampup") + 1] == "10"


def test_rampup_omitted_when_unset():
cmd = _build_cmd()
assert "--rampup" not in cmd


def test_rampup_zero_rejected():
with pytest.raises(ValueError, match="rampup"):
BenchmarkConfig(model="m", rampup=0)


def test_negative_rampup_rejected():
with pytest.raises(ValueError, match="rampup"):
BenchmarkConfig(model="m", rampup=-1)
Loading