forked from onnx/onnx-mlir
-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (74 loc) · 2.73 KB
/
macos-amd64-build.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
name: GitHub Action MacOS amd64
on:
pull_request:
push:
branches: [ main, feature/onnx-to-tosa ]
jobs:
build:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: remove system python
run: |
sudo rm -rf /Library/Frameworks/Python.framework/Versions/3* /usr/local/Frameworks/Python.framework/Versions/3* /usr/local/bin/python3* || true
- name: install tools that are needed for compilation
run: |
brew install automake ninja pybind11
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
# Create symlinks to intercept compiler calls without modifying the cmake invocation
create-symlink: true
key: ${{ runner.os }}-ccache
- name: install protobuf
run: |
cd ~/work
sh ~/work/onnx-mlir/onnx-mlir/utils/install-protobuf.sh
- name: cache MLIR directory
id: cache-mlir
uses: actions/cache@v3
with:
path: ~/work/onnx-mlir/llvm-project
key: ${{ runner.os }}-mlir-${{ hashFiles('**/clone-mlir.sh', '**/build-mlir.sh') }}
- name: clone & build MLIR
if: steps.cache-mlir.outputs.cache-hit != 'true'
run: |
cd ~/work/onnx-mlir
sh ~/work/onnx-mlir/onnx-mlir/utils/clone-mlir.sh
sh ~/work/onnx-mlir/onnx-mlir/utils/build-mlir.sh
- name: install python requirements
run: |
cd ~/work/onnx-mlir/onnx-mlir
python3 -m pip install --upgrade wheel
python3 -m pip install -r requirements.txt
- name: install third_party/onnx
run: |
cd ~/work/onnx-mlir/onnx-mlir/third_party/onnx
git fetch --prune --unshallow --tags
python3 -m pip install -v .
- name: build onnx-mlir
run: |
# Disable stablehlo to ease bumping; we don't need it.
export EXTRA_CMAKE_ARGS="-DONNX_MLIR_ENABLE_STABLEHLO=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
cd ~/work/onnx-mlir
sh ~/work/onnx-mlir/onnx-mlir/utils/install-onnx-mlir.sh
- name: build and run docs/doc_example tests
run: |
cd ~/work/onnx-mlir
sh ~/work/onnx-mlir/onnx-mlir/utils/check-doc-example.sh
- name: build and run unit tests
run: |
cd ~/work/onnx-mlir
sh ~/work/onnx-mlir/onnx-mlir/utils/check-unittest.sh
- name: run onnx-mlir backend and numerical tests
# Those tests are not relevant to the work on the xilinx fork, but take
# 40 min. Don't run them on PRs.
if: github.event_name != 'pull_request'
run: |
cd ~/work/onnx-mlir
sh ~/work/onnx-mlir/onnx-mlir/utils/check-onnx-backend-numerical.sh