Skip to content

Commit 92c8c23

Browse files
authored
Write test workflow without pt deps (#352)
1 parent b019ebd commit 92c8c23

File tree

1 file changed

+54
-23
lines changed

1 file changed

+54
-23
lines changed

.github/workflows/test.yml

Lines changed: 54 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,61 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
test_cuda126_a10g:
15+
test:
1616
name: test-cuda12.6-py${{ matrix.python-version }}-a10g
17+
18+
container:
19+
image: pytorch/almalinux-builder:cuda12.6
20+
options: --gpus all
21+
22+
runs-on: linux.g5.4xlarge.nvidia.gpu
23+
1724
strategy:
18-
fail-fast: true
1925
matrix:
2026
python-version: ["3.10", "3.12"]
21-
include:
22-
- name: A10G
23-
runs-on: linux.g5.4xlarge.nvidia.gpu
24-
torch-spec: '--pre torch --index-url https://download.pytorch.org/whl/nightly/cu126'
25-
gpu-arch-type: "cuda"
26-
gpu-arch-version: "12.6"
27-
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
28-
with:
29-
timeout: 60
30-
runner: ${{ matrix.runs-on }}
31-
gpu-arch-type: ${{ matrix.gpu-arch-type }}
32-
gpu-arch-version: ${{ matrix.gpu-arch-version }}
33-
submodules: recursive
34-
script: |
35-
conda create -n venv python=${{ matrix.python-version }} -y
36-
conda activate venv
37-
python -m pip install --upgrade pip
38-
pip install ${{ matrix.torch-spec }}
39-
./.github/scripts/install_triton.sh
40-
pip install -r requirements.txt
41-
python -m unittest discover -s test/ -p "*.py" -v -t .
27+
28+
defaults:
29+
run:
30+
shell: bash -l {0}
31+
32+
steps:
33+
- name: Check out code
34+
uses: actions/checkout@v4
35+
36+
- name: Set up Miniconda
37+
uses: conda-incubator/setup-miniconda@v3
38+
with:
39+
activate-environment: torch27
40+
python-version: ${{ matrix.python-version }}
41+
channels: defaults,pytorch,conda-forge
42+
43+
- name: Cache dependencies
44+
uses: actions/cache@v4
45+
with:
46+
path: |
47+
~/.conda/pkgs
48+
~/.cache/pip
49+
key: ${{ runner.os }}-deps-${{ matrix.python-version }}-${{ hashFiles('.github/workflows/test.yml', 'requirements.txt') }}
50+
restore-keys: |
51+
${{ runner.os }}-deps-
52+
53+
- name: Install CUDA
54+
run: |
55+
conda install nvidia/label/cuda-12.6.3::cuda-toolkit
56+
57+
- name: Install PyTorch
58+
run: |
59+
pip3 install -U --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
60+
61+
- name: Install Triton
62+
if: steps.cache.outputs.cache-hit != 'true'
63+
run: |
64+
./.github/scripts/install_triton.sh
65+
66+
- name: Install Requirements
67+
run: |
68+
pip install -r requirements.txt
69+
70+
- name: Run Tests
71+
run: |
72+
python -m unittest discover -s test/ -p "*.py" -v -t .

0 commit comments

Comments
 (0)