Skip to content

Commit 160c92d

Browse files
authored
Improve CI time using uv for dependency setup (#2041)
SUMMARY: The goal of this pr is to speed up time to signal on new prs. Currently, we have the following CI tests: - `base-tests`: total runtime `4m26s`, install deps `3m43s`, run test `30s` - `pytorch-tests`: total runtime `3m27s`, install deps `3m4s`, run test `12s` - `quality-check`: total runtime `3m3s`, install deps `2m58s`, run test `0s` *times based on runs from this pr #2040. Note exact times will fluctuate substantially. After this pr, we have: - `base-tests`: total runtime `1m14s`, install deps `16s`, run test `41s` - `pytorch-tests`: total runtime `55s`, install deps `14s`, run test `22s` - `quality-check`: total runtime `19s`, install deps `10s`, run test `0s` *times based on runs from this pr fynnsu#1 on my fork. TEST PLAN: Tested by running CI. Signed-off-by: Fynn Schmitt-Ulms <[email protected]>
1 parent 6e459ed commit 160c92d

File tree

3 files changed

+31
-13
lines changed

3 files changed

+31
-13
lines changed

.github/workflows/quality-check.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
branches: [ main , 'release/*' ]
55
pull_request:
66
branches: [ main, 'release/*' ]
7+
8+
env:
9+
UV_SYSTEM_PYTHON: 1
10+
UV_TORCH_BACKEND: "auto"
11+
712
jobs:
813
quality-check:
914
runs-on: ubuntu-22.04
@@ -12,7 +17,9 @@ jobs:
1217
with:
1318
python-version: '3.10'
1419
- uses: actions/checkout@v4
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v6
1522
- name: "⚙️ Install dependencies"
16-
run: pip3 install .[dev]
23+
run: uv pip install .[dev]
1724
- name: "🧹 Running quality checks"
1825
run: make quality

.github/workflows/test-check-transformers.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ on:
1515
env:
1616
CADENCE: "commit"
1717
HF_TOKEN: ${{ secrets.HF_TOKEN_READ }}
18+
UV_SYSTEM_PYTHON: 1
19+
UV_TORCH_BACKEND: "auto"
1820

1921
concurrency:
2022
group: ${{ github.workflow }}-${{ github.ref }}
@@ -65,8 +67,10 @@ jobs:
6567
with:
6668
fetch-depth: 0
6769
fetch-tags: true
70+
- name: Install uv
71+
uses: astral-sh/setup-uv@v6
6872
- name: "⚙️ Install dependencies"
69-
run: pip3 install -U pip setuptools && pip3 install .[dev]
73+
run: uv pip install .[dev]
7074
- uses: actions/checkout@v4
7175
with:
7276
repository: "neuralmagic/compressed-tensors"
@@ -76,10 +80,10 @@ jobs:
7680
- name: "⚙️ Install compressed-tensors dependencies"
7781
id: install
7882
run: |
79-
pip3 uninstall -y compressed-tensors
83+
uv pip uninstall compressed-tensors
8084
export GIT_CEILING_DIRECTORIES="$(pwd)"
8185
cd compressed-tensors
82-
BUILD_TYPE=nightly pip3 install .
86+
BUILD_TYPE=nightly uv pip install .
8387
- name: "Clean compressed-tensors directory"
8488
run: rm -r compressed-tensors/
8589
- name: "⚙️ Prepare code coverage"

.github/workflows/test-check.yaml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313

1414
env:
1515
CADENCE: "commit"
16+
UV_SYSTEM_PYTHON: 1
17+
UV_TORCH_BACKEND: "auto"
1618

1719
jobs:
1820

@@ -28,8 +30,10 @@ jobs:
2830
with:
2931
fetch-depth: 0
3032
fetch-tags: true
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v6
3135
- name: "⚙️ Install dependencies"
32-
run: pip3 install -U pip setuptools && pip3 install .[dev]
36+
run: uv pip install .[dev]
3337
- uses: actions/checkout@v4
3438
with:
3539
repository: "neuralmagic/compressed-tensors"
@@ -38,10 +42,10 @@ jobs:
3842
fetch-tags: true
3943
- name: "⚙️ Install compressed-tensors dependencies"
4044
run: |
41-
pip3 uninstall -y compressed-tensors
45+
uv pip uninstall compressed-tensors
4246
export GIT_CEILING_DIRECTORIES="$(pwd)"
4347
cd compressed-tensors
44-
BUILD_TYPE=nightly pip3 install .
48+
BUILD_TYPE=nightly uv pip install .
4549
- name: "Clean compressed-tensors directory"
4650
run: rm -r compressed-tensors/
4751
- name: "⚙️ Prepare code coverage"
@@ -77,8 +81,10 @@ jobs:
7781
with:
7882
fetch-depth: 0
7983
fetch-tags: true
84+
- name: Install uv
85+
uses: astral-sh/setup-uv@v6
8086
- name: "⚙️ Install dependencies"
81-
run: pip3 install -U pip setuptools && pip3 install .[dev]
87+
run: uv pip install .[dev]
8288
- uses: actions/checkout@v4
8389
with:
8490
repository: "neuralmagic/compressed-tensors"
@@ -87,10 +93,10 @@ jobs:
8793
fetch-tags: true
8894
- name: "⚙️ Install compressed-tensors dependencies"
8995
run: |
90-
pip3 uninstall -y compressed-tensors
96+
uv pip uninstall compressed-tensors
9197
export GIT_CEILING_DIRECTORIES="$(pwd)"
9298
cd compressed-tensors
93-
BUILD_TYPE=nightly pip3 install .
99+
BUILD_TYPE=nightly uv pip install .
94100
- name: "Clean compressed-tensors directory"
95101
run: rm -r compressed-tensors/
96102
- name: "⚙️ Prepare code coverage"
@@ -131,11 +137,12 @@ jobs:
131137
- uses: actions/setup-python@v5
132138
with:
133139
python-version: '3.12'
134-
140+
- name: Install uv
141+
uses: astral-sh/setup-uv@v6
135142
- name: "Install dependencies"
136143
run: |
137-
pip3 install -U pip setuptools
138-
pip3 install coverage setuptools-scm
144+
uv pip install -U setuptools
145+
uv pip install coverage setuptools-scm
139146
make build # need to build to generate the version.py file
140147
141148
- name: "Combine and report coverage"

0 commit comments

Comments
 (0)