Skip to content

Commit d49641e

Browse files
authored
Swap from conda to uv on test workflow (#368)
1 parent ce9c3c0 commit d49641e

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

.github/workflows/test.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ jobs:
3333
- name: Check out code
3434
uses: actions/checkout@v4
3535

36-
- name: Set up Miniconda
37-
uses: conda-incubator/setup-miniconda@v3
36+
- name: Install uv
37+
uses: astral-sh/setup-uv@v6
3838
with:
39-
activate-environment: torch27
4039
python-version: ${{ matrix.python-version }}
41-
channels: defaults,pytorch,conda-forge
40+
enable-cache: true
41+
42+
- name: Create virtual environment
43+
run: |
44+
uv venv --python ${{ matrix.python-version }}
4245
4346
- name: Get current month
4447
id: date
@@ -48,37 +51,44 @@ jobs:
4851
uses: actions/cache@v4
4952
with:
5053
path: |
51-
~/.conda/pkgs
52-
~/.cache/pip
54+
~/.cache/uv
55+
~/.venv
5356
key: ${{ runner.os }}-deps-${{ matrix.python-version }}-${{ hashFiles('.github/workflows/test.yml', 'requirements.txt') }}-${{ steps.date.outputs.month }}
5457
restore-keys: |
5558
${{ runner.os }}-deps-
5659
5760
- name: Install PyTorch
5861
run: |
59-
pip3 install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
62+
source .venv/bin/activate
63+
uv pip install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
6064
6165
- name: Install Triton
6266
if: steps.cache.outputs.cache-hit != 'true'
6367
run: |
68+
set -x
69+
source .venv/bin/activate
6470
apt-get update
6571
apt-get install -y git
72+
apt-get install -y gcc-13 g++-13 zlib1g-dev
73+
export CC=gcc-13
74+
export CXX=g++-13
6675
mkdir -p /tmp/$USER
6776
cd /tmp/$USER
68-
pip uninstall -y triton pytorch-triton || true
77+
uv pip uninstall triton pytorch-triton || true
6978
rm -rf triton/ || true
7079
git clone https://github.com/triton-lang/triton.git
7180
cd triton/
72-
conda install -y -c conda-forge gcc_linux-64=13 gxx_linux-64=13 gcc=13 gxx=13
73-
pip install -r python/requirements.txt
74-
MAX_JOBS=$(nproc) TRITON_PARALLEL_LINK_JOBS=2 pip install .
81+
uv pip install -r python/requirements.txt
82+
MAX_JOBS=$(nproc) TRITON_PARALLEL_LINK_JOBS=2 uv pip install .
7583
cd /tmp/$USER
7684
rm -rf triton/
7785
7886
- name: Install Requirements
7987
run: |
80-
pip install -r requirements.txt
88+
source .venv/bin/activate
89+
uv pip install -r requirements.txt
8190
8291
- name: Run Tests
8392
run: |
84-
python -m unittest discover -s test/ -p "*.py" -v -t .
93+
source .venv/bin/activate
94+
pytest

0 commit comments

Comments
 (0)