-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (73 loc) · 2.67 KB
/
tests-public.yaml
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
name: tests
env:
GIT_MAIN_BRANCH: "main"
# Controls when the workflow will run.
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
jobs:
lint_and_typecheck:
if: github.repository == 'graphcore-research/tessellate-ipu'
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Cancel previous
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
if: ${{github.ref != 'refs/head/main'}}
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: pre-commit/[email protected]
# Tessellate unit tests using IPU model
tessellate_unit_tests_ipu_model:
if: github.repository == 'graphcore-research/tessellate-ipu'
runs-on: ubuntu-latest
container: graphcore/pytorch:3.2.0-ubuntu-20.04
timeout-minutes: 20
steps:
- name: Cancel previous
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
if: ${{github.ref != 'refs/head/main'}}
- uses: actions/checkout@v3
- name: Update pip
id: pip-cache
run: |
python3 -m pip install --upgrade build cmake nanobind ninja pip scikit_build_core[pyproject]
# Install JAX for IPU.
- name: Install JAX for IPU
run: |
pip3 install --default-timeout=100 -U numpy==1.23.5 scipy etils pytest
pip3 install jax==0.3.16+ipu jaxlib==0.3.15+ipu.sdk320 -f https://graphcore-research.github.io/jax-experimental/wheels.html
# Install other dependencies.
- name: Install dependencies
run: |
pip3 install --default-timeout=100 -r ./test-requirements.txt
# Build & install sdist package.
- name: Install TessellateIPU
run: |
python3 -m build --no-isolation --sdist
pip3 install dist/*.tar.gz
# Run repository unit tests.
- name: Run TessellateIPU unit tests (model)
run: |
cd ./tests/
JAX_IPU_USE_MODEL=true JAX_IPU_MODEL_NUM_TILES=16 pytest --tb=short -v --log-cli-level=INFO ./
# Dockerized workflow known to create issues with self-hosted servers.
# Solution is to fully cleanup the workspace for the next action.
# See: https://stackoverflow.com/questions/70483902/how-to-actually-clean-up-the-repository-on-self-hosted-runner-after-github-actio
- name: Cleanup GITHUB_WORKSPACE folder
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./