Skip to content

Commit 05c3004

Browse files
andy-neumaandy-neuma
andauthored
cross python whl (vllm-project#315)
SUMMARY: * transition workflows to one cross python whl. minimum supported python is 3.8. * adjustments to actions resulting from using one whl * adjustments to workflows resulting from using one whl * updating parameters to enable passing in an "array" of test labels, python versions, and tests to run. * upload whl to GCP storage bucket organized by run id. this will be used in a later PR to allow us to install and run from GCP directly. * deletion of WEEKLY and RELEASE workflows. these can now be handled via the NIGHTLY by just specifying different input parameter. * removal of "WEEKLY" workflow category. we should just push this semantic into "RELEASE". * add "pytest skip if" for some tests to avoid running them on T4's (<8.0 compute capability) * "remote push" will now run on "l4 solo" and "l4 duo". there are still some issues with the T4's, so moving all jobs to run on L4's. we should address the T4 issues in a separate PR. * adding "python cache" semantics. this roughly cuts build times in half. building the whl now takes about 25 minutes. this is inline with the times when we were using GCP static runners. * clean up "publish binaries" parameter. moved it to a boolean and set defaults to `false`. this makes everything cleaner and also cleans up the GHA UI when manually triggering workflows. * remove reference to skip list in "run tests" TEST PLAN: runs on remote push --------- Co-authored-by: andy-neuma <andy@neuralmagic.com>
1 parent 250f6d8 commit 05c3004

File tree

26 files changed

+191
-464
lines changed

26 files changed

+191
-464
lines changed

.github/actions/nm-build-vllm/action.yml

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,9 @@ inputs:
77
venv:
88
description: 'name for python virtual environment'
99
required: true
10-
pypi:
11-
description: 'ip address for pypi server'
12-
required: true
1310
outputs:
14-
build_status:
15-
description: "final status from 'pip install -e'"
16-
value: ${{ steps.build.outputs.build_status }}
1711
whl_status:
18-
description: "final status from 'pip3 wheel --no-deps -w dist'"
12+
description: "final status from constructing the whl"
1913
value: ${{ steps.build.outputs.whl_status }}
2014
whl:
2115
description: 'basename for generated whl'
@@ -31,43 +25,24 @@ runs:
3125
COMMIT=${{ github.sha }}
3226
VENV="${{ inputs.venv }}-${COMMIT:0:7}"
3327
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
34-
# TODO: adjust when we need a proper release. use nightly now.
3528
pip3 install -r requirements-cuda.txt -r requirements-build.txt
36-
# build
37-
SUCCESS=0
38-
pip3 install -e . || SUCCESS=$?
39-
echo "build_status=${SUCCESS}" >> "$GITHUB_OUTPUT"
40-
if [ ${SUCCESS} -ne 0 ]; then
41-
exit 1
42-
fi
43-
# strip binaries
44-
if [ ! $(command -v strip) ]; then
45-
sudo apt install -y binutils
46-
fi
47-
if [ ! $(command -v file) ]; then
48-
sudo apt install -y file
49-
fi
50-
for eachso in $(find . -type f -name '*.so')
51-
do
52-
strip $eachso
53-
file $eachso
54-
done
5529
# whl
5630
SUCCESS=0
57-
pip3 wheel --no-deps -w dist . || SUCCESS=$?
31+
python setup.py bdist_wheel --dist-dir=dist --py-limited-api=cp38 || SUCCESS=$?
5832
echo "whl_status=${SUCCESS}" >> "$GITHUB_OUTPUT"
59-
BASE=$(./.github/scripts/convert-version ${{ inputs.python }})
6033
ls -alh dist
61-
WHL_FILEPATH=$(find dist -iname "*${BASE}*.whl")
34+
WHL_FILEPATH=$(find dist -type f -iname "*linux_x86_64.whl")
35+
echo "whl: ${WHL_FILEPATH}"
6236
RENAME=$(echo ${WHL_FILEPATH} | sed -e 's/linux_x86_64/manylinux_2_17_x86_64/')
37+
echo "rename: ${RENAME}"
6338
mv ${WHL_FILEPATH} ${RENAME}
6439
WHL=$(basename ${RENAME})
6540
echo "whl=${WHL}" >> "$GITHUB_OUTPUT"
6641
if [ ${SUCCESS} -ne 0 ]; then
6742
exit 1
6843
fi
6944
# sdist
70-
python3 setup.py sdist || SUCCESS=$?
45+
python setup.py sdist || SUCCESS=$?
7146
pyenv uninstall --force ${{ inputs.python}}/envs/${VENV}
7247
ls -alh dist
7348
TAR_FILEPATH=$(find dist -type f -iname "*.tar.gz")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: set up caches
2+
description: 'set up HF and Python caches'
3+
runs:
4+
using: composite
5+
steps:
6+
- run: |
7+
sudo mkdir -m 777 -p ${HF_HOME}
8+
sudo chown -R $(whoami):$(whoami) ${HF_HOME}
9+
sudo mkdir -m 777 -p ${PIP_CACHE_DIR}
10+
sudo chown -R $(whoami):$(whoami) ${PIP_CACHE_DIR}
11+
shell: bash

.github/actions/nm-hf-cache/action.yml

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

.github/actions/nm-install-whl/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ runs:
2222
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
2323
fi
2424
pip3 install -r requirements-dev.txt
25-
BASE=$(./.github/scripts/convert-version ${{ inputs.python }})
26-
WHL=$(find . -type f -iname "*${BASE}*.whl")
25+
WHL=$(find . -type f -iname "nm_vllm*.whl")
2726
WHL_BASENAME=$(basename ${WHL})
2827
echo "whl=${WHL_BASENAME}" >> "$GITHUB_OUTPUT"
2928
pip3 install ${WHL}[sparse] --extra-index-url https://pypi.neuralmagic.com/simple

.github/actions/nm-set-env/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ runs:
2828
# HF Cache
2929
echo "HF_TOKEN=${HF_TOKEN_SECRET}" >> $GITHUB_ENV
3030
echo "HF_HOME=/model-cache" >> $GITHUB_ENV
31+
# Python cache
32+
echo "PIP_CACHE_DIR=/model-cache/python-cache" >> $GITHUB_ENV
3133
# build
3234
NUM_THREADS=$(./.github/scripts/determine-threading -G ${{ inputs.Gi_per_thread }})
3335
echo "MAX_JOBS=${NUM_THREADS}" >> $GITHUB_ENV

.github/actions/nm-summary-build/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ inputs:
1313
python:
1414
description: 'python version info'
1515
required: true
16-
build_status:
17-
description: 'status from build step'
18-
required: true
1916
whl_status:
2017
description: 'status from build step'
2118
required: true
@@ -37,6 +34,5 @@ runs:
3734
echo "| gitref: | '${{ inputs.gitref }}' |" >> $GITHUB_STEP_SUMMARY
3835
echo "| branch name: | '${{ github.ref_name }}' |" >> $GITHUB_STEP_SUMMARY
3936
echo "| python: | ${{ inputs.python }} |" >> $GITHUB_STEP_SUMMARY
40-
echo "| build: | ${BUILD_EMOJI} |" >> $GITHUB_STEP_SUMMARY
4137
echo "| whl: | ${WHL_EMOJI} |" >> $GITHUB_STEP_SUMMARY
4238
shell: bash

.github/actions/nm-test-whl/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ runs:
1919
steps:
2020
- id: test_whl
2121
run: |
22+
sudo mkdir -m 777 -p /usr/local/apps
23+
sudo chown -R $(whoami):$(whoami) /usr/local/apps
2224
pip install coverage
2325
pip install pytest-cov
2426
pip install pytest-xdist
2527
pip install -r requirements-dev.txt
2628
SUCCESS=0
2729
VLLM_SRC=$(python3 -c "import vllm; print(vllm.__path__[0])")
28-
./.github/scripts/run-tests -s ${VLLM_SRC} -t ${{ inputs.test_directory }} -r ${{ inputs.test_results }} -f ${{ inputs.test_skip_list }}|| SUCCESS=$?
30+
./.github/scripts/run-tests -s ${VLLM_SRC} -t ${{ inputs.test_directory }} -r ${{ inputs.test_results }} || SUCCESS=$?
2931
pytest ./neuralmagic/tests/test_nm-vllm_licenses.py --junitxml=${{ inputs.test_results }}/test_nm-vllm_licenses.xml
3032
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
3133
exit ${SUCCESS}

.github/scripts/run-tests

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ usage() {
88
echo " -s - src directory, i.e. location of package *.py files."
99
echo " -t - test directory, i.e. location of *.py test files. (default 'tests/')"
1010
echo " -r - desired results base directory. xml results will mirror provided tests directory structure. (default 'test-results/')"
11-
echo " -f - file with test skip list, e.g. ' neuralmagic/tests/skip-for-remote-push.txt'. (default is to run all found tests)"
1211
echo " -h - this list of options"
1312
echo
1413
echo "note: all paths are relative to 'nm-vllm' root"
@@ -35,9 +34,6 @@ while getopts "hs:t:r:f:" OPT; do
3534
r)
3635
RESULTS_DIR="${OPTARG}"
3736
;;
38-
f)
39-
SKIP_LIST="${OPTARG}"
40-
;;
4137
esac
4238
done
4339

@@ -71,36 +67,6 @@ for FOUND in "${TESTS_FOUND[@]}"; do
7167
echo "${FOUND}"
7268
done
7369

74-
# build the skip list from provided file
75-
declare -a TESTS_TO_EXCLUDE
76-
if [ -f "${SKIP_LIST}" ]; then
77-
while IFS= read -r line
78-
do
79-
TESTS_TO_EXCLUDE+=("${line}")
80-
done < "${SKIP_LIST}"
81-
fi
82-
83-
echo "..."
84-
for EXCLUDE in "${TESTS_TO_EXCLUDE[@]}"; do
85-
for JJ in "${!TESTS_FOUND[@]}"; do
86-
if [[ ${TESTS_FOUND[$JJ]} = ${EXCLUDE} ]]; then
87-
echo "excluding: ${EXCLUDE}"
88-
unset 'TESTS_FOUND[$JJ]'
89-
fi
90-
done
91-
done
92-
93-
echo "..."
94-
echo "planning to run:"
95-
for TEST in "${TESTS_FOUND[@]}"
96-
do
97-
echo "${TEST}"
98-
done
99-
echo "..."
100-
101-
# download required artifacts for testing
102-
# (cd ${TEST_DIR} && sudo bash ../.buildkite/download-images.sh)
103-
10470
# run selected tests
10571
SUCCESS=0
10672
CC_PYTEST_FLAGS="--cov=${SRC_DIR} --cov=${TEST_DIR} --cov-report=html:cc-vllm-html --cov-append"

.github/workflows/nm-benchmark.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929
required: true
3030
push_benchmark_results_to_gh_pages:
3131
description: "When set to true, the workflow pushes all benchmarking results to gh-pages UI"
32-
type: string
32+
type: boolean
3333
required: true
3434

3535
# makes workflow manually callable
@@ -61,11 +61,8 @@ on:
6161
required: true
6262
push_benchmark_results_to_gh_pages:
6363
description: "When set to true, the workflow pushes all benchmarking results to gh-pages UI"
64-
type: choice
65-
options:
66-
- 'true'
67-
- 'false'
68-
default: 'false'
64+
type: boolean
65+
default: false
6966

7067
env:
7168
BENCHMARK_RESULTS: /model-cache/benchmark_results
@@ -109,11 +106,9 @@ jobs:
109106
Gi_per_thread: 1
110107
nvcc_threads: 0
111108

112-
- name: hf cache
113-
id: hf_cache
114-
uses: ./.github/actions/nm-hf-cache/
115-
with:
116-
fs_cache: ${{ secrets.HF_FS_CACHE }}
109+
- name: caches
110+
id: caches
111+
uses: ./.github/actions/nm-caches/
117112

118113
- name: download whl
119114
id: download

0 commit comments

Comments
 (0)