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

Commit

Permalink
various updates to "build whl" workflow (#59)
Browse files Browse the repository at this point in the history
SUMMARY:
* updates whl generation workflow to add testing and `testmo`
integration
* add top-level generate whls workflow

TEST PLAN:
ran manually ...

---------

Co-authored-by: andy-neuma <[email protected]>
Co-authored-by: Varun Sundar Rabindranath <[email protected]>
Co-authored-by: Michael Goin <[email protected]>
  • Loading branch information
4 people authored Mar 1, 2024
1 parent c961a99 commit 9b8c474
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/actions/nm-build-vllm-whl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ outputs:
value: ${{ steps.whl.outputs.status }}
whl:
description: 'basename for generated whl'
value: ${{ steps.build_whl.outputs.whl }}
value: ${{ steps.whl.outputs.whl }}
runs:
using: composite
steps:
Expand All @@ -25,6 +25,7 @@ runs:
SUCCESS=0
pip3 wheel --no-deps -w dist . || SUCCESS=$?
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
ls -alh dist/
BASE=$(./.github/scripts/convert-version ${{ inputs.python }})
WHL_FILEPATH=$(find dist -iname "*nm_vllm*${BASE}*.whl")
WHL=$(basename ${WHL_FILEPATH})
Expand Down
40 changes: 40 additions & 0 deletions .github/actions/nm-install-test-whl/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: install and test whl
description: 'install whl in venv and run tests'
inputs:
python:
description: 'python version, e.g. 3.10.12'
required: true
venv:
description: 'name for python virtual environment'
required: true
whl:
description: 'filepath for magic_wand whl file'
required: true
test_directory:
description: 'directory to test files'
required: true
test_results:
description: 'desired directory for test results'
required: true
outputs:
status:
description: 'return test result'
value: ${{ steps.whl_install_test.outputs.status }}
runs:
using: composite
steps:
- id: whl_install_test
run: |
COMMIT=${{ github.sha }}
VENV="${{ inputs.venv }}-${COMMIT:0:7}"
pyenv virtualenv ${VENV}
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
pip3 list
ls -alh dist
pip3 install ${{ inputs.whl }}
pip3 install -r requirements-dev.txt
SUCCESS=0
./.github/scripts/run-tests -t ${{ inputs.test_directory }} -r ${{ inputs.test_results }} || SUCCESS=$?
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
exit ${SUCCESS}
shell: bash
1 change: 1 addition & 0 deletions .github/actions/nm-set-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ runs:
using: composite
steps:
- run: |
echo "TORCH_CUDA_ARCH_LIST=7.0 7.5 8.0 8.6 8.9 9.0+PTX" >> $GITHUB_ENV
echo "HF_TOKEN=${HF_TOKEN_SECRET}" >> $GITHUB_ENV
echo "HF_HOME=/EFS/hf_home" >> $GITHUB_ENV
NUM_THREADS=$(./.github/scripts/determine-threading -G ${{ inputs.Gi_per_thread }})
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/nm-test-vllm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
pip3 install --index-url http://${{ inputs.pypi }}:8080/ --trusted-host ${{ inputs.pypi }} magic-wand
pip3 install -r requirements-dev.txt
# run tests via runner script (serially)
# run tests via runner script
SUCCESS=0
./.github/scripts/run-tests -t ${{ inputs.test_directory }} -r ${{ inputs.test_results }} || SUCCESS=$?
echo "was this a SUCCESS? ${SUCCESS}"
Expand Down
37 changes: 37 additions & 0 deletions .github/actions/nm-whl-summary/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: summary whl
description: 'creates a summary for whl workflow'
inputs:
label:
description: 'GHA runner label'
required: true
gitref:
description: 'git commit hash or branch name'
required: true
testmo_run_url:
description: 'testmo URL for this particular run'
required: true
python:
description: 'python version info'
required: true
whl:
description: 'whl file tested'
required: true
runs:
using: composite
steps:
- run: |
TESTMO_URL=${{ inputs.testmo_run_url }}
TEST_STATUS=${{ inputs.test_status }}
TEST_EMOJI=$(./.github/scripts/step-status ${TEST_STATUS})
echo "testmo URL: ${TESTMO_URL}" >> $GITHUB_STEP_SUMMARY
echo ""
echo "| Parameter | |" >> $GITHUB_STEP_SUMMARY
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
echo "| label: | \`${{ inputs.label }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| git sha: | \`${{ github.sha }}\` |" >> $GITHUB_STEP_SUMMARY
echo "| github actor: | '${{ github.actor }}' |" >> $GITHUB_STEP_SUMMARY
echo "| gitref: | '${{ inputs.gitref }}' |" >> $GITHUB_STEP_SUMMARY
echo "| branch name: | '${{ github.ref_name }}' |" >> $GITHUB_STEP_SUMMARY
echo "| python: | ${{ inputs.python }} |" >> $GITHUB_STEP_SUMMARY
echo "| whl: | ${{ inputs.whl }} |" >> $GITHUB_STEP_SUMMARY
shell: bash
19 changes: 15 additions & 4 deletions .github/workflows/build-whl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ on:
required: true

env:
VENV_BASE: "WHL-TEST"
VENV_BUILD_BASE: "BUILD"
VENV_WHL_BASE: "WHL-TEST"
WHL_TEST_RESULTS: "whl-test-results"

jobs:
Expand Down Expand Up @@ -81,7 +82,7 @@ jobs:
uses: ./.github/actions/nm-set-python/
with:
python: ${{ inputs.python }}
venv: ${{ env.VENV_BASE }}
venv: ${{ env.VENV_BUILD_BASE }}

- name: create testmo run
id: create_testmo_run
Expand All @@ -102,14 +103,15 @@ jobs:
with:
Gi_per_thread: ${{ inputs.Gi_per_thread }}
python: ${{ inputs.python }}
venv: ${{ env.VENV_BASE }}
venv: ${{ env.VENV_BUILD_BASE }}
pypi: ${{ secrets.NM_PRIVATE_PYPI_LOCATION }}

- name: build whl
id: build_whl
uses: ./.github/actions/nm-build-vllm-whl/
with:
python: ${{ inputs.python }}
venv: ${{ env.VENV_BUILD_BASE }}

- name: upload whl
uses: actions/upload-artifact@v4
Expand All @@ -119,8 +121,17 @@ jobs:
path: dist/${{ steps.build_whl.outputs.whl }}
retention-days: 15

- name: summary
uses: ./.github/actions/nm-whl-summary/
with:
label: ${{ inputs.build_label }}
gitref: ${{ inputs.gitref }}
testmo_run_url: https://neuralmagic.testmo.net/automation/runs/view/${{ steps.create_testmo_run.outputs.id }}
python: ${{ inputs.python }}
whl: ${{ steps.build_whl.outputs.whl }}

- name: complete testmo run
uses: ./.github/actions/testmo-run-complete/
uses: ./.github/actions/nm-testmo-run-complete/
if: success() || failure()
with:
testmo_url: https://neuralmagic.testmo.net
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/gen-whl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: generate whl
run-name: ${{ github.actor }} generating whl on branch '${{ github.ref }}'
on:
workflow_dispatch:
inputs:
gitref:
description: 'git commit hash or branch name'
type: string
required: true

jobs:

AWS-AVX2-32G-A10G-24G:
strategy:
matrix:
python: [3.8.17, 3.9.17, 3.10.12, 3.11.4]
uses: ./.github/workflows/build-whl.yml
with:
build_label: aws-avx2-192G-4-a10g-96G
timeout: 30
gitref: ${{ inputs.gitref }}
Gi_per_thread: 4
python: ${{ matrix.python }}
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/remote-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ jobs:
label: aws-avx2-32G-a10g-24G
timeout: 180
gitref: '${{ github.ref }}'
Gi_per_thread: 4
Gi_per_thread: 12
python: ${{ matrix.python }}
secrets: inherit
Empty file removed neuralmagic/__init__.py
Empty file.
4 changes: 0 additions & 4 deletions neuralmagic/benchmarks/__init__.py

This file was deleted.

Empty file.
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,12 @@ def get_extra_requirements() -> dict:
"License :: OSI Approved :: Apache Software License",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
license_files=('LICENSE', 'licenses/LICENSE.apache',
'licenses/LICENSE.awq',
'licenses/LICENSE.fastertransformer',
'licenses/LICENSE.gptq', 'licenses/LICENSE.marlin',
'licenses/LICENSE.punica', 'licenses/LICENSE.squeezellm',
'licenses/LICENSE.tensorrtllm', 'licenses/LICENSE.vllm'),
packages=setuptools.find_packages(exclude=("benchmarks", "csrc", "docs",
"examples", "tests")),
python_requires=">=3.8",
Expand Down

0 comments on commit 9b8c474

Please sign in to comment.