Skip to content

Commit 41fa9ce

Browse files
committed
fix for ROCm changes
1 parent 1201ea6 commit 41fa9ce

File tree

3 files changed

+35
-41
lines changed

3 files changed

+35
-41
lines changed

.github/scripts/generate_vllm_benchmark_matrix.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
2: [
2323
"linux.aws.h100.4",
2424
"linux.rocm.gpu.mi300.2",
25+
"intel-cpu-emr",
2526
],
2627
4: [
2728
"linux.aws.h100.4",
@@ -31,9 +32,6 @@
3132
"linux.aws.h100.8",
3233
"linux.rocm.gpu.mi300.8",
3334
],
34-
2: [
35-
"intel-cpu-emr",
36-
],
3735
}
3836

3937
# All the different names vLLM uses to refer to their benchmark configs
@@ -79,17 +77,10 @@ def parse_args() -> Any:
7977
help="the comma-separated list of models to benchmark",
8078
)
8179
parser.add_argument(
82-
"--gpus",
80+
"--platforms",
8381
type=str,
8482
default="",
85-
help="the comma-separated list of GPUs to benchmark",
86-
)
87-
parser.add_argument(
88-
"--arch",
89-
type=str,
90-
default="",
91-
action=ValidateDir,
92-
help="architect for the runner",
83+
help="the comma-separated list of platforms to benchmark",
9384
required=True,
9485
)
9586

@@ -118,19 +109,19 @@ def set_output(name: str, val: Any) -> None:
118109

119110

120111
def generate_benchmark_matrix(
121-
benchmark_configs_dir: str, models: List[str], gpus: List[str], arch: str
112+
benchmark_configs_dir: str, models: List[str], platforms: List[str]
122113
) -> Dict[str, Any]:
123114
"""
124115
Parse all the JSON files in vLLM benchmark configs directory to get the
125-
model name and tensor parallel size (aka number of GPUs)
116+
model name and tensor parallel size (aka number of GPUs or CPU NUMA nodes)
126117
"""
127118
get_all_models = True if not models else False
128-
use_all_gpus = True if not gpus else False
119+
use_all_plaforms = True if not platforms else False
129120

130121
benchmark_matrix: Dict[str, Any] = {
131122
"include": [],
132123
}
133-
for file in glob.glob(f"{benchmark_configs_dir}/*{arch}.json"):
124+
for file in glob.glob(f"{benchmark_configs_dir}/*.json"):
134125
with open(file) as f:
135126
try:
136127
configs = json.load(f)
@@ -164,12 +155,12 @@ def generate_benchmark_matrix(
164155

165156
for runner in RUNNERS_MAPPING[tp]:
166157
found_runner = False
167-
for gpu in gpus:
168-
if gpu.lower() in runner:
158+
for platform in platforms:
159+
if platform.lower() in runner:
169160
found_runner = True
170161
break
171162

172-
if found_runner or use_all_gpus:
163+
if found_runner or use_all_platforms:
173164
benchmark_matrix["include"].append(
174165
{
175166
"runner": runner,
@@ -185,12 +176,11 @@ def generate_benchmark_matrix(
185176
def main() -> None:
186177
args = parse_args()
187178
models = [m.strip().lower() for m in args.models.split(",") if m.strip()]
188-
gpus = [m.strip().lower() for m in args.gpus.split(",") if m.strip()]
179+
platforms = [m.strip().lower() for m in args.platforms.split(",") if m.strip()]
189180
benchmark_matrix = generate_benchmark_matrix(
190181
args.benchmark_configs_dir,
191182
models,
192-
gpus,
193-
args.arch,
183+
platforms,
194184
)
195185
set_output("benchmark_matrix", benchmark_matrix)
196186

.github/scripts/setup_vllm_benchmark.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,23 @@ def parse_args() -> Any:
6262
required=True,
6363
)
6464
parser.add_argument(
65-
"--arch",
65+
"--device",
6666
type=str,
6767
default="",
68-
action=ValidateDir,
69-
help="architect for the runner",
68+
help="device for the runner",
7069
required=True,
7170
)
7271

7372
return parser.parse_args()
7473

7574

7675
def setup_benchmark_configs(
77-
from_benchmark_configs_dir: str, to_benchmark_configs_dir: str, models: List[str], arch: str
76+
from_benchmark_configs_dir: str, to_benchmark_configs_dir: str, models: List[str], device: str
7877
) -> None:
7978
"""
8079
Setup the benchmark configs to run on this runner
8180
"""
82-
for file in glob.glob(f"{from_benchmark_configs_dir}/*{arch}.json"):
81+
for file in glob.glob(f"{from_benchmark_configs_dir}/*{device}.json"):
8382
filename = os.path.basename(file)
8483
benchmark_configs = []
8584

@@ -116,7 +115,7 @@ def main() -> None:
116115
args.from_benchmark_configs_dir,
117116
args.to_benchmark_configs_dir,
118117
args.models.split(","),
119-
args.arch,
118+
args.device,
120119
)
121120

122121

.github/workflows/vllm-benchmark.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ on:
2020
A comma-separated list of models to benchmark, leave empty to run everything
2121
required: false
2222
type: string
23-
gpus:
23+
platforms:
2424
description: |
25-
A comma-separated list of GPUs to benchmark, i.e. h100, mi300
25+
A comma-separated list of platforms to benchmark, i.e. h100, mi300, emr
2626
required: true
2727
type: string
2828
default: h100,mi300
@@ -53,17 +53,15 @@ jobs:
5353
shell: bash
5454
env:
5555
MODELS: ${{ inputs.models || '' }}
56-
GPUS: ${{ inputs.gpus || '' }}
57-
ARCH: ${{ inputs.arch || '' }}
56+
PLATFORMS: ${{ inputs.platforms || '' }}
5857
run: |
5958
set -eux
6059
6160
# The generated matrix is grouped by model and runner
6261
python .github/scripts/generate_vllm_benchmark_matrix.py \
6362
--benchmark-configs-dir vllm-benchmarks/benchmarks \
6463
--models "${MODELS}" \
65-
--gpus "${GPUS}"
66-
--arch "${ARCH}"
64+
--platforms "${PLATFORMS}"
6765
6866
benchmarks:
6967
name: Run vLLM benchmarks
@@ -105,8 +103,9 @@ jobs:
105103
DEVICE_NAME=rocm
106104
rocm-smi
107105
else
108-
echo "Only CUDA and ROCm benchmarks are supported at the moment"
109-
exit 1
106+
echo "No accelerators. Use CPU instead"
107+
DEVICE_NAME=cpu
108+
lscpu
110109
fi
111110
echo "DEVICE_NAME=$DEVICE_NAME" >> $GITHUB_ENV
112111
@@ -120,6 +119,8 @@ jobs:
120119
DEVICE_TYPE=$(nvidia-smi -i 0 --query-gpu=name --format=csv,noheader | awk '{print $2}')
121120
elif [[ "${DEVICE_NAME}" == "rocm" ]]; then
122121
DEVICE_TYPE=$(rocminfo | grep "Marketing Name" | tail -n1 | awk -F':' '{print $2}' | xargs)
122+
elif [[ "${DEVICE_NAME}" == "cpu" ]]; then
123+
DEVICE_TYPE=$(lscpu | grep 'Model name' | cut -f 2 -d ":" | awk '{$1=$1}1' | cut -f 2 -d " ")
123124
fi
124125
echo "DEVICE_TYPE=$DEVICE_TYPE" >> $GITHUB_ENV
125126
@@ -128,11 +129,11 @@ jobs:
128129
run: |
129130
set -eux
130131
131-
if [[ "${DEVICE_NAME}" == "cuda" ]]; then
132-
pip install -r .github/scripts/requirements.txt
133-
elif [[ "${DEVICE_NAME}" == "rocm" ]]; then
132+
if [[ "${DEVICE_NAME}" == "rocm" ]]; then
134133
pip install -r .github/scripts/requirements.txt \
135134
--extra-index-url https://download.pytorch.org/whl/rocm6.3
135+
else
136+
pip install -r .github/scripts/requirements.txt
136137
fi
137138
138139
- name: Set Docker registry
@@ -142,6 +143,8 @@ jobs:
142143
DOCKER_IMAGE_PREFIX=public.ecr.aws/q9t5s3a7/vllm-ci-postmerge-repo
143144
elif [[ "${DEVICE_NAME}" == "rocm" ]]; then
144145
DOCKER_IMAGE_PREFIX=docker.io/rocm/vllm-ci
146+
elif [[ "${DEVICE_NAME}" == "cpu" ]]; then
147+
DOCKER_IMAGE_PREFIX=public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo
145148
fi
146149
echo "DOCKER_IMAGE_PREFIX=$DOCKER_IMAGE_PREFIX" >> $GITHUB_ENV
147150
@@ -213,7 +216,7 @@ jobs:
213216
--from-benchmark-configs-dir vllm-benchmarks/benchmarks \
214217
--to-benchmark-configs-dir vllm-benchmarks/vllm/.buildkite/nightly-benchmarks/tests \
215218
--models "${MODELS}" \
216-
--arch "${ARCH}"
219+
--device "${DEVICE_NAME// /_}"
217220
218221
pushd vllm-benchmarks/vllm
219222
ls -lah .buildkite/nightly-benchmarks/tests
@@ -229,11 +232,13 @@ jobs:
229232
# vLLM-related environment variables
230233
ENGINE_VERSION: v1
231234
SAVE_TO_PYTORCH_BENCHMARK_FORMAT: 1
232-
ARCH: ${{ inputs.arch || '' }}
235+
ARCH: ${{ env.DEVICE_NAME }}
233236
run: |
234237
set -x
235238
if [[ "$ARCH" == "cpu" ]]; then
236239
on_cpu=1
240+
else
241+
on_cpu=0
237242
fi
238243
docker run \
239244
${GPU_FLAG:-} \

0 commit comments

Comments
 (0)