Skip to content

Commit eeb7535

Browse files
committed
Tweak the benchmark script to run on ROCm
1 parent dc3a901 commit eeb7535

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

vllm-benchmarks/cron.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ run() {
2727

2828
NOT_EXIST=0
2929

30-
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${COMMIT}/benchmark_results.json"
30+
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${COMMIT}/${GPU_DEVICE}/benchmark_results.json"
3131
aws s3api head-object --bucket ossci-benchmarks --key ${S3_PATH} || NOT_EXIST=1
3232

3333
if [[ ${NOT_EXIST:-0} == "0" ]]; then
3434
echo "${COMMIT}" > commit
3535
echo "Mark ${COMMIT} as the latest commit that has been benchmarked on main"
3636

37-
S3_PATH="last-green-commits/vllm-project/vllm/${HEAD_BRANCH}/commit"
37+
S3_PATH="last-green-commits/vllm-project/vllm/${HEAD_BRANCH}/${GPU_DEVICE}/commit"
3838
aws s3 cp commit "s3://ossci-benchmarks/${S3_PATH}"
3939
fi
4040
}
@@ -47,7 +47,7 @@ run_benchmarks() {
4747

4848
rm commit || true
4949
# Get the last green commit from S3
50-
S3_PATH="last-green-commits/vllm-project/vllm/${HEAD_BRANCH}/commit"
50+
S3_PATH="last-green-commits/vllm-project/vllm/${HEAD_BRANCH}/${GPU_DEVICE}/commit"
5151
aws s3 cp "s3://ossci-benchmarks/${S3_PATH}" .
5252
LAST_GREEN_COMMIT=$(cat commit)
5353

@@ -59,6 +59,12 @@ run_benchmarks() {
5959
fi
6060
}
6161

62+
if command -v nvidia-smi; then
63+
declare -g GPU_DEVICE=$(nvidia-smi --query-gpu=name --format=csv,noheader | awk '{print $2}')
64+
elif command -v amd-smi; then
65+
declare -g GPU_DEVICE=$(amd-smi static -g 0 -a | grep 'MARKET_NAME' | awk '{print $2}')
66+
fi
67+
6268
while :
6369
do
6470
pull_vllm

vllm-benchmarks/run.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ cleanup() {
1212
if [[ "${CLEANUP_BENCHMARK_RESULTS:-1}" == "1" ]]; then
1313
rm -rf vllm/benchmarks/results
1414
fi
15-
16-
# https://github.com/vllm-project/vllm/issues/13392
17-
rm -rf ~/.cache/vllm/torch_compile_cache
1815
}
1916

2017
setup_vllm() {
@@ -43,8 +40,15 @@ build_vllm() {
4340
# TODO (huydhn) I'll setup remote cache for this later
4441
SCCACHE_CACHE_SIZE=100G sccache --start-server || true
4542
# Build and install vLLM
46-
pip install -r requirements-build.txt
47-
pip install --editable .
43+
if command -v nvidia-smi; then
44+
pip install -r requirements-build.txt
45+
pip install --editable .
46+
elif command -v amd-smi; then
47+
pip install -r requirements-rocm.txt
48+
pip install -r requirements-rocm-build.txt
49+
# https://docs.vllm.ai/en/latest/getting_started/installation/gpu/index.html?device=rocm
50+
PYTORCH_ROCM_ARCH="gfx90a;gfx942" python setup.py develop
51+
fi
4852
popd
4953
}
5054

@@ -70,14 +74,14 @@ upload_results() {
7074
pushd vllm
7175
if [[ -f benchmarks/results/benchmark_results.md ]]; then
7276
# Upload the markdown file
73-
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${HEAD_SHA}/benchmark_results.md"
77+
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${HEAD_SHA}/${GPU_DEVICE}/benchmark_results.md"
7478
aws s3 cp --acl public-read \
7579
benchmarks/results/benchmark_results.md "s3://ossci-benchmarks/${S3_PATH}"
7680
fi
7781

7882
if [[ -f benchmarks.log ]]; then
7983
# Upload the logs
80-
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${HEAD_SHA}/benchmarks.log"
84+
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${HEAD_SHA}/${GPU_DEVICE}/benchmarks.log"
8185
aws s3 cp --acl public-read \
8286
benchmarks.log "s3://ossci-benchmarks/${S3_PATH}"
8387
fi
@@ -99,7 +103,13 @@ pushd vllm
99103
export HEAD_BRANCH=main
100104
export HEAD_SHA=$(git rev-parse --verify HEAD)
101105

102-
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${HEAD_SHA}/benchmark_results.json"
106+
if command -v nvidia-smi; then
107+
declare -g GPU_DEVICE=$(nvidia-smi --query-gpu=name --format=csv,noheader | awk '{print $2}')
108+
elif command -v amd-smi; then
109+
declare -g GPU_DEVICE=$(amd-smi static -g 0 -a | grep 'MARKET_NAME' | awk '{print $2}')
110+
fi
111+
112+
S3_PATH="v3/vllm-project/vllm/${HEAD_BRANCH}/${HEAD_SHA}/${GPU_DEVICE}/benchmark_results.json"
103113
aws s3api head-object --bucket ossci-benchmarks --key ${S3_PATH} || NOT_EXIST=1
104114

105115
if [[ ${NOT_EXIST:-0} == "0" && "${OVERWRITE_BENCHMARK_RESULTS:-0}" != "1" ]]; then

0 commit comments

Comments
 (0)