Skip to content

Commit 9209f15

Browse files
andy-neumaandy-neuma
andauthored
additional updates to "bump-to-v0.3.2" (vllm-project#39)
SUMMARY * update `TORCH_CUDA_ARCH_LIST` to match `magic_wand` * update "test vllm" action to run tests serially * add helper script to find *.py tests, run them serially, and output JUnit formatted xml TEST working through changes manually on debug instance --------- Co-authored-by: andy-neuma <andy@neuralmagic.com>
1 parent 4b44479 commit 9209f15

File tree

7 files changed

+106
-22
lines changed

7 files changed

+106
-22
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ runs:
1919
steps:
2020
- id: build
2121
run: |
22-
# TODO: this is a hack ... fix it later
23-
# pyenv hardcoded ... python version hardcoded ...
2422
COMMIT=${{ github.sha }}
2523
VENV="${{ inputs.venv }}-${COMMIT:0:7}"
2624
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
name: set neuralmagic env
22
description: 'sets environment variables for neuralmagic'
33
inputs:
4-
hf_home:
4+
hf_token:
55
description: 'Hugging Face home'
66
required: true
7+
Gi_per_thread:
8+
description: 'requested GiB to reserve per thread'
9+
required: true
710
runs:
811
using: composite
912
steps:
1013
- run: |
11-
echo "HF_HOME=${HF_HOME_TOKEN}" >> $GITHUB_ENV
12-
echo "TORCH_CUDA_ARCH_LIST=8.0+PTX" >> $GITHUB_ENV
14+
echo "HF_TOKEN=${HF_TOKEN_SECRET}" >> $GITHUB_ENV
15+
NUM_THREADS=$(./.github/scripts/determine-threading -G ${{ inputs.Gi_per_thread }})
16+
echo "MAX_JOBS=${NUM_THREADS}" >> $GITHUB_ENV
17+
echo "VLLM_INSTALL_PUNICA_KERNELS=1" >> $GITHUB_ENV
1318
echo "PYENV_ROOT=/usr/local/apps/pyenv" >> $GITHUB_ENV
1419
echo "XDG_CONFIG_HOME=/usr/local/apps" >> $GITHUB_ENV
1520
WHOAMI=$(whoami)
1621
echo "PATH=/usr/local/apps/pyenv/plugins/pyenv-virtualenv/shims:/usr/local/apps/pyenv/shims:/usr/local/apps/pyenv/bin:/usr/local/apps/nvm/versions/node/v16.20.2/bin:/usr/local/cuda-12.1/bin:/usr/local/cuda-12.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/${WHOAMI}/.local/bin:" >> $GITHUB_ENV
1722
echo "LD_LIBRARY_PATH=/usr/local/cuda-12.1/lib64::/usr/local/cuda-12.1/lib64:" >> $GITHUB_ENV
1823
echo "PROJECT_ID=12" >> $GITHUB_ENV
1924
env:
20-
HF_HOME_TOKEN: ${{ inputs.hf_home }}
25+
HF_TOKEN_SECRET: ${{ inputs.hf_token }}
2126
shell: bash

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ inputs:
44
test_directory:
55
description: 'test directory, path is relative to neuralmagic-vllm'
66
required: true
7-
test_xml:
8-
description: 'filename for xml test results'
7+
test_results:
8+
description: 'top-level directory for xml test results'
99
required: true
1010
python:
1111
description: 'python version, e.g. 3.10.12'
@@ -22,15 +22,15 @@ runs:
2222
steps:
2323
- id: test
2424
run: |
25-
SUCCESS=0
26-
# TODO: this is a hack ... fix it later
27-
# pyenv hardcoded ... python version hardcoded ...
2825
COMMIT=${{ github.sha }}
2926
VENV="${{ inputs.venv }}-${COMMIT:0:7}"
3027
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
3128
pip3 install --index-url http://192.168.201.226:8080/ --trusted-host 192.168.201.226 magic-wand
3229
pip3 install -r requirements-dev.txt
33-
pytest --junitxml=${{ inputs.test_xml }} ${{ inputs.test_directory }} || SUCCESS=$?
30+
# run tests via runner script (serially)
31+
SUCCESS=0
32+
./.github/scripts/run-tests -t ${{ inputs.test_directory }} -r ${{ inputs.test_results }} || SUCCESS=$?
33+
echo "was this a SUCCESS? ${SUCCESS}"
3434
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
3535
exit ${SUCCESS}
3636
shell: bash

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SUMMARY:
2+
"please provide a brief summary"
3+
4+
TEST PLAN:
5+
"please outline how the changes were tested"
6+

.github/scripts/run-tests

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash -e
2+
3+
# simple helper script to manage concurrency while running tests
4+
5+
usage() {
6+
echo "Usage: ${0} <options>"
7+
echo
8+
echo " -t - test directory, i.e. location of *.py test files. (default 'tests/')"
9+
echo " -r - desired results base directory. xml results will mirror provided tests directory structure. (default 'test-results/')"
10+
echo " -h - this list of options"
11+
echo
12+
echo "note: all paths are relative to 'neuralmagic-vllm' root"
13+
echo
14+
exit 1
15+
}
16+
17+
TEST_DIR=tests
18+
RESULTS_DIR=test-results
19+
20+
while getopts "ht:r:" OPT; do
21+
case "${OPT}" in
22+
h)
23+
usage
24+
;;
25+
t)
26+
TEST_DIR="${OPTARG}"
27+
;;
28+
r)
29+
RESULTS_DIR="${OPTARG}"
30+
;;
31+
esac
32+
done
33+
34+
# check if variables are valid
35+
if [ -z "${RESULTS_DIR}" ]; then
36+
echo "please set desired results base directory"
37+
usage
38+
fi
39+
40+
if [ -z "${TEST_DIR}" ]; then
41+
echo "please set test directory"
42+
usage
43+
fi
44+
45+
if [ ! -d "${TEST_DIR}" ]; then
46+
echo "specified test directory, '${TEST_DIR}' does not exist ..."
47+
usage
48+
fi
49+
50+
# run tests serially
51+
TESTS_DOT_PY=$(find ${TEST_DIR} -not -name "__init__.py" -name "*.py")
52+
TESTS_TO_RUN=($TESTS_DOT_PY)
53+
SUCCESS=0
54+
for TEST in "${TESTS_TO_RUN[@]}"
55+
do
56+
LOCAL_SUCCESS=0
57+
RESULT_XML=$(echo ${TEST} | sed -e "s/${TEST_DIR}/${RESULTS_DIR}/" | sed -e "s/.py/.xml/")
58+
pytest --junitxml=${RESULT_XML} ${TEST} || LOCAL_SUCCESS=$?
59+
SUCCESS=$((SUCCESS + LOCAL_SUCCESS))
60+
done
61+
62+
if [ "${SUCCESS}" -eq "0" ]; then
63+
exit 0
64+
else
65+
exit 1
66+
fi

.github/workflows/build-test.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
description: "git commit hash or branch name"
1616
type: string
1717
required: true
18+
Gi_per_thread:
19+
description: 'requested GiB to reserve per thread'
20+
type: string
21+
required: true
1822
python:
1923
description: "python version, e.g. 3.10.12"
2024
type: string
@@ -35,6 +39,10 @@ on:
3539
description: "git commit hash or branch name"
3640
type: string
3741
required: true
42+
Gi_per_thread:
43+
description: 'requested GiB to reserve per thread'
44+
type: string
45+
required: true
3846
python:
3947
description: "python version, e.g. 3.10.12"
4048
type: string
@@ -61,7 +69,8 @@ jobs:
6169
id: setenv
6270
uses: ./.github/actions/nm-set-env/
6371
with:
64-
hf_home: ${{ secrets.NM_HF_HOME }}
72+
hf_token: ${{ secrets.NM_HF_TOKEN }}
73+
Gi_per_thread: ${{ inputs.Gi_per_thread }}
6574

6675
- name: set python
6776
id: set_python
@@ -88,7 +97,7 @@ jobs:
8897
id: build
8998
uses: ./.github/actions/nm-build-vllm/
9099
with:
91-
Gi_per_thread: 1
100+
Gi_per_thread: ${{ inputs.Gi_per_thread }}
92101
python: ${{ inputs.python }}
93102
venv: TEST
94103

@@ -97,7 +106,7 @@ jobs:
97106
uses: ./.github/actions/nm-test-vllm/
98107
with:
99108
test_directory: tests
100-
test_xml: test-results/all_tests.xml
109+
test_results: test-results
101110
python: ${{ inputs.python }}
102111
venv: TEST
103112

@@ -134,12 +143,13 @@ jobs:
134143
TEST_STATUS: ${{ steps.test.outputs.status }}
135144
run: |
136145
echo "checkout status: ${CHECKOUT}"
137-
if [[ "${CHECKOUT}" != *"success"* ]]; then exit 1; fi
138-
if [ ${LINT_STATUS} -ne 0 ]; then exit 1; fi
139-
if [ ${BUILD_STATUS} -ne 0 ]; then exit 1; fi
146+
echo "lint status: ${LINT_STATUS}"
140147
echo "build status: ${BUILD_STATUS}"
141-
if [ ${TEST_STATUS} -ne 0 ]; then exit 1; fi
142148
echo "test status: ${TEST_STATUS}"
149+
if [[ "${CHECKOUT}" != *"success"* ]]; then exit 1; fi
150+
if [ -z "${LINT_STATUS}" ] || [ "${LINT_STATUS}" -ne "0" ]; then exit 1; fi
151+
if [ -z "${BUILD_STATUS}" ] || [ "${BUILD_STATUS}" -ne "0" ]; then exit 1; fi
152+
if [ -z "${TEST_STATUS}" ] || [ "${TEST_STATUS}" -ne "0" ]; then exit 1; fi
143153
144154
- name: complete testmo run
145155
uses: ./.github/actions/nm-testmo-run-complete/

.github/workflows/remote-push.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ jobs:
1313

1414
# TODO: expand python matrix later, once CI system has
1515
# matured.
16-
# TODO: adjust timeout after we get a bit more experience.
17-
# making it 60 is a bit permissive.
1816

1917
# TODO: enable this later
2018
AWS-AVX2-32G-A10G-24G:
@@ -24,7 +22,8 @@ jobs:
2422
uses: ./.github/workflows/build-test.yml
2523
with:
2624
label: aws-avx2-32G-a10g-24G
27-
timeout: 60
25+
timeout: 180
2826
gitref: '${{ github.ref }}'
27+
Gi_per_thread: 4
2928
python: ${{ matrix.python }}
3029
secrets: inherit

0 commit comments

Comments
 (0)