This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 10
195 lines (174 loc) · 6.52 KB
/
nm-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: nm build
on:
# makes workflow reusable
workflow_call:
inputs:
wf_category:
description: "categories: REMOTE, NIGHTLY, RELEASE"
type: string
default: "REMOTE"
build_label:
description: "requested runner label (specifies instance)"
type: string
required: true
timeout:
description: "time limit for run in minutes "
type: string
required: true
gitref:
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
nvcc_threads:
description: 'requested number of threads for nvcc'
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
required: true
outputs:
whl:
description: 'basename for generated whl'
value: ${{ jobs.BUILD.outputs.whl }}
# makes workflow manually callable
workflow_dispatch:
inputs:
wf_category:
description: "categories: REMOTE, NIGHTLY, RELEASE"
type: string
default: "REMOTE"
build_label:
description: "requested runner label (specifies instance)"
type: string
required: true
timeout:
description: "time limit for run in minutes "
type: string
required: true
gitref:
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
nvcc_threads:
description: 'requested number of threads for nvcc'
type: string
required: true
python:
description: "python version, e.g. 3.10.12"
type: string
required: true
env:
VENV_BASE: "BUILD"
jobs:
BUILD:
runs-on: ${{ inputs.build_label }}
timeout-minutes: ${{ fromJson(inputs.timeout) }}
permissions:
contents: 'read'
id-token: 'write'
outputs:
run_id: ${{ github.run_id }}
whl: ${{ steps.build.outputs.whl }}
tarfile: ${{ steps.build.outputs.tarfile }}
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.gitref }}
submodules: recursive
- name: setenv
id: setenv
uses: ./.github/actions/nm-set-env/
with:
wf_category: ${{ inputs.wf_category }}
hf_token: ${{ secrets.NM_HF_TOKEN }}
Gi_per_thread: ${{ inputs.Gi_per_thread }}
nvcc_threads: ${{ inputs.nvcc_threads }}
- name: set python
id: set_python
uses: neuralmagic/nm-actions/actions/[email protected]
with:
python: ${{ inputs.python }}
venv: ${{ env.VENV_BASE }}
- name: create testmo run
id: create_testmo_run
uses: ./.github/actions/nm-testmo-run-create/
if: success() || failure()
with:
testmo_url: https://neuralmagic.testmo.net
testmo_token: ${{ secrets.TESTMO_TEST_TOKEN }}
source: 'build-test'
- name: build
id: build
uses: ./.github/actions/nm-build-vllm/
with:
python: ${{ inputs.python }}
venv: ${{ env.VENV_BASE }}
# GCP
- name: 'Authenticate to Google Cloud'
id: auth
uses: google-github-actions/[email protected]
with:
project_id: ${{ secrets.GCP_PROJECT }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.NM_PYPI_SA }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 473.0.0'
- name: copy whl and source distribution
run: |
# echo "whl: ${{ steps.build.outputs.whl }}"
# echo "tarfile: ${{ steps.build.outputs.tarfile }}"
gcloud storage cp dist/${{ steps.build.outputs.whl }} gs://neuralmagic-public-pypi/assets/${{ github.run_id }}/${{ steps.build.outputs.whl }}
gcloud storage cp dist/${{ steps.build.outputs.tarfile }} gs://neuralmagic-public-pypi/assets/${{ github.run_id }}/${{ steps.build.outputs.tarfile }}
- name: upload whl
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ${{ steps.build.outputs.whl }}
path: dist/${{ steps.build.outputs.whl }}
retention-days: 5
- name: upload tar.gz
uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: ${{ inputs.python }}-${{ steps.build.outputs.tarfile }}
path: dist/${{ steps.build.outputs.tarfile }}
retention-days: 5
- name: summary
uses: ./.github/actions/nm-summary-build/
if: success() || failure()
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: ${{ steps.set_python.outputs.version }}
whl_status: ${{ steps.build.outputs.whl_status }}
- name: run status
id: run_status
if: success() || failure()
env:
BUILD_STATUS: ${{ steps.build.outputs.build_status }}
WHL_STATUS: ${{ steps.build.outputs.whl_status }}
run: |
echo "build status: ${WHL_STATUS}"
if [ -z "${WHL_STATUS}" ] || [ "${WHL_STATUS}" -ne "0" ]; then exit 1; fi
- name: complete testmo run
uses: ./.github/actions/nm-testmo-run-complete/
if: success() || failure()
with:
testmo_url: https://neuralmagic.testmo.net
testmo_token: ${{ secrets.TESTMO_TEST_TOKEN }}
testmo_run_id: ${{ steps.create_testmo_run.outputs.id }}