-
Notifications
You must be signed in to change notification settings - Fork 31
112 lines (98 loc) · 3.81 KB
/
buildAndTestStructured.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
name: Structured Build and Test
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Structured Build and Test (Release Asserts)
runs-on: ubuntu-22.04
env:
LLVM_SYMBOLIZER_PATH: /usr/lib/llvm-14/bin/llvm-symbolizer
steps:
- name: Compute Structured base path
run: |
echo "STRUCTURED_MAIN_SRC_DIR=${GITHUB_WORKSPACE}/sandbox" | tee -a $GITHUB_ENV
echo "STRUCTURED_MAIN_BINARY_DIR=${GITHUB_WORKSPACE}/sandbox/build" | tee -a $GITHUB_ENV
echo "LLVM_SYSPATH=${GITHUB_WORKSPACE}/sandbox/build" | tee -a $GITHUB_ENV
echo "MLIR_RUNNER_UTILS_LIB=${GITHUB_WORKSPACE}/sandbox/build/lib/libmlir_runner_utils.so" | tee -a $GITHUB_ENV
echo "MLIR_C_RUNNER_UTILS_LIB=${GITHUB_WORKSPACE}/sandbox/build/lib/libmlir_c_runner_utils.so" | tee -a $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # v4.3.0
with:
python-version: 3.11
- name: Cache git folder
uses: actions/cache@v3
with:
path: sandbox/.git
key: git-folder
- name: Install dependencies from apt
uses: awalsh128/[email protected]
with:
packages: libcurl4-gnutls-dev
version: 1.0
- name: Checkout project
uses: actions/checkout@v3
with:
path: sandbox
submodules: recursive
- name: Install Ninja
uses: llvm/actions/install-ninja@6a57890d0e3f9f35dfc72e7e48bc5e1e527cdd6c # Jan 17
- name: Ccache for C++ compilation
uses: hendrikmuhs/ccache-action@621a41397ed83711c72862638d9ff6e63fca3041 # v1.2.3
with:
key: ${{ runner.os }}-structured
# LLVM needs serious cache size
max-size: 6G
- name: Install Python depends
run: |
cd ${STRUCTURED_MAIN_SRC_DIR}
python -m pip install -v -r requirements.txt
- name: Configure CMake
run: |
cmake \
-DPython3_EXECUTABLE=$(which python) \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER:FILEPATH=clang \
-DCMAKE_CXX_COMPILER:FILEPATH=clang++ \
-DLLVM_ENABLE_PROJECTS="mlir;clang;clang-tools-extra" \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_UTILS=ON \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_LIT_ARGS=-v \
-DLLVM_EXTERNAL_PROJECTS=structured \
-DLLVM_EXTERNAL_STRUCTURED_SOURCE_DIR=${STRUCTURED_MAIN_SRC_DIR} \
-DLLVM_ENABLE_LLD=ON \
-DLLVM_CCACHE_BUILD=ON \
-DMLIR_INCLUDE_INTEGRATION_TESTS=ON \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DMLIR_ENABLE_PYTHON_BENCHMARKS=ON \
-S${STRUCTURED_MAIN_SRC_DIR}/third_party/llvm-project/llvm \
-B${STRUCTURED_MAIN_BINARY_DIR} -G Ninja
echo "PYTHONPATH=${PYTHONPATH}:${STRUCTURED_MAIN_BINARY_DIR}/tools/structured/python_packages" | tee -a $GITHUB_ENV
- name: Build main project
run: |
cmake --build ${STRUCTURED_MAIN_BINARY_DIR} --target structured-all
ccache -s
- name: Run lit tests
run: |
cmake --build ${STRUCTURED_MAIN_BINARY_DIR} --target check-structured
- name: Run benchmarks
shell: bash # This enables the `-eo pipefail` flag to propagate script failures.
run: |
${GITHUB_WORKSPACE}/sandbox/benchmarks/inner_product/run.sh test | tee /tmp/result.jsonl
${GITHUB_WORKSPACE}/sandbox/benchmarks/inner_product/plot.sh -i /tmp/result.jsonl
- name: Archive benchmark plots
uses: actions/upload-artifact@v3
with:
name: structured-benchmark-plots
path: |
sandbox/benchmarks/**/*.pdf