Merge branch 'main' of github.com:HEAPLab/Raptor into main
This commit is contained in:
50
.github/workflows/build_mlir_cache.yml
vendored
Normal file
50
.github/workflows/build_mlir_cache.yml
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
name: Build MLIR Cache
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
llvm-commit:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-mlir:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Cache MLIR build
|
||||||
|
id: cache-mlir
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: onnx-mlir/llvm-project/build
|
||||||
|
key: mlir-${{ runner.os }}-${{ inputs.llvm-commit }}
|
||||||
|
|
||||||
|
- name: Install build dependencies
|
||||||
|
if: steps.cache-mlir.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y cmake ninja-build build-essential
|
||||||
|
|
||||||
|
- name: Clone LLVM
|
||||||
|
if: steps.cache-mlir.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
git clone --filter=blob:none --no-checkout https://github.com/llvm/llvm-project.git onnx-mlir/llvm-project
|
||||||
|
cd onnx-mlir/llvm-project
|
||||||
|
git fetch --depth 1 origin ${{ inputs.llvm-commit }}
|
||||||
|
git checkout FETCH_HEAD
|
||||||
|
|
||||||
|
- name: Build MLIR
|
||||||
|
if: steps.cache-mlir.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
mkdir -p onnx-mlir/llvm-project/build
|
||||||
|
cd onnx-mlir/llvm-project/build
|
||||||
|
cmake -G Ninja ../llvm \
|
||||||
|
-DLLVM_ENABLE_PROJECTS="mlir;clang" \
|
||||||
|
-DLLVM_ENABLE_RUNTIMES="openmp" \
|
||||||
|
-DLLVM_TARGETS_TO_BUILD="host" \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DLLVM_ENABLE_ASSERTIONS=ON \
|
||||||
|
-DLLVM_ENABLE_RTTI=ON \
|
||||||
|
-DENABLE_LIBOMPTARGET=OFF \
|
||||||
|
-DLLVM_ENABLE_LIBEDIT=OFF
|
||||||
|
cmake --build .
|
||||||
71
.github/workflows/validate_operations.yml
vendored
71
.github/workflows/validate_operations.yml
vendored
@@ -2,13 +2,30 @@ name: Validate Operations
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
LLVM_COMMIT: 0c2701fe7fa002e1befc5f86c268a7964f96d286
|
LLVM_COMMIT: 0c2701fe7fa002e1befc5f86c268a7964f96d286
|
||||||
|
PROTOBUF_COMMIT: v34.0
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Expose env vars as outputs so they can be passed to reusable workflows
|
||||||
|
config:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
llvm-commit: ${{ steps.set-vars.outputs.llvm-commit }}
|
||||||
|
steps:
|
||||||
|
- id: set-vars
|
||||||
|
run: echo "llvm-commit=$LLVM_COMMIT" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
build-mlir-cache:
|
||||||
|
needs: config
|
||||||
|
uses: ./.github/workflows/build_mlir_cache.yml
|
||||||
|
with:
|
||||||
|
llvm-commit: ${{ needs.config.outputs.llvm-commit }}
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
|
needs: build-mlir-cache
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -20,7 +37,32 @@ jobs:
|
|||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt update
|
sudo apt update
|
||||||
sudo apt install -y cmake ninja-build build-essential protobuf-compiler
|
sudo apt install -y cmake ninja-build build-essential
|
||||||
|
|
||||||
|
- name: Cache protobuf build
|
||||||
|
id: cache-protobuf
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
/usr/local/lib/libproto*
|
||||||
|
/usr/local/include/google/protobuf
|
||||||
|
key: protobuf-${{ runner.os }}-${{ env.PROTOBUF_COMMIT }}
|
||||||
|
|
||||||
|
- name: Install protobuf
|
||||||
|
if: steps.cache-protobuf.outputs.cache-hit != 'true'
|
||||||
|
run: |
|
||||||
|
git clone --depth 1 --branch ${{ env.PROTOBUF_COMMIT }} https://github.com/protocolbuffers/protobuf
|
||||||
|
cd protobuf
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||||
|
ninja
|
||||||
|
sudo ninja install
|
||||||
|
cd ../..
|
||||||
|
rm -rf protobuf
|
||||||
|
|
||||||
|
- name: Register installed libraries
|
||||||
|
run: sudo ldconfig
|
||||||
|
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
@@ -33,33 +75,12 @@ jobs:
|
|||||||
- name: Install Python dependencies
|
- name: Install Python dependencies
|
||||||
run: pip install numpy onnx colorama
|
run: pip install numpy onnx colorama
|
||||||
|
|
||||||
- name: Clone LLVM
|
- name: Restore MLIR cache
|
||||||
run: |
|
uses: actions/cache/restore@v4
|
||||||
git clone -n https://github.com/llvm/llvm-project.git onnx-mlir/llvm-project
|
|
||||||
cd onnx-mlir/llvm-project && git checkout ${{ env.LLVM_COMMIT }}
|
|
||||||
|
|
||||||
- name: Cache MLIR build
|
|
||||||
id: cache-mlir
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
path: onnx-mlir/llvm-project/build
|
path: onnx-mlir/llvm-project/build
|
||||||
key: mlir-${{ runner.os }}-${{ env.LLVM_COMMIT }}
|
key: mlir-${{ runner.os }}-${{ env.LLVM_COMMIT }}
|
||||||
|
fail-on-cache-miss: true
|
||||||
- name: Build MLIR
|
|
||||||
if: steps.cache-mlir.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
|
||||||
mkdir -p onnx-mlir/llvm-project/build
|
|
||||||
cd onnx-mlir/llvm-project/build
|
|
||||||
cmake -G Ninja ../llvm \
|
|
||||||
-DLLVM_ENABLE_PROJECTS="mlir;clang" \
|
|
||||||
-DLLVM_ENABLE_RUNTIMES="openmp" \
|
|
||||||
-DLLVM_TARGETS_TO_BUILD="host" \
|
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DLLVM_ENABLE_ASSERTIONS=ON \
|
|
||||||
-DLLVM_ENABLE_RTTI=ON \
|
|
||||||
-DENABLE_LIBOMPTARGET=OFF \
|
|
||||||
-DLLVM_ENABLE_LIBEDIT=OFF
|
|
||||||
cmake --build .
|
|
||||||
|
|
||||||
- name: Build Raptor
|
- name: Build Raptor
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
Use the following commands to install protobuf:
|
Use the following commands to install protobuf:
|
||||||
```
|
```
|
||||||
git clone https://github.com/protocolbuffers/protobuf
|
git clone --depth 1 --branch v34.0 https://github.com/protocolbuffers/protobuf
|
||||||
cd protobuf
|
cd protobuf
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
|||||||
Reference in New Issue
Block a user