-
Notifications
You must be signed in to change notification settings - Fork 453
190 lines (179 loc) · 5.76 KB
/
test-check.yaml
File metadata and controls
190 lines (179 loc) · 5.76 KB
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
name: Test Checks (Base/PyTorch)
on:
pull_request:
branches: [ main, 'release/*' ]
push:
branches: [ main, 'release/*' ]
workflow_dispatch:
inputs:
code_coverage:
description: if enabled, code coverage metrics will be collected during the test run
type: boolean
default: false
env:
CADENCE: "commit"
HF_TOKEN: ${{ secrets.HF_TOKEN_READ }}
UV_SYSTEM_PYTHON: 1
UV_TORCH_BACKEND: "auto"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
base-tests:
runs-on: ibm-wdc-k8s-vllm-h100-solo
env:
COVERAGE_FILE: ".coverage.base"
HF_TOKEN: ${{ secrets.HF_TOKEN_READ }}
strategy:
matrix:
python: ["3.10", "3.13"]
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: "⚙️ Install dependencies"
run: uv pip install .[dev]
- uses: actions/checkout@v4
with:
repository: "vllm-project/compressed-tensors"
path: "compressed-tensors"
fetch-depth: 0
fetch-tags: true
- name: "⚙️ Install compressed-tensors dependencies"
run: |
uv pip uninstall compressed-tensors
export GIT_CEILING_DIRECTORIES="$(pwd)"
cd compressed-tensors
BUILD_TYPE=nightly uv pip install .
- name: "Clean compressed-tensors directory"
run: rm -r compressed-tensors/
- name: "⚙️ Prepare code coverage"
if: inputs.code_coverage
uses: ./.github/actions/prepare-code-coverage
- name: "🔬 Running base tests"
run: make test
- name: "Upload coverage report"
if: (success() || failure()) && inputs.code_coverage
uses: actions/upload-artifact@v4
with:
name: base-tests-coverage-results
path: |
.coverage*
coverage-html
coverage.json
include-hidden-files: true
retention-days: 5
- name: "Report coverage"
if: (success() || failure()) && inputs.code_coverage
run: |
coverage report --data-file="$COVERAGE_FILE" --skip-empty --format="markdown" > "$GITHUB_STEP_SUMMARY"
pytorch-tests:
runs-on: gcp-k8s-vllm-l4-solo
env:
COVERAGE_FILE: ".coverage.pytorch"
HF_TOKEN: ${{ secrets.HF_TOKEN_READ }}
strategy:
matrix:
python: ["3.10", "3.13"]
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: "⚙️ Install dependencies"
run: uv pip install .[dev]
- uses: actions/checkout@v4
with:
repository: "vllm-project/compressed-tensors"
path: "compressed-tensors"
fetch-depth: 0
fetch-tags: true
- name: "⚙️ Install compressed-tensors dependencies"
run: |
uv pip uninstall compressed-tensors
export GIT_CEILING_DIRECTORIES="$(pwd)"
cd compressed-tensors
BUILD_TYPE=nightly uv pip install .
- name: "Clean compressed-tensors directory"
run: rm -r compressed-tensors/
- name: "⚙️ Prepare code coverage"
if: inputs.code_coverage
uses: ./.github/actions/prepare-code-coverage
- name: "🔬 Running pytorch tests"
run: |
pytest -vra tests/llmcompressor/pytorch
- name: "Upload coverage report"
if: (success() || failure()) && inputs.code_coverage
uses: actions/upload-artifact@v4
with:
name: pytorch-tests-coverage-results
path: |
.coverage*
coverage-html
coverage.json
include-hidden-files: true
retention-days: 5
- name: "Report coverage"
if: (success() || failure()) && inputs.code_coverage
run: |
coverage report --data-file="$COVERAGE_FILE" --skip-empty --format="markdown" > "$GITHUB_STEP_SUMMARY"
combine-coverage:
runs-on: gcp-k8s-vllm-util
needs: [base-tests, pytorch-tests]
if: (success() || failure()) && inputs.code_coverage
steps:
- name: "Checkout llm-compressor"
uses: actions/checkout@v4
- name: "Download coverage artifacts"
uses: actions/download-artifact@v4
with:
merge-multiple: true
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install make
run: |
sudo apt-get update
sudo apt-get install -y make
- name: "Install dependencies"
run: |
uv pip install -U setuptools
uv pip install coverage setuptools-scm
make build # need to build to generate the version.py file
- name: "Combine and report coverage"
run: |
cat << EOF > .coveragerc
[paths]
source =
src/
*/site-packages/
EOF
coverage combine
coverage report --skip-empty --format="markdown" >> "$GITHUB_STEP_SUMMARY"
coverage html --directory coverage-html
coverage json -o coverage.json
- name: "Upload coverage report"
uses: actions/upload-artifact@v4
with:
name: combined-coverage-results
path: |
.coverage
coverage-html
coverage.json
include-hidden-files: true
retention-days: 5