diff --git a/inferencex-e2e/infx/bench/agentic/replay.py b/inferencex-e2e/infx/bench/agentic/replay.py index 221677330d..a78787d8a7 100644 --- a/inferencex-e2e/infx/bench/agentic/replay.py +++ b/inferencex-e2e/infx/bench/agentic/replay.py @@ -52,6 +52,8 @@ class ReplayConfig: dataset: str apply_chat_template: bool benchmark_grace_period: str | None + slice_duration: str | None + """``AIPERF_SLICE_DURATION``: timeslice width in seconds; unset leaves the scenario default.""" @classmethod def from_env(cls, env: Mapping[str, str], result_dir: Path) -> ReplayConfig: @@ -98,6 +100,7 @@ def from_env(cls, env: Mapping[str, str], result_dir: Path) -> ReplayConfig: dataset=dataset, apply_chat_template=env.get("AIPERF_APPLY_CHAT_TEMPLATE") == "true", benchmark_grace_period=inputs.optional("AIPERF_BENCHMARK_GRACE_PERIOD", env), + slice_duration=inputs.optional("AIPERF_SLICE_DURATION", env), ) @@ -164,4 +167,6 @@ def replay_argv(cfg: ReplayConfig, cli: str | Path) -> list[str]: argv.append("--apply-chat-template") if cfg.benchmark_grace_period is not None: argv += ["--benchmark-grace-period", cfg.benchmark_grace_period] + if cfg.slice_duration is not None: + argv += ["--slice-duration", cfg.slice_duration] return argv diff --git a/inferencex-e2e/infx/tests/bench/test_agentic_replay.py b/inferencex-e2e/infx/tests/bench/test_agentic_replay.py index 46eb7d2163..1b588a5a19 100644 --- a/inferencex-e2e/infx/tests/bench/test_agentic_replay.py +++ b/inferencex-e2e/infx/tests/bench/test_agentic_replay.py @@ -62,6 +62,7 @@ def test_opt_in_inputs_add_their_flags_in_place(): WEKA_LOADER_OVERRIDE=traces.UNCAPPED, AIPERF_APPLY_CHAT_TEMPLATE="true", AIPERF_BENCHMARK_GRACE_PERIOD="1800", + AIPERF_SLICE_DURATION="3600", ) assert argv == [ @@ -77,6 +78,7 @@ def test_opt_in_inputs_add_their_flags_in_place(): "--output-artifact-dir", "/results/aiperf_artifacts", "--public-dataset", traces.UNCAPPED, "--apply-chat-template", "--benchmark-grace-period", "1800", + "--slice-duration", "3600", ] # fmt: skip