Skip to content

Commit 6d439d6

Browse files
committed
feat(amd): refresh shared srt-slurm v2 integration on current InferenceX
1 parent 96bccfe commit 6d439d6

62 files changed

Lines changed: 1104 additions & 9171 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎benchmarks/benchmark_lib.sh‎

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -106,28 +106,6 @@ exit_after_background_process_cleanup() {
106106
exit "$final_status"
107107
}
108108

109-
# Finish preflight on every allocated node before any server container starts its
110-
# peer-readiness deadline. A failed node prevents the entire serving step.
111-
run_amd_multinode_after_preflight() {
112-
local nodelist="$1" node_count="$2" preflight_script="$3"
113-
local container_filter="$4" skip_gpu_sanity="$5"
114-
shift 5
115-
local preflight_rc
116-
if srun --nodelist="$nodelist" \
117-
--nodes="$node_count" --ntasks="$node_count" --ntasks-per-node=1 \
118-
--kill-on-bad-exit=1 --unbuffered \
119-
bash "$preflight_script" "$container_filter" "$skip_gpu_sanity"; then
120-
echo "[preflight] all nodes ready; launching server containers"
121-
else
122-
preflight_rc=$?
123-
echo "[preflight][ERROR] node preflight failed; no server containers launched" >&2
124-
return "$preflight_rc"
125-
fi
126-
srun --nodelist="$nodelist" \
127-
--nodes="$node_count" --ntasks="$node_count" --ntasks-per-node=1 \
128-
--kill-on-bad-exit=1 --signal=TERM@30 --unbuffered "$@"
129-
}
130-
131109
# Launchers may load only input validation, without benchmark initialization.
132110
if [[ "${1-}" == "--validation-only" ]]; then
133111
return 0
@@ -2097,7 +2075,9 @@ run_lm_eval() {
20972075
export INFERENCEX_LM_EVAL_RUNTIME_READY=true
20982076
fi
20992077

2100-
local openai_server_base="http://0.0.0.0:${port}"
2078+
# A routed eval client may run on a different node from the API server.
2079+
local openai_server_host="${EVAL_SERVER_HOST:-0.0.0.0}"
2080+
local openai_server_base="http://${openai_server_host}:${port}"
21012081
local openai_chat_base="${openai_server_base}/v1/chat/completions"
21022082
export OPENAI_API_KEY=${OPENAI_API_KEY}
21032083
MODEL_NAME=${MODEL_NAME:-$MODEL} # Prefer MODEL_NAME, else MODEL

‎benchmarks/multi_node/agentic/dsv4_fp4_mi355x_sglang-disagg.sh‎

Lines changed: 0 additions & 193 deletions
This file was deleted.

‎benchmarks/multi_node/agentic_srt.sh‎

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -x
77
# against the already-ready frontend on the head node.
88

99
source "$(dirname "${BASH_SOURCE[0]}")/../benchmark_lib.sh" --validation-only
10-
check_env_vars INFMAX_CONTAINER_WORKSPACE RESULT_DIR EVAL_ONLY AIPERF_DRAIN_TIMEOUT_SECONDS AIPERF_DRAIN_POLL_SECONDS
10+
check_env_vars INFMAX_CONTAINER_WORKSPACE RESULT_DIR EVAL_ONLY FRAMEWORK AIPERF_DRAIN_TIMEOUT_SECONDS AIPERF_DRAIN_POLL_SECONDS
1111
source "$INFMAX_CONTAINER_WORKSPACE/benchmarks/benchmark_lib.sh"
1212

1313
if [[ -n "${SRT_FRONTEND_HOST:-}" ]]; then
@@ -62,6 +62,61 @@ if [[ "${EVAL_ONLY}" == "true" ]]; then
6262
_wait_for_openai_chat_route --port "$PORT"
6363
fi
6464

65+
# Preserve the legacy DP-attention replay contract. The SGLang router uses this
66+
# header to keep every request in one AgentX correlation tree on a stable DP
67+
# route, which is important for both session continuity and prefix-cache reuse.
68+
if [[ "$FRAMEWORK" == sglang || "$FRAMEWORK" == sglang-disagg ]] && [[ "${PREFILL_DP_ATTN:-false}" == "true" ]]; then
69+
export AIPERF_HTTP_X_SMG_ROUTING_KEY_FROM_CORRELATION_ID=true
70+
fi
71+
72+
# Reset every advertised SGLang worker before each concurrency point, matching
73+
# the retired amd_utils trace replay. /flush_cache covers GPU radix + host
74+
# HiCache; the storage-backend endpoint is best-effort because L3 is optional.
75+
clear_agentic_worker_caches() {
76+
check_env_vars FLUSH_DRAIN_TIMEOUT
77+
local timeout_seconds="$FLUSH_DRAIN_TIMEOUT"
78+
local metrics_csv="${AIPERF_SERVER_METRICS_URLS:-}"
79+
if [[ -z "$metrics_csv" ]]; then
80+
echo "[clear_caches] WARN: AIPERF_SERVER_METRICS_URLS unset; skipping cache flush" >&2
81+
return 0
82+
fi
83+
84+
local -a metrics_urls
85+
IFS=',' read -r -a metrics_urls <<< "$metrics_csv"
86+
local metrics_url base_url start response code flushed
87+
for metrics_url in "${metrics_urls[@]}"; do
88+
[[ -n "$metrics_url" ]] || continue
89+
base_url="${metrics_url%/metrics}"
90+
start=$(date +%s)
91+
flushed=0
92+
response=""
93+
while :; do
94+
response=$(curl -sf -m 10 -X POST "${base_url}/flush_cache" 2>/dev/null || true)
95+
if grep -qi "Cache flushed" <<< "$response"; then
96+
flushed=1
97+
break
98+
fi
99+
if (( $(date +%s) - start >= timeout_seconds )); then
100+
break
101+
fi
102+
sleep 3
103+
done
104+
if (( flushed )); then
105+
echo "[clear_caches] ${base_url}: L1+L2 flushed"
106+
else
107+
echo "[clear_caches] WARN ${base_url}: L1+L2 flush not confirmed after ${timeout_seconds}s" >&2
108+
fi
109+
110+
code=$(curl -s -m 60 -o /dev/null -w '%{http_code}' \
111+
-X POST "${base_url}/hicache/storage-backend/clear" 2>/dev/null || true)
112+
if [[ "$code" == "200" ]]; then
113+
echo "[clear_caches] ${base_url}: L3 store cleared"
114+
else
115+
echo "[clear_caches] ${base_url}: L3 clear http=${code:-000} (optional backend unavailable)"
116+
fi
117+
done
118+
}
119+
65120
wait_for_agentic_servers_idle() {
66121
local timeout_seconds="${AIPERF_DRAIN_TIMEOUT_SECONDS}"
67122
local poll_seconds="${AIPERF_DRAIN_POLL_SECONDS}"
@@ -144,6 +199,9 @@ for index in "${!CONCURRENCIES[@]}"; do
144199
mkdir -p "$RESULT_DIR"
145200

146201
echo "Running agentic concurrency $concurrency of: ${CONCURRENCIES[*]}"
202+
if [[ "${CLEAR_CACHE_BETWEEN_CONC:-}" == "1" ]]; then
203+
clear_agentic_worker_caches
204+
fi
147205
build_replay_cmd "$RESULT_DIR"
148206
run_agentic_replay_and_write_outputs "$RESULT_DIR"
149207

0 commit comments

Comments
 (0)