-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (115 loc) · 4.77 KB
/
tests-internal.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: tests_internal
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: [self-hosted, Linux, X64, 20.04, Ubuntu, intel]
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: [self-hosted, Linux, X64, 20.04, Ubuntu, amd]
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
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 ./
# Tessellate unit tests using IPU hardware
tessellate_unit_tests_ipu_hardware:
if: github.repository != 'graphcore-research/tessellate-ipu'
runs-on: [self-hosted, Linux, X64, 20.04, Ubuntu, pod16]
container:
image: graphcore/pytorch:3.2.0-ubuntu-20.04
options: --ulimit memlock=-1:-1 --cap-add=SYS_PTRACE --cap-add=IPC_LOCK --device=/dev/infiniband/ -e IPUOF_VIPU_API_HOST -e IPUOF_VIPU_API_PARTITION_ID --shm-size=128G
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: Instal Python base dependencies
id: pip-cache
run: |
python3 -m pip install --upgrade build cmake docker nanobind ninja pip scikit_build_core[pyproject]
# Necessary for attaching IPU hardware.
- name: Attach RDMA Network
run: |
python3 -c "import docker; client=docker.from_env(); client.networks.get('macvlan_rdma_swarm').connect(client.containers.get('${{ job.container.id }}'))"
gc-monitor
# 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
POPLAR_LOG_LEVEL=DEBUG TF_CPP_MIN_LOG_LEVEL=0 JAX_IPU_DEVICE_COUNT=1 python .github/scripts/check_ipu_hardware_device.py
- name: Install repository dependencies
run: |
pip3 install --default-timeout=100 -r ./test-requirements.txt
- name: Install TessellateIPU
run: |
python3 -m build --no-isolation
pip3 install dist/*.whl
# Run IPU hardware unit tests.
- name: Run TessellateIPU unit tests (hardware)
run: |
cd ./tests/
JAX_IPU_DEVICE_COUNT=2 pytest --tb=short -v --log-cli-level=INFO -m ipu_hardware ./