Skip to content

Commit 6a22d43

Browse files
committed
feat: add deterministic agentic warmup budget
Signed-off-by: Cam Quilici <cjquilici@gmail.com>
1 parent d627b8c commit 6a22d43

19 files changed

Lines changed: 794 additions & 24 deletions

docs/cli-options.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,11 @@ The maximum duration in seconds for the warmup phase. If not set, it will use th
11281128
Additional agentic replay warmup duration in seconds. After the normal snapshot warmup drains, AIPerf continues the live trajectories without recorded idle delays and with one-token outputs, then drains and resumes profiling from the resulting trajectory state using each live stream's residual next-turn delay.
11291129
<br/>_Constraints: > 0_
11301130

1131+
#### `--agentic-cache-warmup-requests-per-lane` `<int>`
1132+
1133+
Deterministic agentic cache-pressure warmup request budget per concurrency lane. For example, 10 with concurrency 16 caps warmup at 160 wire requests, including initial snapshot priming. Requires --agentic-cache-warmup-duration, which remains the safety deadline.
1134+
<br/>_Constraints: > 0_
1135+
11311136
#### `--agentic-warmup-grace-period` `<float>`
11321137

11331138
AGENTIC_REPLAY only: grace period in seconds the auto-synthesized warmup barrier waits for in-flight priming requests after the warmup burst sends. The agentic warmup is synthesized from the profiling phase rather than a user-declared warmup phase, so it does NOT honor `--warmup-grace-period` (which requires `--warmup-duration`). If not set, the warmup barrier waits indefinitely until every primed trajectory returns.
@@ -2658,6 +2663,11 @@ The maximum duration in seconds for the warmup phase. If not set, it will use th
26582663
Additional agentic replay warmup duration in seconds. After the normal snapshot warmup drains, AIPerf continues the live trajectories without recorded idle delays and with one-token outputs, then drains and resumes profiling from the resulting trajectory state using each live stream's residual next-turn delay.
26592664
<br/>_Constraints: > 0_
26602665

2666+
#### `--agentic-cache-warmup-requests-per-lane` `<int>`
2667+
2668+
Deterministic agentic cache-pressure warmup request budget per concurrency lane. For example, 10 with concurrency 16 caps warmup at 160 wire requests, including initial snapshot priming. Requires --agentic-cache-warmup-duration, which remains the safety deadline.
2669+
<br/>_Constraints: > 0_
2670+
26612671
#### `--agentic-warmup-grace-period` `<float>`
26622672

26632673
AGENTIC_REPLAY only: grace period in seconds the auto-synthesized warmup barrier waits for in-flight priming requests after the warmup burst sends. The agentic warmup is synthesized from the profiling phase rather than a user-declared warmup phase, so it does NOT honor `--warmup-grace-period` (which requires `--warmup-duration`). If not set, the warmup barrier waits indefinitely until every primed trajectory returns.

docs/tutorials/agentx-mvp.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,16 @@ duration expires, it stops issuing new requests, drains requests already on
417417
the wire, snapshots each live root, subagent, and unresolved join, and starts
418418
profiling from that exact state.
419419

420+
For repeatable warmup depth, also set
421+
`--agentic-cache-warmup-requests-per-lane REQUESTS`. Each concurrency lane is
422+
then allowed exactly that many warmup wire requests, including its initial
423+
snapshot-priming requests. For example, `--concurrency 16` with
424+
`--agentic-cache-warmup-requests-per-lane 10` targets 160 warmup requests,
425+
with a strict 10-request quota on every lane. The duration is still required as
426+
a safety deadline: issuance stops at the per-lane quotas or the duration,
427+
whichever comes first. If the duration wins, a slow run sends fewer than the
428+
configured request budget.
429+
420430
These requests remain part of warmup, so they are excluded from exported
421431
request metrics.
422432

src/aiperf/config/config.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ def validate_cache_bust_compatibility(self) -> Self:
609609
def validate_agentic_cache_warmup(self) -> Self:
610610
"""Restrict accelerated cache warmup to the agentic_replay timing mode.
611611
612-
``--agentic-cache-warmup-duration`` is consumed solely by
612+
``--agentic-cache-warmup-duration`` and its optional deterministic
613+
request budget are consumed solely by
613614
``aiperf.timing.config._build_agentic_warmup_config``, which only runs
614615
when the profiling phases resolve to AGENTIC_REPLAY. On any other run
615616
the value is silently dropped, so an unguarded flag is a no-op the user
@@ -630,27 +631,42 @@ def validate_agentic_cache_warmup(self) -> Self:
630631
from aiperf.timing.config import _is_agentic_replay
631632

632633
profiling_phases = self.get_profiling_phases()
633-
if not any(
634+
has_duration = any(
634635
getattr(phase, "agentic_cache_warmup_duration", None) is not None
635636
for phase in profiling_phases
636-
):
637+
)
638+
has_request_budget = any(
639+
getattr(phase, "agentic_cache_warmup_requests_per_lane", None) is not None
640+
for phase in profiling_phases
641+
)
642+
if not has_duration and not has_request_budget:
637643
return self
638644

645+
if any(
646+
getattr(phase, "agentic_cache_warmup_requests_per_lane", None) is not None
647+
and getattr(phase, "agentic_cache_warmup_duration", None) is None
648+
for phase in profiling_phases
649+
):
650+
raise ValueError(
651+
"--agentic-cache-warmup-requests-per-lane requires "
652+
"--agentic-cache-warmup-duration as a safety deadline."
653+
)
654+
639655
if self.scenario is not None:
640656
from aiperf.common.scenario.registry import get_scenario
641657

642658
scenario_timing_mode = get_scenario(self.scenario).timing_mode
643659
if scenario_timing_mode != TimingMode.AGENTIC_REPLAY:
644660
raise ValueError(
645-
"--agentic-cache-warmup-duration requires the agentic_replay "
661+
"agentic cache warmup requires the agentic_replay "
646662
f"timing mode; scenario {self.scenario!r} locks "
647663
f"timing_mode={scenario_timing_mode}."
648664
)
649665
return self
650666

651667
if not _is_agentic_replay(profiling_phases):
652668
raise ValueError(
653-
"--agentic-cache-warmup-duration requires the agentic_replay "
669+
"agentic cache warmup requires the agentic_replay "
654670
"timing mode (set today by --scenario inferencex-agentx-mvp); "
655671
"the profiling phase(s) are not agentic_replay."
656672
)

src/aiperf/config/flags/_converter_profiling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"burst_phase_starts",
5555
"system_idle_gap_cap_seconds",
5656
"agentic_cache_warmup_duration",
57+
"agentic_cache_warmup_requests_per_lane",
5758
"agentic_warmup_grace_period",
5859
)
5960

src/aiperf/config/flags/cli_config.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,6 +2288,22 @@ def url(self) -> str:
22882288
),
22892289
] = None
22902290

2291+
agentic_cache_warmup_requests_per_lane: Annotated[
2292+
int | None,
2293+
Field(
2294+
gt=0,
2295+
description="Deterministic agentic cache-pressure warmup request "
2296+
"budget per concurrency lane. For example, 10 with concurrency 16 "
2297+
"caps warmup at 160 wire requests, including initial snapshot "
2298+
"priming. Requires --agentic-cache-warmup-duration, which remains "
2299+
"the safety deadline.",
2300+
),
2301+
CLIParameter(
2302+
name=("--agentic-cache-warmup-requests-per-lane",),
2303+
group=Groups.WARMUP,
2304+
),
2305+
] = None
2306+
22912307
agentic_warmup_grace_period: Annotated[
22922308
float | None,
22932309
Field(

src/aiperf/config/phases.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,20 @@ class BasePhaseConfig(AdaptiveScalePhaseMixin, BaseConfig):
364364
),
365365
]
366366

367+
agentic_cache_warmup_requests_per_lane: Annotated[
368+
int | None,
369+
Field(
370+
default=None,
371+
gt=0,
372+
description="AGENTIC_REPLAY only: deterministic cache-pressure "
373+
"warmup request budget per concurrency lane. The total warmup "
374+
"wire-request cap is this value multiplied by the number of live "
375+
"trajectory lanes, including the initial snapshot-priming "
376+
"requests. Requires agentic_cache_warmup_duration, which remains "
377+
"the safety deadline; warmup stops when either limit is reached.",
378+
),
379+
]
380+
367381
agentic_warmup_grace_period: Annotated[
368382
float | None,
369383
Field(

0 commit comments

Comments
 (0)