Skip to content

Commit d4de63d

Browse files
Add Strix Halo/GFX1151 Support (#90)
* feat(benchmark): add Radeon 8060S gfx1151 runners * fix(benchmark): select the radeon8060s runner for gfx1151 f25176b added vllm_radeon8060s.sh / sglang_radeon8060s.sh but ImageSelector.get_runner_type() still only mapped gfx942/gfx950/gfx1100 and raised "No runner type found for gfx1151", so a detected Strix Halo never reached those scripts. Map gfx1151 -> radeon8060s. Tests: parametrized runner mapping extended; new tests/test_gfx1151_runner_selection.py proves arch -> runner -> built-in script (both frameworks, MAGPIE_RUN_PHASE honoured). Full suite 407 passed. * [verified] fix(benchmark): support multi-arch gfx1151 images Map the published ROCm vLLM image for Radeon 8060S and preserve semicolon-delimited build architecture lists in both Radeon runners. Document custom SGLang image requirements and distinguish original qualification from collaborator results. Tests: 470 passed; 63 new container compatibility cases. Coverage 90.06%. Shell syntax, Ruff, CLI smoke, and independent review passed. Existing tests byte-preserved; no new GPU benchmark claimed.
1 parent c695962 commit d4de63d

11 files changed

Lines changed: 608 additions & 4 deletions

‎Magpie/benchmark_images.yaml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Format: framework -> gpu_arch -> docker_image
33
#
44
# GPU Architecture Identifiers:
5-
# AMD: gfx942 (MI300X), gfx950 (MI355X)
5+
# AMD: gfx942 (MI300X), gfx950 (MI355X), gfx1151 (Radeon 8060S)
66
# NVIDIA: sm_80 (A100), sm_90 (H100/H200), sm_100 (B200)
77
#
88
# Usage:
@@ -13,12 +13,15 @@ vllm:
1313
# AMD GPUs
1414
gfx942: "vllm/vllm-openai-rocm:v0.23.0"
1515
gfx950: "vllm/vllm-openai-rocm:v0.23.0"
16+
gfx1151: "vllm/vllm-openai-rocm:v0.23.0"
1617
# NVIDIA GPUs
1718
sm_80: "vllm/vllm-openai:v0.23.0"
1819
sm_90: "vllm/vllm-openai:v0.23.0"
1920
sm_100: "vllm/vllm-openai:v0.23.0"
2021

2122
sglang:
23+
# No default upstream gfx1151 image is qualified here. Use --docker-image
24+
# with a gfx1151-compatible build; do not fall back to an MI30x/MI35x image.
2225
# AMD GPUs
2326
gfx942: "lmsysorg/sglang:v0.5.12-rocm720-mi30x"
2427
gfx950: "lmsysorg/sglang:v0.5.12-rocm720-mi35x"

‎Magpie/modes/benchmark/benchmarker.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@
4848
{
4949
"vllm_mi300x.sh",
5050
"vllm_mi355x.sh",
51+
"vllm_radeon8060s.sh",
5152
"sglang_mi300x.sh",
5253
"sglang_mi355x.sh",
54+
"sglang_radeon8060s.sh",
5355
"atom_mi300x.sh",
5456
"atom_mi355x.sh",
5557
}
@@ -895,8 +897,9 @@ def _execute_local_benchmark_with_reuse(
895897
result.success = False
896898
result.errors.append(
897899
"server_lifecycle requires a Magpie built-in InferenceX benchmark "
898-
"script (vllm_mi300x.sh, vllm_mi355x.sh, sglang_mi300x.sh, "
899-
"sglang_mi355x.sh, atom_mi300x.sh, atom_mi355x.sh). Current "
900+
"script (vllm_mi300x.sh, vllm_mi355x.sh, vllm_radeon8060s.sh, "
901+
"sglang_mi300x.sh, sglang_mi355x.sh, sglang_radeon8060s.sh, "
902+
"atom_mi300x.sh, atom_mi355x.sh). Current "
900903
f"resolved script={script_name}. Set benchmark_script accordingly "
901904
"or omit server_lifecycle."
902905
)

‎Magpie/modes/benchmark/image_selector.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def get_runner_type(self, gpu_arch: Optional[str] = None) -> str:
138138
"gfx942": "mi300x", # MI300X
139139
"gfx950": "mi355x", # MI355X
140140
"gfx1100": "mi325x", # MI325X
141+
"gfx1151": "radeon8060s", # Radeon 8060S (Strix Halo APU, RDNA 3.5)
141142
# NVIDIA GPUs
142143
"sm_80": "a100", # A100
143144
"sm_90": "h100", # H100
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
#!/usr/bin/env bash
2+
###############################################################################
3+
# Copyright (c) 2026 Advanced Micro Devices, Inc. All rights reserved.
4+
#
5+
# See LICENSE for license information.
6+
###############################################################################
7+
#
8+
# Magpie Generic SGLang Benchmark Script for Radeon 8060S / gfx1151
9+
#
10+
# Phases (via MAGPIE_RUN_PHASE): all | server | client (default all).
11+
#
12+
# Remote server (BENCHMARK_BASE_URL): when set, the client phase points
13+
# benchmark_serving at an external SGLang-compatible HTTP endpoint
14+
# instead of localhost:$PORT, and forces PHASE=client (no local server
15+
# launch). See sglang_mi300x.sh for the full contract.
16+
17+
source "$(dirname "$0")/benchmark_lib.sh"
18+
source "$(dirname "$0")/server_cleanup.sh"
19+
# shellcheck source=magpie_bench_remote_compat.sh
20+
source "$(dirname "$0")/magpie_bench_remote_compat.sh"
21+
22+
PHASE="${MAGPIE_RUN_PHASE:-all}"
23+
case "$PHASE" in
24+
all|server|client) ;;
25+
*) echo "ERROR: Invalid MAGPIE_RUN_PHASE='$PHASE'. Must be all|server|client." >&2; exit 2 ;;
26+
esac
27+
28+
if [[ -n "${BENCHMARK_BASE_URL:-}" ]]; then
29+
if [[ "$PHASE" != "client" ]]; then
30+
echo "[sglang_radeon8060s] BENCHMARK_BASE_URL set; forcing PHASE=client (was $PHASE)"
31+
PHASE=client
32+
fi
33+
fi
34+
35+
if [[ "$PHASE" == "server" || "$PHASE" == "all" ]]; then
36+
check_env_vars MODEL TP
37+
fi
38+
if [[ "$PHASE" == "client" || "$PHASE" == "all" ]]; then
39+
check_env_vars MODEL CONC ISL OSL RANDOM_RANGE_RATIO RESULT_FILENAME
40+
fi
41+
42+
for numeric in TP CONC ISL OSL PORT; do
43+
value=${!numeric:-}
44+
if [[ -n "$value" && ! "$value" =~ ^[0-9]+$ ]]; then
45+
echo "ERROR: $numeric must be an unsigned integer, got '$value'." >&2
46+
exit 2
47+
fi
48+
done
49+
50+
if [[ -n "$SLURM_JOB_ID" ]]; then
51+
echo "JOB $SLURM_JOB_ID running on $SLURMD_NODENAME"
52+
fi
53+
54+
if [[ "$PHASE" != "client" ]]; then
55+
hf download "$MODEL" 2>/dev/null || true
56+
fi
57+
58+
# PYTORCH_ROCM_ARCH is build metadata, not a runtime GPU selector. Published
59+
# ROCm images may list multiple targets; preserve a list containing gfx1151.
60+
if [[ -n "${PYTORCH_ROCM_ARCH:-}" && ";$PYTORCH_ROCM_ARCH;" != *";gfx1151;"* ]]; then
61+
echo "ERROR: sglang_radeon8060s requires PYTORCH_ROCM_ARCH=gfx1151 or a semicolon-separated list containing gfx1151." >&2
62+
exit 2
63+
fi
64+
# Retain the default build hint when absent; this does not change kernel dispatch.
65+
if [[ -z "${PYTORCH_ROCM_ARCH:-}" ]]; then
66+
export PYTORCH_ROCM_ARCH=gfx1151
67+
fi
68+
export HSA_ENABLE_SDMA=${HSA_ENABLE_SDMA:-0}
69+
unset HSA_OVERRIDE_GFX_VERSION
70+
71+
# The qualified gfx1151 route uses Triton attention. Current AITER CK prefill
72+
# does not compile for this geometry and AITER paged decode device-asserts.
73+
export SGLANG_USE_AITER=0
74+
unset SGLANG_AITER_MLA_PERSIST
75+
export HYPERLOOM_GFX1151_LOWBIT_BRIDGE=0
76+
77+
WORKSPACE_DIR=${RESULT_DIR:-/workspace}
78+
SERVER_LOG=${SERVER_LOG:-$WORKSPACE_DIR/server.log}
79+
PORT=${PORT:-8888}
80+
81+
if [[ "${PROFILE:-}" == "1" ]]; then
82+
TRACE_DIR="${SGLANG_TORCH_PROFILER_DIR:-$WORKSPACE_DIR/torch_trace}"
83+
mkdir -p "$TRACE_DIR"
84+
export SGLANG_TORCH_PROFILER_DIR="$TRACE_DIR"
85+
fi
86+
87+
# Pin the physically qualified route. Reject rather than silently override it.
88+
DEFAULT_ARGS=("--mem-fraction-static=0.5" "--disable-radix-cache" "--attention-backend=triton" "--disable-cuda-graph")
89+
read -r -a EXTRA_SGLANG_ARGV <<< "${EXTRA_SGLANG_ARGS:-}"
90+
for arg in "${EXTRA_SGLANG_ARGV[@]}"; do
91+
case "$arg" in
92+
--attention-backend|--attention-backend=*|--prefill-attention-backend|--prefill-attention-backend=*|--decode-attention-backend|--decode-attention-backend=*|--disable-cuda-graph|--enable-cuda-graph*)
93+
echo "ERROR: sglang_radeon8060s pins Triton attention with CUDA graphs disabled; conflicting arg '$arg'." >&2
94+
exit 2
95+
;;
96+
esac
97+
done
98+
99+
set -x
100+
if [[ "$PHASE" == "server" || "$PHASE" == "all" ]]; then
101+
SERVER_CMD=(
102+
python3 -m sglang.launch_server
103+
--model-path "$MODEL"
104+
--host 0.0.0.0
105+
--port "$PORT"
106+
--trust-remote-code
107+
--tensor-parallel-size "$TP"
108+
)
109+
SERVER_CMD+=("${DEFAULT_ARGS[@]}")
110+
SERVER_CMD+=("${EXTRA_SGLANG_ARGV[@]}")
111+
setsid "${SERVER_CMD[@]}" > "$SERVER_LOG" 2>&1 &
112+
113+
SERVER_PID=$!
114+
if [[ "$PHASE" == "all" ]]; then
115+
trap 'magpie_stop_benchmark_server_stack "$SERVER_PID"' EXIT INT TERM
116+
fi
117+
118+
wait_for_server_ready --port "$PORT" --server-log "$SERVER_LOG" --server-pid "$SERVER_PID"
119+
120+
if [[ "$PHASE" == "server" ]]; then
121+
if [[ -z "${MAGPIE_SERVER_PID_FILE:-}" ]]; then
122+
echo "ERROR: MAGPIE_SERVER_PID_FILE must be set for MAGPIE_RUN_PHASE=server" >&2
123+
kill -TERM "-$SERVER_PID" 2>/dev/null || true
124+
exit 3
125+
fi
126+
printf '%s\n' "$SERVER_PID" > "$MAGPIE_SERVER_PID_FILE"
127+
disown "$SERVER_PID" 2>/dev/null || true
128+
exit 0
129+
fi
130+
fi
131+
132+
SERVER_MONITOR_ARGS=()
133+
if [[ -n "${SERVER_PID:-}" ]]; then
134+
SERVER_MONITOR_ARGS+=(--server-pid "$SERVER_PID")
135+
fi
136+
137+
if [[ "$PHASE" == "client" || "$PHASE" == "all" ]]; then
138+
if [[ -n "${BENCHMARK_BASE_URL:-}" ]]; then
139+
SERVER_MONITOR_ARGS=()
140+
magpie_run_benchmark_serving_remote_direct || exit $?
141+
else
142+
# InferenceX names its OpenAI-compatible completions client "vllm";
143+
# SGLang serves that protocol, and this is the physically qualified path.
144+
run_benchmark_serving \
145+
--model "$MODEL" \
146+
--port "$PORT" \
147+
--backend vllm \
148+
--input-len "$ISL" \
149+
--output-len "$OSL" \
150+
--random-range-ratio "$RANDOM_RANGE_RATIO" \
151+
--num-prompts ${NUM_PROMPTS:-$(( $CONC * 10 ))} \
152+
--max-concurrency "$CONC" \
153+
--result-filename "$RESULT_FILENAME" \
154+
"${SERVER_MONITOR_ARGS[@]}" \
155+
--result-dir ${RESULT_DIR:-/workspace/} \
156+
--trust-remote-code || exit $?
157+
fi
158+
fi
159+
160+
if [[ "$PHASE" != "server" && "${RUN_EVAL}" = "true" ]]; then
161+
if [[ -n "${BENCHMARK_BASE_URL:-}" ]]; then
162+
if declare -F magpie_run_eval_remote_direct &>/dev/null; then
163+
magpie_run_eval_remote_direct || exit $?
164+
else
165+
echo "[sglang_radeon8060s] RUN_EVAL=true with BENCHMARK_BASE_URL but magpie_run_eval_remote_direct shim not available; skipping eval (results gate will see accuracy=None)."
166+
fi
167+
else
168+
export EVAL_CONCURRENT_REQUESTS="${MAGPIE_EVAL_CONCURRENCY:-${EVAL_CONCURRENT_REQUESTS:-$CONC}}"
169+
magpie_run_eval_persisted --framework lm-eval --port "$PORT" || exit $?
170+
fi
171+
fi
172+
set +x

0 commit comments

Comments
 (0)