-
Notifications
You must be signed in to change notification settings - Fork 5
109 lines (91 loc) · 3.44 KB
/
main.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
name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# 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-20.04
strategy:
fail-fast: false
matrix:
python-version: ["3.9.16"]
steps:
- uses: actions/checkout@v3
# install transformers and specific versions of torch and torch-mlir
- name: install dependencies
working-directory: ${{github.workspace}}
run: |
sudo apt-get install python3.9
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3.9 get-pip.py
pip3.9 --version
pip3.9 install transformers
wget https://github.com/llvm/torch-mlir/releases/download/snapshot-20221015.627/torch-1.14.0.dev20221014+cpu-cp39-cp39-linux_x86_64.whl
wget https://github.com/llvm/torch-mlir/releases/download/snapshot-20221015.627/torch_mlir-20221015.627-cp39-cp39-linux_x86_64.whl
pip3.9 install torch-1.14.0.dev20221014+cpu-cp39-cp39-linux_x86_64.whl
pip3.9 install torch_mlir-20221015.627-cp39-cp39-linux_x86_64.whl
# install ninja
- name: install ninja for LLVM build
run: sudo apt-get install ninja-build
# setup LLVM
- name: install a specific version of LLVM
working-directory: ${{github.workspace}}
run: |
git clone https://github.com/llvm/llvm-project.git
cd llvm-project
git checkout 99020b3c73c1e22fa388be8fd0c44391d40b3a38
mkdir build
cd build
cmake -G Ninja ../llvm \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_BUILD_EXAMPLES=ON \
-DLLVM_TARGETS_TO_BUILD="X86;NVPTX;AMDGPU" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_INSTALL_UTILS=ON
cmake --build . --target check-mlir
# setup mlir-cgra
- name: setup mlir-cgra
working-directory: ${{github.workspace}}
run: |
export BUILD_DIR="${{github.workspace}}/llvm-project/build"
export PREFIX="${{github.workspace}}/llvm-project/build"
mkdir build && cd build
cmake -G Ninja .. \
-DLLVM_EXTERNAL_LIT=$BUILD_DIR/bin/llvm-lit \
-DMLIR_DIR=$PREFIX/lib/cmake/mlir
cmake --build . --target check-soda
# install clang-12/opt-12
- name: install LLVM and Clang for scripts/experiment
uses: egor-tensin/setup-clang@v1
with:
version: 12
platform: x64
# add path
- name: add paths
working-directory: ${{github.workspace}}
run: |
echo "${{github.workspace}}/llvm-project/build/bin" >> $GITHUB_PATH
echo "${{github.workspace}}/build/bin" >> $GITHUB_PATH
# run demo baseline
- name: run demo baseline
working-directory: ${{github.workspace}}
run: |
cd ./experiments/demo/baseline
sh script.sh
./simulate
# run demo cgra
- name: run demo cgra
working-directory: ${{github.workspace}}
run: |
cd ./experiments/demo/cgra
sh script.sh
./simulate