-
Notifications
You must be signed in to change notification settings - Fork 111
76 lines (63 loc) · 2.13 KB
/
enzyme-mlir.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: MLIR
on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
jobs:
build-linux:
name: MLIR ${{ matrix.build }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
build: ["Release", "Debug"] # "RelWithDebInfo"
llbuild: ["Release"]
os: [openstack22]
timeout-minutes: 500
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y binutils ninja-build cmake gcc g++ python3 python3-dev
- uses: actions/checkout@v3
with:
path: 'Enzyme'
- uses: actions/checkout@v3
with:
repository: 'pengmai/llvm-project'
ref: '205fb43c57fbf2307bf7ec17f07da2324250d26a'
path: 'llvm-project'
- name: Get MLIR commit hash
id: mlir-commit
working-directory: 'llvm-project'
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Cache MLIR
id: cache-mlir
uses: actions/cache@v3
with:
path: llvm-project/mlir-build
key: ${{ matrix.llbuild }}-${{ matrix.os }}-mlir-${{ steps.mlir-commit.outputs.sha_short }}
- name: MLIR build
if: steps.cache-mlir.outputs.cache-hit != 'true'
working-directory: 'llvm-project'
run: |
mkdir mlir-build && cd mlir-build
cmake ../llvm -GNinja -DLLVM_ENABLE_PROJECTS="llvm;clang;mlir;openmp" -DCMAKE_BUILD_TYPE=${{ matrix.llbuild }} \
-DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_TARGETS_TO_BUILD=X86 \
-DLLVM_USE_LINKER=gold -DLLVM_PARALLEL_LINK_JOBS=2 \
-DCLANG_ENABLE_STATIC_ANALYZER=OFF -DCLANG_ENABLE_ARCMT=OFF \
-DLLVM_OPTIMIZED_TABLEGEN=ON
ninja
- name: Enzyme build
working-directory: 'Enzyme'
run: |
mkdir enzyme-build && cd enzyme-build
cmake ../enzyme -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DLLVM_DIR=${{ github.workspace }}/llvm-project/mlir-build -DENZYME_MLIR=ON
ninja
- name: Check enzyme-mlir
working-directory: 'Enzyme/enzyme-build'
run: ninja check-enzymemlir