Skip to content

Commit cffe0cf

Browse files
committed
Add a workflow to run vLLM unit tests on H100
Signed-off-by: Huy Do <huydhn@gmail.com>
1 parent 52d3fe9 commit cffe0cf

2 files changed

Lines changed: 139 additions & 0 deletions

File tree

.github/scripts/run_vllm_tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
# A very simple setup for now without any sharding nor caching just to run some
6+
# critical tests on H100 that we couldn't run on vLLM CI
7+
8+
echo 'Update me. This is an example'
9+
pytest -v models/multimodal/generation/test_maverick.py

.github/workflows/vllm-ci-test.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Run vLLM tests
2+
3+
on:
4+
schedule:
5+
# Run every 4 hours
6+
- cron: '0 */4 * * *'
7+
workflow_dispatch:
8+
inputs:
9+
vllm_branch:
10+
description: vLLM branch (main, releases/vERSION for release validation, or refs/pull/PR_NUMBER/head for pre-merge check on pull request)
11+
required: true
12+
type: string
13+
default: main
14+
vllm_commit:
15+
description: vLLM commit (optional, default to the latest commit in the branch that has not yet been benchmarked)
16+
required: false
17+
type: string
18+
pull_request:
19+
paths:
20+
- .github/workflows/vllm-ci-test.yml
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
test:
28+
name: Run vLLM tests
29+
strategy:
30+
fail-fast: false
31+
matrix:
32+
include:
33+
- runs-on: linux.aws.h100
34+
device-name: cuda
35+
permissions:
36+
id-token: write
37+
contents: read
38+
runs-on: ${{ matrix.runs-on }}
39+
environment: pytorch-x-vllm
40+
steps:
41+
- name: Checkout repository
42+
uses: actions/checkout@v4
43+
44+
- name: Checkout vLLM repository
45+
uses: actions/checkout@v4
46+
with:
47+
repository: vllm-project/vllm
48+
path: vllm
49+
ref: ${{ inputs.vllm_branch || 'main' }}
50+
fetch-depth: 0
51+
52+
- name: Set Docker registry
53+
shell: bash
54+
env:
55+
HEAD_BRANCH: ${{ inputs.vllm_branch || 'main' }}
56+
DEVICE_NAME: ${{ matrix.device-name }}
57+
run: |
58+
set -eux
59+
60+
# Mimic the logic from vllm ci-infra test template
61+
if [[ "${HEAD_BRANCH}" == "main" ]]; then
62+
DOCKER_IMAGE_PREFIX=public.ecr.aws/q9t5s3a7/vllm-ci-postmerge-repo
63+
else
64+
DOCKER_IMAGE_PREFIX=public.ecr.aws/q9t5s3a7/vllm-ci-test-repo
65+
fi
66+
67+
DOCKER_IMAGE_SUFFIX=""
68+
if [[ "${DEVICE_NAME}" == "rocm" ]]; then
69+
DOCKER_IMAGE_PREFIX=docker.io/rocm/vllm-ci
70+
elif [[ "${DEVICE_NAME}" == "cpu" ]]; then
71+
DOCKER_IMAGE_SUFFIX=-cpu
72+
fi
73+
echo "DOCKER_IMAGE_PREFIX=$DOCKER_IMAGE_PREFIX" >> $GITHUB_ENV
74+
echo "DOCKER_IMAGE_SUFFIX=$DOCKER_IMAGE_SUFFIX" >> $GITHUB_ENV
75+
76+
- name: Check for available Docker image
77+
working-directory: vllm
78+
env:
79+
HEAD_BRANCH: ${{ inputs.vllm_branch || 'main' }}
80+
HEAD_SHA: ${{ inputs.vllm_commit || '' }}
81+
run: |
82+
set -eux
83+
84+
if [[ -z "${HEAD_SHA}" ]]; then
85+
# Looking back the latest 100 commits is enough
86+
for i in {0..99}
87+
do
88+
# Check if the image is there, if it doesn't then check an older one
89+
# because the commit is too recent
90+
HEAD_SHA=$(git rev-parse --verify HEAD~${i})
91+
DOCKER_IMAGE="${DOCKER_IMAGE_PREFIX}:${HEAD_SHA}${DOCKER_IMAGE_SUFFIX}"
92+
93+
# No Docker image available yet because the commit is too recent
94+
if docker manifest inspect "${DOCKER_IMAGE}"; then
95+
break
96+
fi
97+
done
98+
fi
99+
100+
echo "HEAD_SHA=$HEAD_SHA" >> $GITHUB_ENV
101+
102+
- name: Setup CUDA GPU_FLAG for docker run
103+
if: matrix.device-name == 'cuda'
104+
run: |
105+
echo "GPU_FLAG=--gpus all -e NVIDIA_DRIVER_CAPABILITIES=all" >> "${GITHUB_ENV}"
106+
107+
- name: Setup ROCm
108+
if: matrix.device-name == 'rocm'
109+
uses: pytorch/pytorch/./.github/actions/setup-rocm@main
110+
111+
- name: Run vLLM tests
112+
env:
113+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
114+
DOCKER_IMAGE: ${{ env.DOCKER_IMAGE_PREFIX }}:${{ env.HEAD_SHA }}${{ env.DOCKER_IMAGE_SUFFIX }}
115+
run: |
116+
set -eux
117+
118+
container_name=$(docker run \
119+
${GPU_FLAG:-} \
120+
-e HF_TOKEN \
121+
--ipc=host \
122+
--tty \
123+
--detach \
124+
--security-opt seccomp=unconfined \
125+
--shm-size=4g \
126+
-v "${GITHUB_WORKSPACE}:/tmp/workspace" \
127+
-w /tmp/workspace \
128+
"${DOCKER_IMAGE}"
129+
)
130+
docker exec -t "${container_name}" bash -c "bash .github/scripts/run_vllm_tests.sh"

0 commit comments

Comments
 (0)