-
Notifications
You must be signed in to change notification settings - Fork 20
126 lines (112 loc) · 3.92 KB
/
Copy pathut.yml
File metadata and controls
126 lines (112 loc) · 3.92 KB
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
123
124
125
name: "Unit Tests"
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, synchronize, reopened, ready_for_review]
schedule:
- cron: '42 20 * * 4'
jobs:
UnitTest:
if: github.event_name != 'schedule'
defaults:
run:
shell: bash
timeout-minutes: 60
permissions:
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- platform: cuda
runner: [self-hosted, CUDA]
container: nvcr.io/nvidia/pytorch:26.03-py3
container_options: --privileged --ipc=host --gpus=all --ulimit memlock=-1:-1
- platform: rocm
runner: [self-hosted, ROCM]
container: rocm/pytorch:rocm6.2.3_ubuntu22.04_py3.10_pytorch_release_2.3.0
container_options: --privileged --ipc=host --security-opt seccomp=unconfined --group-add video --ulimit memlock=-1:-1
runs-on: ${{ matrix.runner }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.platform }}-${{ github.ref }}
cancel-in-progress: true
container:
image: ${{ matrix.container }}
options: ${{ matrix.container_options }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Dubious ownership exception
run: |
git config --global --add safe.directory /__w/ark/ark
- name: Build
run: |
apt-get update && apt-get install -y --no-install-recommends lcov
mkdir build && cd build
CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug"
if [ "${{ matrix.platform }}" = "rocm" ]; then
CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CXX_COMPILER=/opt/rocm/bin/hipcc"
fi
cmake $CMAKE_ARGS ..
make -j ut ark_py
- name: Run C++ UT (model validation)
if: github.event_name != 'schedule'
run: |
cd build
ARK_ROOT=$PWD ctest --stop-on-failure --verbose --schedule-random
- name: Run C++ UT (correctness)
if: github.event_name != 'schedule'
run: |
cd build
ARK_UT_CORRECTNESS=1 ARK_ROOT=$PWD ctest -L correctness --stop-on-failure --verbose --schedule-random
- name: Install Python Dependencies
if: github.event_name != 'schedule'
run: |
python3 -m pip install -r requirements.txt
- name: Run Python UT
if: github.event_name != 'schedule'
run: |
cd build
PYTHONPATH=$PWD/python ARK_ROOT=$PWD python3 -m pytest \
--cov=python/ark \
--cov-report lcov:py_coverage.info \
--verbose \
../python/unittest/
- name: C++ Coverage
if: github.event_name != 'schedule'
run: |
cd build
lcov --ignore-errors negative,mismatch --capture --directory . --output-file cpp_coverage.info
lcov --ignore-errors unused --remove cpp_coverage.info \
'/usr/*' \
'/tmp/*' \
'*/build/*' \
'*/third_party/*' \
'*/ark/*_test.*' \
'*/examples/*' \
'*/python/*' \
'*/ark/unittest/unittest_utils.cpp' \
'*/ark/ops/ops_test_common.*' \
--output-file cpp_coverage.info
lcov --list cpp_coverage.info
- name: Report Coverage
if: github.event_name != 'schedule'
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
if: github.event_name != 'schedule'
run: |
python3 -m pip install .
- name: Run Tutorials
if: github.event_name != 'schedule'
run: |
python3 ./examples/tutorial/quickstart_tutorial.py