Skip to content

Commit 59833c4

Browse files
authored
revert(agentx): restore legacy AIPerf integration (#2398)
Revert PR #2395 after upstream AIPerf 0.12 emitted empty message content during Weka warmup replay, causing Kimi K3 vLLM requests to fail with HTTP 400. 中文:回退 PR #2395,恢复旧版 AIPerf 集成。上游 AIPerf 0.12 在 Weka 预热回放中生成了空消息内容,导致 Kimi K3 vLLM 请求返回 HTTP 400。
1 parent 69af6a4 commit 59833c4

16 files changed

Lines changed: 53 additions & 36 deletions

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[submodule "utils/aiperf"]
22
path = utils/aiperf
33
url = https://github.com/SemiAnalysisAI/aiperf.git
4-
branch = main
4+
branch = cquil11/aiperf-agentx-v1.0

benchmarks/benchmark_lib.sh

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,14 +1729,19 @@ resolve_trace_source() {
17291729
build_replay_cmd() {
17301730
# aiperf invocation for the inferencex-agentx-mvp scenario.
17311731
#
1732-
# Weka replay uses recorded assistant responses when constructing future
1733-
# prompts, preserving the captured hash-id and KV-prefix structure.
1732+
# Pre-canned assistant replay is the default: recorded assistant responses
1733+
# are used for future prompt construction, and live server responses are
1734+
# discarded. Set AIPERF_DATASET_WEKA_LIVE_ASSISTANT_RESPONSES=1 explicitly
1735+
# to use live-assistant mode, where the loader emits user-only deltas and
1736+
# the worker threads the server's live assistant response back into the
1737+
# session.
17341738
#
17351739
# The scenario plugin locks: --cache-bust first_turn_prefix and
1736-
# --system-idle-gap-cap-seconds 10. The global cap advances all pending
1737-
# timers only when the whole replay is idle; per-trace think times remain
1738-
# unchanged. The scenario forbids the old per-trace and per-turn delay
1739-
# caps. See utils/aiperf/docs/tutorials/agentx-mvp.md.
1740+
# --trace-idle-gap-cap-seconds 10 (per-trace idle-gap compression
1741+
# against parent + subagent request-start timestamps; supersedes the
1742+
# legacy --use-think-time-only / --inter-turn-delay-cap-seconds path),
1743+
# and auto-injects them — so we do not pass them. See
1744+
# utils/aiperf/docs/tutorials/agentx-mvp.md.
17401745
local result_dir="$1"
17411746
local duration="$DURATION"
17421747
local cache_warmup_duration="${AIPERF_AGENTIC_CACHE_WARMUP_DURATION:-600}"
@@ -1749,6 +1754,7 @@ build_replay_cmd() {
17491754
cache_warmup_duration=300
17501755
fi
17511756

1757+
export AIPERF_DATASET_WEKA_LIVE_ASSISTANT_RESPONSES="${AIPERF_DATASET_WEKA_LIVE_ASSISTANT_RESPONSES:-0}"
17521758
# Dataset configuration (load + reconstruct + inputs.json + mmap)
17531759
# routinely takes 4-5 min for the Weka corpus on fast /tmp
17541760
# (B300) but can stretch to 14 min on slower /tmp + parallel contention
@@ -1778,14 +1784,6 @@ build_replay_cmd() {
17781784
# least one profile turn after warmup.
17791785
REPLAY_CMD+=" --trajectory-start-min-ratio 0.25"
17801786
REPLAY_CMD+=" --trajectory-start-max-ratio 0.75"
1781-
# Preserve the existing InferenceX traffic shape when moving to upstream
1782-
# aiperf: start all configured warmup/profiling lanes immediately instead
1783-
# of spreading their first requests by the recorded offset around t*.
1784-
REPLAY_CMD+=" --burst-phase-starts"
1785-
# Filtering can leave fewer Weka roots than requested concurrency. Reuse
1786-
# roots with independent replay points and cache-bust identities, matching
1787-
# the previous fork behavior instead of failing oversubscription.
1788-
REPLAY_CMD+=" --allow-dataset-wrap"
17891787
# After the normal t* snapshot warmup, continue those exact trajectories
17901788
# with one-token outputs and no idle delays. Profiling begins only after
17911789
# those requests drain and resumes from the resulting live state.
@@ -1803,13 +1801,22 @@ build_replay_cmd() {
18031801
# CPU on minimax-m2.5 at high concurrency. Lossless for vLLM (server
18041802
# usage is authoritative).
18051803
REPLAY_CMD+=" --use-server-token-count"
1806-
# Current Dynamo routers use session-affinity headers rather than the
1807-
# retired nvext.session_control request body. Stamp the stable correlation
1808-
# ID onto every root/child request; router-side TTLs live in the recipes.
1809-
# Individual recipes can explicitly disable the header.
1810-
if [[ "${FRAMEWORK:-}" == dynamo-* &&
1811-
-z "${AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID+x}" ]]; then
1812-
export AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID=true
1804+
# Dynamo's KV router needs an explicit conversation session binding to
1805+
# keep later turns on the prefill worker that owns their prefix blocks.
1806+
# X-Correlation-ID is useful tracing metadata but does not establish that
1807+
# binding by itself. AIPerf emits nvext.session_control bind/close actions
1808+
# keyed by the stable conversation correlation ID when this flag is set.
1809+
# Opt-out: recipes set AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING=0 to skip this.
1810+
# aiperf's conv-aware routing emits nvext.session_control, a removed POC field
1811+
# (dynamo #9920 / v1.3.0-dev) that current dynamo builds reject with a 400
1812+
# (they moved to router/routing_constraints/agent_context). Default stays on.
1813+
if [[ "${FRAMEWORK:-}" == dynamo-* && "${AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING:-1}" != "0" ]]; then
1814+
REPLAY_CMD+=" --use-dynamo-conv-aware-routing"
1815+
# The upstream 300s affinity TTL is shorter than an overloaded
1816+
# high-concurrency agentic request. Keep bindings alive across long
1817+
# prefills, generation, and capped inter-turn delay. This controls the
1818+
# router's inactivity lease; it does not relax HTTP/request failures.
1819+
REPLAY_CMD+=" --dynamo-session-timeout-seconds ${AIPERF_DYNAMO_SESSION_TIMEOUT_SECONDS:-3600}"
18131820
fi
18141821
# Disable DCGM GPU telemetry collection. aiperf's GpuMetricTimeSeries
18151822
# freezes its metric schema on the first DCGM scrape, then KeyErrors when

benchmarks/multi_node/amd_utils/server_sglang.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ if [ "$NODE_RANK" -eq 0 ]; then
988988
WEKA_LOADER_OVERRIDE AIPERF_FAILED_REQUEST_THRESHOLD \
989989
AIPERF_AGENTIC_CACHE_WARMUP_DURATION AIPERF_UNSAFE_OVERRIDE \
990990
AIPERF_TRAJECTORY_START_MIN_RATIO AIPERF_TRAJECTORY_START_MAX_RATIO \
991-
ROUTER_PORT TQDM_MININTERVAL; do
991+
AIPERF_DATASET_WEKA_LIVE_ASSISTANT_RESPONSES ROUTER_PORT TQDM_MININTERVAL; do
992992
if [[ -n "${!_v+x}" ]]; then
993993
_val="${!_v}"
994994
# docker --env-file requires one KEY=VALUE per line with no

benchmarks/multi_node/srt-slurm-recipes/sglang/deepseek-v4/agentic/agg-gb300-tp4-mtp-kvoffload.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,16 @@ benchmark:
139139
# in process_agentic_result.py instead. TP must match sglang_config tp-size.
140140
IS_MULTINODE: "false"
141141
TP: "4"
142-
# Enable header-based Dynamo session affinity so multi-turn requests retain
143-
# KV locality. The retired nvext.session_control body is not used.
144-
AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID: "true"
142+
# Enable dynamo conv-aware routing (per-session affinity so multi-turn
143+
# KV cache is reused across turns). Previously opted out because the
144+
# frontend 400'd on aiperf's nvext.session_control actions; re-enabled
145+
# to test with the current build.
146+
AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING: "1"
145147
# Container-side path of the aiperf mmap dataset cache; host-side mount
146148
# wired via launch_gb300-*.sh srtslurm.yaml default_mounts. Without it,
147149
# aiperf re-tokenizes + re-writes the dataset mmap on every run.
148150
AIPERF_DATASET_MMAP_CACHE_DIR: "/aiperf_mmap_cache"
149151
# Persistent HF hub cache (also via default_mounts) so the trace dataset
150152
# isn't re-downloaded each run; overrides the workflow-level HF_HUB_CACHE.
151153
HF_HUB_CACHE: "/hf_hub_cache"
154+

benchmarks/multi_node/srt-slurm-recipes/sglang/deepseek-v4/agentic/disagg-gb300-12p4d-dep8-dep16-c1024-mtp-kvoffload.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ benchmark:
206206
RESULT_DIR: /logs/agentic
207207
PORT: "8000"
208208
IS_MULTINODE: "true"
209-
AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID: "true"
209+
AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING: "1"
210210
AIPERF_DATASET_MMAP_CACHE_DIR: "/aiperf_mmap_cache"
211211
HF_HUB_CACHE: "/hf_hub_cache"
212+

benchmarks/multi_node/srt-slurm-recipes/sglang/deepseek-v4/agentic/disagg-gb300-2p1d-dep8-tp4-c8-mtp-kvoffload.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ benchmark:
205205
RESULT_DIR: /logs/agentic
206206
PORT: "8000"
207207
IS_MULTINODE: "true"
208-
AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID: "true"
208+
AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING: "1"
209209
AIPERF_DATASET_MMAP_CACHE_DIR: "/aiperf_mmap_cache"
210210
HF_HUB_CACHE: "/hf_hub_cache"
211+

benchmarks/multi_node/srt-slurm-recipes/sglang/deepseek-v4/agentic/disagg-gb300-2p4d-dep8-dep16-c256-mtp-kvoffload.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ benchmark:
206206
RESULT_DIR: /logs/agentic
207207
PORT: "8000"
208208
IS_MULTINODE: "true"
209-
AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID: "true"
209+
AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING: "1"
210210
AIPERF_DATASET_MMAP_CACHE_DIR: "/aiperf_mmap_cache"
211211
HF_HUB_CACHE: "/hf_hub_cache"
212+

benchmarks/multi_node/srt-slurm-recipes/sglang/deepseek-v4/agentic/disagg-gb300-4p4d-dep8-dep16-c256-mtp-kvoffload.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ benchmark:
206206
RESULT_DIR: /logs/agentic
207207
PORT: "8000"
208208
IS_MULTINODE: "true"
209-
AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID: "true"
209+
AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING: "1"
210210
AIPERF_DATASET_MMAP_CACHE_DIR: "/aiperf_mmap_cache"
211211
HF_HUB_CACHE: "/hf_hub_cache"
212+

benchmarks/multi_node/srt-slurm-recipes/sglang/deepseek-v4/agentic/disagg-gb300-6p4d-dep8-dep16-c512-mtp-kvoffload.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ benchmark:
206206
RESULT_DIR: /logs/agentic
207207
PORT: "8000"
208208
IS_MULTINODE: "true"
209-
AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID: "true"
209+
AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING: "1"
210210
AIPERF_DATASET_MMAP_CACHE_DIR: "/aiperf_mmap_cache"
211211
HF_HUB_CACHE: "/hf_hub_cache"
212+

benchmarks/multi_node/srt-slurm-recipes/vllm/deepseek-v4/agentic/agg-gb300-tp4-mtp-agentic.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ benchmark:
140140
RESULT_DIR: "/logs/agentic"
141141
PORT: "8000"
142142
IS_MULTINODE: "true"
143-
AIPERF_HTTP_X_DYNAMO_SESSION_ID_FROM_CORRELATION_ID: "false"
143+
AIPERF_USE_DYNAMO_CONV_AWARE_ROUTING: "0"
144144
AIPERF_AGENTIC_CACHE_WARMUP_DURATION: "600"
145145
AIPERF_DATASET_MMAP_CACHE_DIR: "/aiperf_mmap_cache"
146146
HF_HUB_CACHE: "/hf_hub_cache"

0 commit comments

Comments
 (0)