-
Notifications
You must be signed in to change notification settings - Fork 11
60 lines (49 loc) · 1.63 KB
/
python-app.yml
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: 'triton_viz'
- name: Install Python
run: sudo apt install python3.10 -y
- name: Cache Dependencies
uses: actions/cache@v3
id: cache-pip
with:
path: /opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages
key: ${{ runner.os }}-pip-3.10-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Clone Triton and Install
if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
pip list
git clone https://github.com/openai/triton.git
cd triton/python
pip install -e .
- name: Install Dependencies if Cache Missed
if: steps.cache-pip.outputs.cache-hit != 'true'
run: |
cd triton_viz
/usr/bin/python3.10 -m pip install -e .
/usr/bin/python3.10 -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121
/usr/bin/python3.10 -m pip uninstall pytorch-triton -y
- name: Lint with pre-commit
run: |
cd triton_viz
pre-commit run --all-files
- name: Test with pytest
run: |
cd triton_viz
pytest Examples