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

Commit 9b8c474

Browse files
andy-neumaandy-neumaVarun Sundar Rabindranathmgoin
authored
various updates to "build whl" workflow (#59)
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 <andy@neuralmagic.com> Co-authored-by: Varun Sundar Rabindranath <varun@neuralmagic.com> Co-authored-by: Michael Goin <michael@neuralmagic.com>
1 parent c961a99 commit 9b8c474

File tree

12 files changed

+127
-11
lines changed

12 files changed

+127
-11
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ outputs:
1313
value: ${{ steps.whl.outputs.status }}
1414
whl:
1515
description: 'basename for generated whl'
16-
value: ${{ steps.build_whl.outputs.whl }}
16+
value: ${{ steps.whl.outputs.whl }}
1717
runs:
1818
using: composite
1919
steps:
@@ -25,6 +25,7 @@ runs:
2525
SUCCESS=0
2626
pip3 wheel --no-deps -w dist . || SUCCESS=$?
2727
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
28+
ls -alh dist/
2829
BASE=$(./.github/scripts/convert-version ${{ inputs.python }})
2930
WHL_FILEPATH=$(find dist -iname "*nm_vllm*${BASE}*.whl")
3031
WHL=$(basename ${WHL_FILEPATH})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: install and test whl
2+
description: 'install whl in venv and run tests'
3+
inputs:
4+
python:
5+
description: 'python version, e.g. 3.10.12'
6+
required: true
7+
venv:
8+
description: 'name for python virtual environment'
9+
required: true
10+
whl:
11+
description: 'filepath for magic_wand whl file'
12+
required: true
13+
test_directory:
14+
description: 'directory to test files'
15+
required: true
16+
test_results:
17+
description: 'desired directory for test results'
18+
required: true
19+
outputs:
20+
status:
21+
description: 'return test result'
22+
value: ${{ steps.whl_install_test.outputs.status }}
23+
runs:
24+
using: composite
25+
steps:
26+
- id: whl_install_test
27+
run: |
28+
COMMIT=${{ github.sha }}
29+
VENV="${{ inputs.venv }}-${COMMIT:0:7}"
30+
pyenv virtualenv ${VENV}
31+
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
32+
pip3 list
33+
ls -alh dist
34+
pip3 install ${{ inputs.whl }}
35+
pip3 install -r requirements-dev.txt
36+
SUCCESS=0
37+
./.github/scripts/run-tests -t ${{ inputs.test_directory }} -r ${{ inputs.test_results }} || SUCCESS=$?
38+
echo "status=${SUCCESS}" >> "$GITHUB_OUTPUT"
39+
exit ${SUCCESS}
40+
shell: bash

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

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ runs:
1111
using: composite
1212
steps:
1313
- run: |
14+
echo "TORCH_CUDA_ARCH_LIST=7.0 7.5 8.0 8.6 8.9 9.0+PTX" >> $GITHUB_ENV
1415
echo "HF_TOKEN=${HF_TOKEN_SECRET}" >> $GITHUB_ENV
1516
echo "HF_HOME=/EFS/hf_home" >> $GITHUB_ENV
1617
NUM_THREADS=$(./.github/scripts/determine-threading -G ${{ inputs.Gi_per_thread }})

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ runs:
3030
source $(pyenv root)/versions/${{ inputs.python }}/envs/${VENV}/bin/activate
3131
pip3 install --index-url http://${{ inputs.pypi }}:8080/ --trusted-host ${{ inputs.pypi }} magic-wand
3232
pip3 install -r requirements-dev.txt
33-
# run tests via runner script (serially)
33+
# run tests via runner script
3434
SUCCESS=0
3535
./.github/scripts/run-tests -t ${{ inputs.test_directory }} -r ${{ inputs.test_results }} || SUCCESS=$?
3636
echo "was this a SUCCESS? ${SUCCESS}"
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: summary whl
2+
description: 'creates a summary for whl workflow'
3+
inputs:
4+
label:
5+
description: 'GHA runner label'
6+
required: true
7+
gitref:
8+
description: 'git commit hash or branch name'
9+
required: true
10+
testmo_run_url:
11+
description: 'testmo URL for this particular run'
12+
required: true
13+
python:
14+
description: 'python version info'
15+
required: true
16+
whl:
17+
description: 'whl file tested'
18+
required: true
19+
runs:
20+
using: composite
21+
steps:
22+
- run: |
23+
TESTMO_URL=${{ inputs.testmo_run_url }}
24+
TEST_STATUS=${{ inputs.test_status }}
25+
TEST_EMOJI=$(./.github/scripts/step-status ${TEST_STATUS})
26+
echo "testmo URL: ${TESTMO_URL}" >> $GITHUB_STEP_SUMMARY
27+
echo ""
28+
echo "| Parameter | |" >> $GITHUB_STEP_SUMMARY
29+
echo "|---|---|" >> $GITHUB_STEP_SUMMARY
30+
echo "| label: | \`${{ inputs.label }}\` |" >> $GITHUB_STEP_SUMMARY
31+
echo "| git sha: | \`${{ github.sha }}\` |" >> $GITHUB_STEP_SUMMARY
32+
echo "| github actor: | '${{ github.actor }}' |" >> $GITHUB_STEP_SUMMARY
33+
echo "| gitref: | '${{ inputs.gitref }}' |" >> $GITHUB_STEP_SUMMARY
34+
echo "| branch name: | '${{ github.ref_name }}' |" >> $GITHUB_STEP_SUMMARY
35+
echo "| python: | ${{ inputs.python }} |" >> $GITHUB_STEP_SUMMARY
36+
echo "| whl: | ${{ inputs.whl }} |" >> $GITHUB_STEP_SUMMARY
37+
shell: bash

.github/workflows/build-whl.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ on:
4949
required: true
5050

5151
env:
52-
VENV_BASE: "WHL-TEST"
52+
VENV_BUILD_BASE: "BUILD"
53+
VENV_WHL_BASE: "WHL-TEST"
5354
WHL_TEST_RESULTS: "whl-test-results"
5455

5556
jobs:
@@ -81,7 +82,7 @@ jobs:
8182
uses: ./.github/actions/nm-set-python/
8283
with:
8384
python: ${{ inputs.python }}
84-
venv: ${{ env.VENV_BASE }}
85+
venv: ${{ env.VENV_BUILD_BASE }}
8586

8687
- name: create testmo run
8788
id: create_testmo_run
@@ -102,14 +103,15 @@ jobs:
102103
with:
103104
Gi_per_thread: ${{ inputs.Gi_per_thread }}
104105
python: ${{ inputs.python }}
105-
venv: ${{ env.VENV_BASE }}
106+
venv: ${{ env.VENV_BUILD_BASE }}
106107
pypi: ${{ secrets.NM_PRIVATE_PYPI_LOCATION }}
107108

108109
- name: build whl
109110
id: build_whl
110111
uses: ./.github/actions/nm-build-vllm-whl/
111112
with:
112113
python: ${{ inputs.python }}
114+
venv: ${{ env.VENV_BUILD_BASE }}
113115

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

124+
- name: summary
125+
uses: ./.github/actions/nm-whl-summary/
126+
with:
127+
label: ${{ inputs.build_label }}
128+
gitref: ${{ inputs.gitref }}
129+
testmo_run_url: https://neuralmagic.testmo.net/automation/runs/view/${{ steps.create_testmo_run.outputs.id }}
130+
python: ${{ inputs.python }}
131+
whl: ${{ steps.build_whl.outputs.whl }}
132+
122133
- name: complete testmo run
123-
uses: ./.github/actions/testmo-run-complete/
134+
uses: ./.github/actions/nm-testmo-run-complete/
124135
if: success() || failure()
125136
with:
126137
testmo_url: https://neuralmagic.testmo.net

.github/workflows/gen-whl.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: generate whl
2+
run-name: ${{ github.actor }} generating whl on branch '${{ github.ref }}'
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
gitref:
7+
description: 'git commit hash or branch name'
8+
type: string
9+
required: true
10+
11+
jobs:
12+
13+
AWS-AVX2-32G-A10G-24G:
14+
strategy:
15+
matrix:
16+
python: [3.8.17, 3.9.17, 3.10.12, 3.11.4]
17+
uses: ./.github/workflows/build-whl.yml
18+
with:
19+
build_label: aws-avx2-192G-4-a10g-96G
20+
timeout: 30
21+
gitref: ${{ inputs.gitref }}
22+
Gi_per_thread: 4
23+
python: ${{ matrix.python }}
24+
secrets: inherit

.github/workflows/remote-push.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ jobs:
3737
label: aws-avx2-32G-a10g-24G
3838
timeout: 180
3939
gitref: '${{ github.ref }}'
40-
Gi_per_thread: 4
40+
Gi_per_thread: 12
4141
python: ${{ matrix.python }}
4242
secrets: inherit

neuralmagic/__init__.py

Whitespace-only changes.

neuralmagic/benchmarks/__init__.py

-4
This file was deleted.

neuralmagic/benchmarks/scripts/__init__.py

Whitespace-only changes.

setup.py

+6
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@ def get_extra_requirements() -> dict:
474474
"License :: OSI Approved :: Apache Software License",
475475
"Topic :: Scientific/Engineering :: Artificial Intelligence",
476476
],
477+
license_files=('LICENSE', 'licenses/LICENSE.apache',
478+
'licenses/LICENSE.awq',
479+
'licenses/LICENSE.fastertransformer',
480+
'licenses/LICENSE.gptq', 'licenses/LICENSE.marlin',
481+
'licenses/LICENSE.punica', 'licenses/LICENSE.squeezellm',
482+
'licenses/LICENSE.tensorrtllm', 'licenses/LICENSE.vllm'),
477483
packages=setuptools.find_packages(exclude=("benchmarks", "csrc", "docs",
478484
"examples", "tests")),
479485
python_requires=">=3.8",

0 commit comments

Comments
 (0)