forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into apecloud-main
- Loading branch information
Showing
232 changed files
with
26,165 additions
and
6,069 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# This script is run by buildkite to run the benchmarks and upload the results to buildkite | ||
|
||
set -ex | ||
set -o pipefail | ||
|
||
# cd into parent directory of this file | ||
cd "$(dirname "${BASH_SOURCE[0]}")/.." | ||
|
||
(wget && curl) || (apt-get update && apt-get install -y wget curl) | ||
|
||
# run benchmarks and upload the result to buildkite | ||
python3 benchmarks/benchmark_latency.py 2>&1 | tee benchmark_latency.txt | ||
bench_latency_exit_code=$? | ||
|
||
python3 benchmarks/benchmark_throughput.py --input-len 256 --output-len 256 2>&1 | tee benchmark_throughput.txt | ||
bench_throughput_exit_code=$? | ||
|
||
python3 -m vllm.entrypoints.openai.api_server --model meta-llama/Llama-2-7b-chat-hf & | ||
server_pid=$! | ||
wget https://huggingface.co/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json | ||
|
||
# wait for server to start, timeout after 600 seconds | ||
timeout 600 bash -c 'until curl localhost:8000/v1/models; do sleep 1; done' || exit 1 | ||
python3 benchmarks/benchmark_serving.py \ | ||
--dataset ./ShareGPT_V3_unfiltered_cleaned_split.json \ | ||
--model meta-llama/Llama-2-7b-chat-hf \ | ||
--num-prompts 20 \ | ||
--endpoint /v1/completions \ | ||
--tokenizer meta-llama/Llama-2-7b-chat-hf 2>&1 | tee benchmark_serving.txt | ||
bench_serving_exit_code=$? | ||
kill $server_pid | ||
|
||
# write the results into a markdown file | ||
echo "### Latency Benchmarks" >> benchmark_results.md | ||
sed -n '1p' benchmark_latency.txt >> benchmark_results.md # first line | ||
echo "" >> benchmark_results.md | ||
sed -n '$p' benchmark_latency.txt >> benchmark_results.md # last line | ||
|
||
echo "### Throughput Benchmarks" >> benchmark_results.md | ||
sed -n '1p' benchmark_throughput.txt >> benchmark_results.md # first line | ||
echo "" >> benchmark_results.md | ||
sed -n '$p' benchmark_throughput.txt >> benchmark_results.md # last line | ||
|
||
echo "### Serving Benchmarks" >> benchmark_results.md | ||
sed -n '1p' benchmark_serving.txt >> benchmark_results.md # first line | ||
echo "" >> benchmark_results.md | ||
tail -n 5 benchmark_serving.txt >> benchmark_results.md # last 5 lines | ||
|
||
# upload the results to buildkite | ||
/workspace/buildkite-agent annotate --style "info" --context "benchmark-results" < benchmark_results.md | ||
|
||
# exit with the exit code of the benchmarks | ||
if [ $bench_latency_exit_code -ne 0 ]; then | ||
exit $bench_latency_exit_code | ||
fi | ||
|
||
if [ $bench_throughput_exit_code -ne 0 ]; then | ||
exit $bench_throughput_exit_code | ||
fi | ||
|
||
if [ $bench_serving_exit_code -ne 0 ]; then | ||
exit $bench_serving_exit_code | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# In this file, you can add more tests to run either by adding a new step or | ||
# adding a new command to an existing step. See different options here for examples. | ||
# This script will be feed into Jinja template in `test-template.j2` to generate | ||
# the final pipeline yaml file. | ||
|
||
steps: | ||
- label: Regression Test | ||
command: pytest -v -s test_regression.py | ||
working_dir: "/vllm-workspace/tests" # optional | ||
|
||
- label: AsyncEngine Test | ||
command: pytest -v -s async_engine | ||
|
||
- label: Distributed Test | ||
command: pytest -v -s test_comm_ops.py | ||
working_dir: "/vllm-workspace/tests/distributed" | ||
num_gpus: 2 # only support 1 or 2 for now. | ||
|
||
- label: Engine Test | ||
command: pytest -v -s engine | ||
|
||
- label: Entrypoints Test | ||
command: pytest -v -s entrypoints | ||
|
||
- label: Kernels Test | ||
command: pytest -v -s kernels | ||
soft_fail: true | ||
|
||
- label: Models Test | ||
commands: | ||
- pytest -v -s models --forked | ||
soft_fail: true | ||
|
||
- label: Prefix Caching Test | ||
commands: | ||
- pytest -v -s prefix_caching | ||
|
||
- label: Samplers Test | ||
command: pytest -v -s samplers --forked | ||
|
||
- label: Worker Test | ||
command: pytest -v -s worker | ||
|
||
- label: LoRA Test | ||
command: pytest -v -s lora | ||
|
||
- label: Benchmarks | ||
working_dir: "/vllm-workspace/.buildkite" | ||
commands: | ||
- pip install aiohttp | ||
- bash run-benchmarks.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{% set docker_image = "us-central1-docker.pkg.dev/vllm-405802/vllm-ci-test-repo/vllm-test:$BUILDKITE_COMMIT" %} | ||
{% set default_num_gpu = 1 %} | ||
{% set default_working_dir = "/vllm-workspace/tests" %} | ||
|
||
steps: | ||
- label: ":docker: build image" | ||
commands: | ||
- "docker build --tag {{ docker_image }} --target test --progress plain ." | ||
- "docker push {{ docker_image }}" | ||
env: | ||
DOCKER_BUILDKIT: "1" | ||
retry: | ||
automatic: | ||
- exit_status: -1 # Agent was lost | ||
limit: 5 | ||
- wait | ||
|
||
{% for step in steps %} | ||
- label: "{{ step.label }}" | ||
agents: | ||
queue: kubernetes | ||
soft_fail: {{ step.soft_fail or false }} | ||
retry: | ||
automatic: | ||
- exit_status: -1 # Agent was lost | ||
limit: 5 | ||
plugins: | ||
- kubernetes: | ||
podSpec: | ||
volumes: | ||
- name: dshm | ||
emptyDir: | ||
medium: Memory | ||
containers: | ||
- image: "{{ docker_image }}" | ||
command: ["bash"] | ||
args: | ||
- "-c" | ||
- "'cd {{ (step.working_dir or default_working_dir) | safe }} && {{ step.command or (step.commands | join(' && ')) | safe }}'" | ||
resources: | ||
requests: | ||
nvidia.com/gpu: "{{ step.num_gpus or default_num_gpu }}" | ||
limits: | ||
nvidia.com/gpu: "{{ step.num_gpus or default_num_gpu }}" | ||
env: | ||
- name: HF_TOKEN | ||
valueFrom: | ||
secretKeyRef: | ||
name: hf-token-secret | ||
key: token | ||
volumeMounts: | ||
- mountPath: /dev/shm | ||
name: dshm | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vllm/*.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.