Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

additional updates to "bump-to-v0.3.2" #39

Merged
merged 17 commits into from
Feb 23, 2024
2 changes: 0 additions & 2 deletions .github/actions/nm-build-vllm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ runs:
steps:
- id: build
run: |
# TODO: this is a hack ... fix it later
# pyenv hardcoded ... python version hardcoded ...
COMMIT=${{ github.sha }}
VENV="${{ inputs.venv }}-${COMMIT:0:7}"
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
Expand Down
7 changes: 6 additions & 1 deletion .github/actions/nm-set-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ inputs:
hf_home:
description: 'Hugging Face home'
required: true
Gi_per_thread:
description: 'requested GiB to reserve per thread'
required: true
runs:
using: composite
steps:
- run: |
echo "HF_HOME=${HF_HOME_TOKEN}" >> $GITHUB_ENV
echo "TORCH_CUDA_ARCH_LIST=8.0+PTX" >> $GITHUB_ENV
NUM_THREADS=$(./.github/scripts/determine-threading -G ${{ inputs.Gi_per_thread }})
echo "MAX_JOBS=${NUM_THREADS}" >> $GITHUB_ENV
echo "VLLM_INSTALL_PUNICA_KERNELS=1" >> $GITHUB_ENV
echo "PYENV_ROOT=/usr/local/apps/pyenv" >> $GITHUB_ENV
echo "XDG_CONFIG_HOME=/usr/local/apps" >> $GITHUB_ENV
WHOAMI=$(whoami)
Expand Down
10 changes: 5 additions & 5 deletions .github/actions/nm-test-vllm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ inputs:
test_directory:
description: 'test directory, path is relative to neuralmagic-vllm'
required: true
test_xml:
description: 'filename for xml test results'
test_results:
description: 'top-level directory for xml test results'
required: true
python:
description: 'python version, e.g. 3.10.12'
Expand All @@ -23,14 +23,14 @@ runs:
- id: test
run: |
SUCCESS=0
# TODO: this is a hack ... fix it later
# pyenv hardcoded ... python version hardcoded ...
COMMIT=${{ github.sha }}
VENV="${{ inputs.venv }}-${COMMIT:0:7}"
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
pip3 install --index-url http://192.168.201.226:8080/ --trusted-host 192.168.201.226 magic-wand
pip3 install -r requirements-dev.txt
pytest --junitxml=${{ inputs.test_xml }} ${{ inputs.test_directory }} || SUCCESS=$?
# run tests via runner script (serially)
./.github/scripts/run-tests -t ${{ inputs.test_directory }} -r ${{ inputs.test_results }}
SUCCESS=$?
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
exit ${SUCCESS}
shell: bash
6 changes: 6 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SUMMARY:
"please provide a brief summary"

TEST PLAN:
"please outline how the changes were tested"

59 changes: 59 additions & 0 deletions .github/scripts/run-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash -e

usage() {
echo "Usage: ${0} <options>"
echo
echo " -t - test directory, i.e. location of *.py test files. (default 'tests/')"
echo " -r - desired results base directory. xml results will mirror provided tests directory structure. (default 'test-results/')"
echo " -h - this list of options"
echo
echo "note: all paths are relative to 'neuralmagic-vllm' root"
echo
exit 1
}

TEST_DIR=tests
RESULTS_DIR=test-results

while getopts "ht:r:" OPT; do
case "${OPT}" in
h)
usage
;;
t)
TEST_DIR="${OPTARG}"
;;
r)
RESULTS_DIR="${OPTARG}"
;;
esac
done

# check if variables are valid
if [ -z "${RESULTS_DIR}" ]; then
echo "please set desired results base directory"
usage
fi

if [ -z "${TEST_DIR}" ]; then
echo "please set test directory"
usage
fi

if [ ! -d "${TEST_DIR}" ]; then
echo "specified test directory, '${TEST_DIR}' does not exist ..."
usage
fi

# run tests serially
TESTS_DOT_PY=$(find ${TEST_DIR} -not -name "__init__.py" -name "*.py")
TESTS_TO_RUN=($TESTS_DOT_PY)
SUCCESS=0
for TEST in "${TESTS_TO_RUN[@]}"
do
RESULT_XML=$(echo ${TEST} | sed -e 's/${TEST_DIR}/${RESULTS_DIR}/' | sed -e 's/.py/.xml/')
pytest --junitxml=${RESULT_XML} ${TEST} || LOCAL_SUCCESS=$?
SUCCESS=$((SUCCESS + CURRENT_SUCCESS))
done

exit ${SUCCESS}
13 changes: 11 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
description: "git commit hash or branch name"
type: string
required: true
Gi_per_thread:
description: 'requested GiB to reserve per thread'
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
Expand All @@ -35,6 +39,10 @@ on:
description: "git commit hash or branch name"
type: string
required: true
Gi_per_thread:
description: 'requested GiB to reserve per thread'
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
Expand Down Expand Up @@ -62,6 +70,7 @@ jobs:
uses: ./.github/actions/nm-set-env/
with:
hf_home: ${{ secrets.NM_HF_HOME }}
Gi_per_thread: ${{ inputs.Gi_per_thread }}

- name: set python
id: set_python
Expand All @@ -88,7 +97,7 @@ jobs:
id: build
uses: ./.github/actions/nm-build-vllm/
with:
Gi_per_thread: 1
Gi_per_thread: ${{ inputs.Gi_per_thread }}
python: ${{ inputs.python }}
venv: TEST

Expand All @@ -97,7 +106,7 @@ jobs:
uses: ./.github/actions/nm-test-vllm/
with:
test_directory: tests
test_xml: test-results/all_tests.xml
test_results: test-results
python: ${{ inputs.python }}
venv: TEST

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/remote-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:
uses: ./.github/workflows/build-test.yml
with:
label: aws-avx2-32G-a10g-24G
timeout: 60
timeout: 180
gitref: '${{ github.ref }}'
Gi_per_thread: 4
python: ${{ matrix.python }}
secrets: inherit