-
Notifications
You must be signed in to change notification settings - Fork 53
189 lines (167 loc) · 6.4 KB
/
regression.yaml
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
name: Regression
on:
workflow_dispatch:
inputs:
shutdown_instances:
description: 'Shut down GPU instances when finished.'
required: true
type: boolean
default: true
issue_comment:
types: [created]
jobs:
start_instances:
if: |
github.event_name == 'workflow_dispatch' ||
github.event_name == 'issue_comment' && github.event.issue.pull_request != '' &&
contains(fromJSON('["MEMBER", "OWNER", "COLLABORATOR"]'), github.event.comment.author_association) &&
contains(github.event.comment.body, '$hidet-ci launch')
runs-on: ubuntu-latest
outputs:
started_instances: ${{ steps.run_py_script.outputs.started_instances }}
hw_configs: ${{ steps.run_py_script.outputs.hw_configs }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies
run: pip install mysql-connector-python
- name: Run main Python script
id: run_py_script
run: timeout 900 python ./.github/scripts/start_instances.py
env:
# TODO: Allow launching only specified GPU instances
HW_CONFIG: all
REPO_NAME: ${{ github.repository }}
CI_DB_HOSTNAME: ${{ secrets.CI_DB_HOSTNAME }}
CI_DB_PORT: ${{ secrets.CI_DB_PORT }}
CI_DB_USERNAME: ${{ secrets.CI_DB_USERNAME }}
CI_DB_PASSWORD: ${{ secrets.CI_DB_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
- name: Upload run configs
uses: actions/upload-artifact@v3
with:
name: run_configs
path: run_configs.json
retention-days: 1
run_tests:
needs: start_instances
timeout-minutes: 2880
strategy:
matrix:
hw_configs: ${{ fromJSON(needs.start_instances.outputs.hw_configs) }}
runs-on: ${{ matrix.hw_configs }}
container:
image: nvcr.io/nvidia/pytorch:23.10-py3
options: --gpus all
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: |
${{ github.event_name == 'workflow_dispatch' && github.ref_name ||
format('refs/pull/{0}/head', github.event.issue.number) }}
path: hidet
- name: Checkout models
uses: actions/checkout@v4
with:
repository: ${{ secrets.MODEL_REPO }}
token: ${{ secrets.GH_PAT }}
path: models
ref: ci
- name: Install dependencies
run: |
pip install -r hidet/requirements.txt
pip install -r hidet/requirements-dev.txt
pip install -r hidet/.github/requirements-ci.txt
- name: Build hidet
run: |
bash hidet/scripts/wheel/build_wheel.sh
WHEEL=$(find hidet/scripts/wheel/built_wheel -maxdepth 1 -name '*.whl')
echo "WHEEL_NAME=$WHEEL" >> $GITHUB_ENV
echo "Built wheel: ${{ env.WHEEL_NAME }}"
- name: Install hidet
run: |
pip install --no-deps --force-reinstall ${{ env.WHEEL_NAME }}
- name: Install models
run: |
pip install -e models
- name: Download run configs
uses: actions/download-artifact@v3
with:
name: run_configs
- name: Clear cache
run: |
hidet cache clear --all
- name: Run tests
timeout-minutes: 2880
run: |
python hidet/.github/scripts/run_tests.py
env:
HW_CONFIG: ${{ matrix.hw_configs }}
REPO_NAME: ${{ github.repository }}
REPO_BRANCH: |
${{ github.event_name == 'workflow_dispatch' && github.ref_name ||
format('pull/{0}', github.event.issue.number) }}
CI_CS_HOSTNAME: ${{ secrets.CI_CS_HOSTNAME }}
CI_CS_PORT: ${{ secrets.CI_CS_PORT }}
CI_CS_USERNAME: ${{ secrets.CI_CS_USERNAME }}
CI_CS_PASSWORD: ${{ secrets.CI_CS_PASSWORD }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
- name: Upload run configs
uses: actions/upload-artifact@v3
with:
name: run_configs_${{ matrix.hw_configs }}
path: run_configs.json
retention-days: 1
upload_results:
runs-on: ubuntu-latest
needs: [start_instances, run_tests]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install dependencies
run: pip install mysql-connector-python
- name: Download run configs
uses: actions/download-artifact@v3
- name: Setup ENV
run: |
COMMIT_TIME=$(git log -1 --format=%cd --date=format:'%Y-%m-%d %H:%M:%S')
COMMIT_AUTHOR=$(git log -1 --format=%an)
COMMIT_SHA=$(git log -1 --format=%H)
echo "COMMIT_TIME=$COMMIT_TIME" >> $GITHUB_ENV
echo "COMMIT_AUTHOR=$COMMIT_AUTHOR" >> $GITHUB_ENV
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
- name: Run main Python script
run: python ./.github/scripts/upload_results.py
env:
REPO_NAME: ${{ github.repository }}
REPO_BRANCH: |
${{ github.event_name == 'workflow_dispatch' && github.ref_name ||
format('pull/{0}', github.event.issue.number) }}
COMMIT_SHA: ${{ env.COMMIT_SHA }}
COMMIT_TIME: ${{ env.COMMIT_TIME }}
COMMIT_AUTHOR: ${{ env.COMMIT_AUTHOR }}
HW_CONFIGS: ${{ needs.start_instances.outputs.hw_configs }}
CI_DB_HOSTNAME: ${{ secrets.CI_DB_HOSTNAME }}
CI_DB_PORT: ${{ secrets.CI_DB_PORT }}
CI_DB_USERNAME: ${{ secrets.CI_DB_USERNAME }}
CI_DB_PASSWORD: ${{ secrets.CI_DB_PASSWORD }}
stop_instances:
if: |
github.event_name == 'workflow_dispatch' && inputs.shutdown_instances ||
github.event_name == 'issue_comment' && github.event.issue.pull_request != '' &&
!contains(github.event.comment.body, '--keep')
runs-on: ubuntu-latest
needs: [start_instances, run_tests]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Run main Python script
run: timeout 900 python ./.github/scripts/stop_instances.py
env:
STARTED_INSTANCES: ${{ needs.start_instances.outputs.started_instances }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1