-
Notifications
You must be signed in to change notification settings - Fork 9
161 lines (131 loc) · 5.29 KB
/
Ubuntu-latest.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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
name: Test on Ubuntu Linux
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
COMET_SRC: ${{github.workspace}}
jobs:
build-and-test-comet:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lukka/get-cmake@latest
# - name: Install CMake
# run: sudo apt-get install cmake && sudo apt-get install ninja-build
- name: Cache Submodules
id: cache-submodule
uses: actions/cache@v4
# if: always()
with:
path: |
${{github.workspace}}/llvm
${{github.workspace}}/blis/
${{github.workspace}}/install/
${{github.workspace}}/build/
key: ${{ runner.os }}-submodules
- name: Update git submodules
if: steps.cache-submodule.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build llvm
if: steps.cache-submodule.outputs.cache-hit != 'true'
run: mkdir ${{github.workspace}}/llvm/build && cd llvm/build/ && cmake -G Ninja ../llvm -DLLVM_ENABLE_PROJECTS="mlir;openmp;clang" -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release && ninja
- name: Build blis
if: steps.cache-submodule.outputs.cache-hit != 'true'
run: cd ${{github.workspace}} && patch -s -p0 < comet-blis.patch && cd blis && ./configure --prefix=$COMET_SRC/install --disable-shared auto && make && make install
- name: Build COMET
# Build your program with the given configuration
run: rm -rf ${{github.workspace}}/build && mkdir ${{github.workspace}}/build && cd ${{github.workspace}}/build && cmake -G Ninja .. -DMLIR_DIR=${{github.workspace}}/llvm/build/lib/cmake/mlir -DLLVM_DIR=${{github.workspace}}/llvm/build/lib/cmake/llvm -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release && ninja
# test-comet-backend:
# needs: build-comet
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# # - uses: lukka/get-cmake@latest
# - name: Install CMake
# run: sudo apt-get install cmake && sudo apt-get install ninja-build
# - name: Cache Submodules
# id: cache-submodule
# uses: actions/cache@v4
# # if: always()
# with:
# path: |
# ${{github.workspace}}/llvm
# ${{github.workspace}}/blis/
# ${{github.workspace}}/install/
# ${{github.workspace}}/build/
# key: ${{ runner.os }}-submodules
- name: Initialize Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install python dependencies
run: |
sudo apt-get install -y python3-psutil
sudo apt-get install -y python3-pip
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
run: ninja check-comet-integration
# ${{github.workspace}}/llvm/build/bin/mlir-cpu-runner --help
# ${{github.workspace}}/build/bin/comet-opt --help
# test-rust-frontend:
# needs: build-comet
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Cache Submodules
# id: cache-submodule
# uses: actions/cache@v4
# # if: always()
# with:
# path: |
# ${{github.workspace}}/llvm
# ${{github.workspace}}/blis/
# ${{github.workspace}}/install/
# ${{github.workspace}}/build/
# key: ${{ runner.os }}-submodules
# - name: Setup Rust environment
# run: rustup update stable && rustup default stable
# - name: Test Rust Frontend
# env:
# COMET_DIR: ${{github.workspace}}/
# working-directory: ${{github.workspace}}/frontends/rust/comet-rs
# run: |
# cargo build
# cargo test
test-cometpy:
needs: build-and-test-comet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache Submodules
id: cache-submodule
uses: actions/cache@v4
# if: always()
with:
path: |
${{github.workspace}}/llvm
${{github.workspace}}/blis/
${{github.workspace}}/install/
${{github.workspace}}/build/
key: ${{ runner.os }}-submodules
- name: Initialize Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Setup cometPy
run: cd ${{github.workspace}}/frontends/numpy-scipy/ && pip3 install -e .
- name: Test CometPy
working-directory: ${{github.workspace}}/frontends/numpy-scipy/integration_tests/
run: python3 numpy_integration.py -v