-
Notifications
You must be signed in to change notification settings - Fork 16
94 lines (82 loc) · 2.71 KB
/
ut-cuda.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
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
name: "Unit Tests (CUDA)"
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize, reopened, ready_for_review]
jobs:
UnitTest:
runs-on: [ self-hosted, A100 ]
defaults:
run:
shell: bash
timeout-minutes: 30
strategy:
matrix:
cuda: [ cuda11.8, cuda12.2 ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.cuda }}
cancel-in-progress: true
container:
image: "ghcr.io/microsoft/ark/ark:base-dev-${{ matrix.cuda }}"
options: --privileged --ipc=host --gpus=all --ulimit memlock=-1:-1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: LockGPUClock
run: |
sudo nvidia-smi -pm 1
for i in $(seq 0 $(( $(nvidia-smi -L | wc -l) - 1 ))); do
sudo nvidia-smi -ac $(nvidia-smi --query-gpu=clocks.max.memory,clocks.max.sm --format=csv,noheader,nounits -i $i | sed 's/\ //') -i $i
done
- name: Dubious ownership exception
run: |
git config --global --add safe.directory /__w/ark/ark
- name: Build
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j ut ark_py
- name: Run C++ UT
run: |
cd build
ARK_ROOT=$PWD ctest --stop-on-failure --verbose --schedule-random
lcov --capture --directory . --output-file cpp_coverage.info
lcov --remove cpp_coverage.info \
'/usr/*' \
'/tmp/*' \
'*/build/*' \
'*/third_party/*' \
'*/ark/*_test.*' \
'*/examples/*' \
'*/python/*' \
'*/ark/unittest/unittest_utils.cpp' \
--output-file cpp_coverage.info
lcov --list cpp_coverage.info
- name: Install Python Dependencies
run: |
python3 -m pip install -r requirements.txt
- name: Run Python UT
run: |
cd build
PYTHONPATH=$PWD/python ARK_ROOT=$PWD python3 -m pytest \
--cov=../python/ark \
--cov-report lcov:py_coverage.info \
--verbose \
../python/unittest/test.py
- name: Report Coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
cd build
lcov -a cpp_coverage.info -a py_coverage.info -o coverage.info
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
- name: Install Python
run: |
python3 -m pip install .
- name: Run Tutorials
run: |
python3 ./examples/tutorial/quickstart_tutorial.py