Skip to content

Commit 3e1cadb

Browse files
authored
Merge pull request ROCm#368 from ROCm/upstream_merge_25_01_20
Upstream merge 25 01 20
2 parents c5a9406 + 031e6eb commit 3e1cadb

File tree

280 files changed

+9138
-6809
lines changed

Some content is hidden

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

280 files changed

+9138
-6809
lines changed

.buildkite/nightly-benchmarks/scripts/nightly-annotate.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ main() {
4343

4444

4545

46-
# The figures should be genereated by a separate process outside the CI/CD pipeline
46+
# The figures should be generated by a separate process outside the CI/CD pipeline
4747

4848
# # generate figures
4949
# python3 -m pip install tabulate pandas matplotlib

.buildkite/nightly-benchmarks/scripts/run-nightly-benchmarks.sh

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,104 @@ run_serving_tests() {
301301
kill_gpu_processes
302302
}
303303

304+
run_genai_perf_tests() {
305+
# run genai-perf tests
306+
307+
# $1: a json file specifying genai-perf test cases
308+
local genai_perf_test_file
309+
genai_perf_test_file=$1
310+
311+
# Iterate over genai-perf tests
312+
jq -c '.[]' "$genai_perf_test_file" | while read -r params; do
313+
# get the test name, and append the GPU type back to it.
314+
test_name=$(echo "$params" | jq -r '.test_name')
315+
316+
# if TEST_SELECTOR is set, only run the test cases that match the selector
317+
if [[ -n "$TEST_SELECTOR" ]] && [[ ! "$test_name" =~ $TEST_SELECTOR ]]; then
318+
echo "Skip test case $test_name."
319+
continue
320+
fi
321+
322+
# prepend the current serving engine to the test name
323+
test_name=${CURRENT_LLM_SERVING_ENGINE}_${test_name}
324+
325+
# get common parameters
326+
common_params=$(echo "$params" | jq -r '.common_parameters')
327+
model=$(echo "$common_params" | jq -r '.model')
328+
tp=$(echo "$common_params" | jq -r '.tp')
329+
dataset_name=$(echo "$common_params" | jq -r '.dataset_name')
330+
dataset_path=$(echo "$common_params" | jq -r '.dataset_path')
331+
port=$(echo "$common_params" | jq -r '.port')
332+
num_prompts=$(echo "$common_params" | jq -r '.num_prompts')
333+
reuse_server=$(echo "$common_params" | jq -r '.reuse_server')
334+
335+
# get client and server arguments
336+
server_params=$(echo "$params" | jq -r ".${CURRENT_LLM_SERVING_ENGINE}_server_parameters")
337+
qps_list=$(echo "$params" | jq -r '.qps_list')
338+
qps_list=$(echo "$qps_list" | jq -r '.[] | @sh')
339+
echo "Running over qps list $qps_list"
340+
341+
# check if there is enough GPU to run the test
342+
if [[ $gpu_count -lt $tp ]]; then
343+
echo "Required num-shard $tp but only $gpu_count GPU found. Skip testcase $test_name."
344+
continue
345+
fi
346+
347+
if [[ $reuse_server == "true" ]]; then
348+
echo "Reuse previous server for test case $test_name"
349+
else
350+
kill_gpu_processes
351+
bash "$VLLM_SOURCE_CODE_LOC/.buildkite/nightly-benchmarks/scripts/launch-server.sh" \
352+
"$server_params" "$common_params"
353+
fi
354+
355+
if wait_for_server; then
356+
echo ""
357+
echo "$CURRENT_LLM_SERVING_ENGINE server is up and running."
358+
else
359+
echo ""
360+
echo "$CURRENT_LLM_SERVING_ENGINE failed to start within the timeout period."
361+
break
362+
fi
363+
364+
# iterate over different QPS
365+
for qps in $qps_list; do
366+
# remove the surrounding single quote from qps
367+
if [[ "$qps" == *"inf"* ]]; then
368+
echo "qps was $qps"
369+
qps=$num_prompts
370+
echo "now qps is $qps"
371+
fi
372+
373+
new_test_name=$test_name"_qps_"$qps
374+
backend=$CURRENT_LLM_SERVING_ENGINE
375+
376+
if [[ "$backend" == *"vllm"* ]]; then
377+
backend="vllm"
378+
fi
379+
#TODO: add output dir.
380+
client_command="genai-perf profile \
381+
-m $model \
382+
--service-kind openai \
383+
--backend vllm \
384+
--endpoint-type chat \
385+
--streaming \
386+
--url localhost:$port \
387+
--request-rate $qps \
388+
--num-prompts $num_prompts \
389+
"
390+
391+
echo "Client command: $client_command"
392+
393+
eval "$client_command"
394+
395+
#TODO: process/record outputs
396+
done
397+
done
398+
399+
kill_gpu_processes
400+
401+
}
304402

305403
prepare_dataset() {
306404

@@ -328,12 +426,17 @@ main() {
328426

329427
pip install -U transformers
330428

429+
pip install -r requirements-dev.txt
430+
which genai-perf
431+
331432
# check storage
332433
df -h
333434

334435
ensure_installed wget
335436
ensure_installed curl
336437
ensure_installed jq
438+
# genai-perf dependency
439+
ensure_installed libb64-0d
337440

338441
prepare_dataset
339442

@@ -345,6 +448,10 @@ main() {
345448
# run the test
346449
run_serving_tests "$BENCHMARK_ROOT/tests/nightly-tests.json"
347450

451+
# run genai-perf tests
452+
run_genai_perf_tests "$BENCHMARK_ROOT/tests/genai-perf-tests.json"
453+
mv artifacts/ $RESULTS_FOLDER/
454+
348455
# upload benchmark results to buildkite
349456
python3 -m pip install tabulate pandas
350457
python3 "$BENCHMARK_ROOT/scripts/summary-nightly-results.py"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"test_name": "llama8B_tp1_genai_perf",
4+
"qps_list": [4,8,16,32],
5+
"common_parameters": {
6+
"model": "meta-llama/Meta-Llama-3-8B-Instruct",
7+
"tp": 1,
8+
"port": 8000,
9+
"num_prompts": 500,
10+
"reuse_server": false
11+
},
12+
"vllm_server_parameters": {
13+
"disable_log_stats": "",
14+
"disable_log_requests": "",
15+
"gpu_memory_utilization": 0.9,
16+
"num_scheduler_steps": 10,
17+
"max_num_seqs": 512,
18+
"dtype": "bfloat16"
19+
},
20+
"genai_perf_input_parameters": {
21+
}
22+
}
23+
]

.buildkite/run-cpu-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ function cpu_tests() {
8383
tests/lora/test_qwen2vl.py"
8484
}
8585

86-
# All of CPU tests are expected to be finished less than 25 mins.
86+
# All of CPU tests are expected to be finished less than 40 mins.
8787
export -f cpu_tests
88-
timeout 30m bash -c "cpu_tests $CORE_RANGE $NUMA_NODE"
88+
timeout 40m bash -c "cpu_tests $CORE_RANGE $NUMA_NODE"

.buildkite/run-hpu-test.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ set -ex
88
docker build -t hpu-test-env -f Dockerfile.hpu .
99

1010
# Setup cleanup
11+
# certain versions of HPU software stack have a bug that can
12+
# override the exit code of the script, so we need to use
13+
# separate remove_docker_container and remove_docker_container_and_exit
14+
# functions, while other platforms only need one remove_docker_container
15+
# function.
16+
EXITCODE=1
1117
remove_docker_container() { docker rm -f hpu-test || true; }
12-
trap remove_docker_container EXIT
18+
remove_docker_container_and_exit() { remove_docker_container; exit $EXITCODE; }
19+
trap remove_docker_container_and_exit EXIT
1320
remove_docker_container
1421

1522
# Run the image and launch offline inference
16-
docker run --runtime=habana --name=hpu-test --network=host -e HABANA_VISIBLE_DEVICES=all -e VLLM_SKIP_WARMUP=true --entrypoint="" hpu-test-env python3 examples/offline_inference/basic.py
23+
docker run --runtime=habana --name=hpu-test --network=host -e HABANA_VISIBLE_DEVICES=all -e VLLM_SKIP_WARMUP=true --entrypoint="" hpu-test-env python3 examples/offline_inference/basic.py
24+
EXITCODE=$?

.buildkite/test-pipeline.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ steps:
5252
- tests/worker
5353
- tests/standalone_tests/lazy_torch_compile.py
5454
commands:
55-
- pip install git+https://github.com/Isotr0py/DeepSeek-VL2.git # Used by multimoda processing test
5655
- python3 standalone_tests/lazy_torch_compile.py
5756
- pytest -v -s mq_llm_engine # MQLLMEngine
5857
- pytest -v -s async_engine # AsyncLLMEngine
@@ -107,7 +106,7 @@ steps:
107106
source_file_dependencies:
108107
- vllm/
109108
commands:
110-
- pytest -v -s entrypoints/llm --ignore=entrypoints/llm/test_lazy_outlines.py --ignore=entrypoints/llm/test_generate.py --ignore=entrypoints/llm/test_generate_multiple_loras.py --ignore=entrypoints/llm/test_guided_generate.py
109+
- pytest -v -s entrypoints/llm --ignore=entrypoints/llm/test_lazy_outlines.py --ignore=entrypoints/llm/test_generate.py --ignore=entrypoints/llm/test_generate_multiple_loras.py --ignore=entrypoints/llm/test_guided_generate.py --ignore=entrypoints/llm/test_collective_rpc.py
111110
- pytest -v -s entrypoints/llm/test_lazy_outlines.py # it needs a clean process
112111
- pytest -v -s entrypoints/llm/test_generate.py # it needs a clean process
113112
- pytest -v -s entrypoints/llm/test_generate_multiple_loras.py # it needs a clean process
@@ -126,11 +125,15 @@ steps:
126125
- tests/distributed
127126
- tests/spec_decode/e2e/test_integration_dist_tp4
128127
- tests/compile
128+
- examples/offline_inference/rlhf.py
129129
commands:
130130
- pytest -v -s distributed/test_utils.py
131131
- pytest -v -s compile/test_basic_correctness.py
132132
- pytest -v -s distributed/test_pynccl.py
133133
- pytest -v -s spec_decode/e2e/test_integration_dist_tp4.py
134+
# TODO: create a dedicated test section for multi-GPU example tests
135+
# when we have multiple distributed example tests
136+
- python3 ../examples/offline_inference/rlhf.py
134137

135138
- label: Metrics, Tracing Test # 10min
136139
num_gpus: 2
@@ -462,7 +465,10 @@ steps:
462465
- vllm/worker/worker_base.py
463466
- vllm/worker/worker.py
464467
- vllm/worker/model_runner.py
468+
- entrypoints/llm/test_collective_rpc.py
465469
commands:
470+
- pytest -v -s entrypoints/llm/test_collective_rpc.py
471+
- torchrun --nproc-per-node=2 distributed/test_torchrun_example.py
466472
- pytest -v -s ./compile/test_basic_correctness.py
467473
- pytest -v -s ./compile/test_wrapper.py
468474
- VLLM_TEST_SAME_HOST=1 torchrun --nproc-per-node=4 distributed/test_same_node.py | grep 'Same node test passed'

.github/workflows/actionlint.yml

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

.github/workflows/clang-format.yml

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

.github/workflows/codespell.yml

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

0 commit comments

Comments
 (0)