Skip to content
Closed
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
26 changes: 3 additions & 23 deletions benchmarks/benchmark_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,6 @@ exit_after_background_process_cleanup() {
exit "$final_status"
}

# Finish preflight on every allocated node before any server container starts its
# peer-readiness deadline. A failed node prevents the entire serving step.
run_amd_multinode_after_preflight() {
local nodelist="$1" node_count="$2" preflight_script="$3"
local container_filter="$4" skip_gpu_sanity="$5"
shift 5
local preflight_rc
if srun --nodelist="$nodelist" \
--nodes="$node_count" --ntasks="$node_count" --ntasks-per-node=1 \
--kill-on-bad-exit=1 --unbuffered \
bash "$preflight_script" "$container_filter" "$skip_gpu_sanity"; then
echo "[preflight] all nodes ready; launching server containers"
else
preflight_rc=$?
echo "[preflight][ERROR] node preflight failed; no server containers launched" >&2
return "$preflight_rc"
fi
srun --nodelist="$nodelist" \
--nodes="$node_count" --ntasks="$node_count" --ntasks-per-node=1 \
--kill-on-bad-exit=1 --signal=TERM@30 --unbuffered "$@"
}

# Launchers may load only input validation, without benchmark initialization.
if [[ "${1-}" == "--validation-only" ]]; then
return 0
Expand Down Expand Up @@ -2097,7 +2075,9 @@ run_lm_eval() {
export INFERENCEX_LM_EVAL_RUNTIME_READY=true
fi

local openai_server_base="http://0.0.0.0:${port}"
# A routed eval client may run on a different node from the API server.
local openai_server_host="${EVAL_SERVER_HOST:-0.0.0.0}"
local openai_server_base="http://${openai_server_host}:${port}"
local openai_chat_base="${openai_server_base}/v1/chat/completions"
export OPENAI_API_KEY=${OPENAI_API_KEY}
MODEL_NAME=${MODEL_NAME:-$MODEL} # Prefer MODEL_NAME, else MODEL
Expand Down
193 changes: 0 additions & 193 deletions benchmarks/multi_node/agentic/dsv4_fp4_mi355x_sglang-disagg.sh

This file was deleted.

60 changes: 59 additions & 1 deletion benchmarks/multi_node/agentic_srt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -x
# against the already-ready frontend on the head node.

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

if [[ -n "${SRT_FRONTEND_HOST:-}" ]]; then
Expand Down Expand Up @@ -62,6 +62,61 @@ if [[ "${EVAL_ONLY}" == "true" ]]; then
_wait_for_openai_chat_route --port "$PORT"
fi

# Preserve the legacy DP-attention replay contract. The SGLang router uses this
# header to keep every request in one AgentX correlation tree on a stable DP
# route, which is important for both session continuity and prefix-cache reuse.
if [[ "$FRAMEWORK" == sglang || "$FRAMEWORK" == sglang-disagg ]] && [[ "${PREFILL_DP_ATTN:-false}" == "true" ]]; then
export AIPERF_HTTP_X_SMG_ROUTING_KEY_FROM_CORRELATION_ID=true
fi

# Reset every advertised SGLang worker before each concurrency point, matching
# the retired amd_utils trace replay. /flush_cache covers GPU radix + host
# HiCache; the storage-backend endpoint is best-effort because L3 is optional.
clear_agentic_worker_caches() {
check_env_vars FLUSH_DRAIN_TIMEOUT
local timeout_seconds="$FLUSH_DRAIN_TIMEOUT"
local metrics_csv="${AIPERF_SERVER_METRICS_URLS:-}"
if [[ -z "$metrics_csv" ]]; then
echo "[clear_caches] WARN: AIPERF_SERVER_METRICS_URLS unset; skipping cache flush" >&2
return 0
fi

local -a metrics_urls
IFS=',' read -r -a metrics_urls <<< "$metrics_csv"
local metrics_url base_url start response code flushed
for metrics_url in "${metrics_urls[@]}"; do
[[ -n "$metrics_url" ]] || continue
base_url="${metrics_url%/metrics}"
start=$(date +%s)
flushed=0
response=""
while :; do
response=$(curl -sf -m 10 -X POST "${base_url}/flush_cache" 2>/dev/null || true)
if grep -qi "Cache flushed" <<< "$response"; then
flushed=1
break
fi
if (( $(date +%s) - start >= timeout_seconds )); then
break
fi
sleep 3
done
if (( flushed )); then
echo "[clear_caches] ${base_url}: L1+L2 flushed"
else
echo "[clear_caches] WARN ${base_url}: L1+L2 flush not confirmed after ${timeout_seconds}s" >&2
fi

code=$(curl -s -m 60 -o /dev/null -w '%{http_code}' \
-X POST "${base_url}/hicache/storage-backend/clear" 2>/dev/null || true)
if [[ "$code" == "200" ]]; then
echo "[clear_caches] ${base_url}: L3 store cleared"
else
echo "[clear_caches] ${base_url}: L3 clear http=${code:-000} (optional backend unavailable)"
fi
done
}

wait_for_agentic_servers_idle() {
local timeout_seconds="${AIPERF_DRAIN_TIMEOUT_SECONDS}"
local poll_seconds="${AIPERF_DRAIN_POLL_SECONDS}"
Expand Down Expand Up @@ -144,6 +199,9 @@ for index in "${!CONCURRENCIES[@]}"; do
mkdir -p "$RESULT_DIR"

echo "Running agentic concurrency $concurrency of: ${CONCURRENCIES[*]}"
if [[ "${CLEAR_CACHE_BETWEEN_CONC:-}" == "1" ]]; then
clear_agentic_worker_caches
fi
build_replay_cmd "$RESULT_DIR"
run_agentic_replay_and_write_outputs "$RESULT_DIR"

Expand Down
Loading