Files
Raptor/.github/workflows/validate_operations.yml
NiccoloN 2676f2c7ef
Some checks failed
Validate Operations / config (push) Successful in 1m7s
Validate Operations / build-mlir-cache (push) Successful in 2h1m3s
Validate Operations / validate (push) Failing after 56m7s
fix CI (hopefully)
2026-03-23 14:30:02 +01:00

120 lines
3.4 KiB
YAML

name: Validate Operations
env:
LLVM_COMMIT: 0c2701fe7fa002e1befc5f86c268a7964f96d286
PROTOBUF_COMMIT: v34.0
CMAKE_VERSION: 4.3.0
on:
push:
pull_request:
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:
needs: build-mlir-cache
runs-on: ubuntu-latest
steps:
- name: Checkout repository
run: |
git clone --depth 1 --recurse-submodules --branch ${GITHUB_REF_NAME} \
https://chef.heaplab.deib.polimi.it/git/${GITHUB_REPOSITORY}.git \
${GITHUB_WORKSPACE}
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y ninja-build build-essential curl ca-certificates
- name: Install CMake
run: |
ARCH="$(uname -m)"
case "$ARCH" in
x86_64) CMAKE_ARCH="linux-x86_64" ;;
aarch64|arm64) CMAKE_ARCH="linux-aarch64" ;;
*) echo "Unsupported architecture: $ARCH"; exit 1 ;;
esac
curl -fsSL -o /tmp/cmake.sh \
"https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-${CMAKE_ARCH}.sh"
sudo sh /tmp/cmake.sh --skip-license --prefix=/usr/local
rm -f /tmp/cmake.sh
cmake --version
which cmake
- 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
uses: dtolnay/rust-toolchain@stable
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Python dependencies
run: pip install numpy onnx colorama
- name: Restore MLIR cache
uses: actions/cache/restore@v4
with:
path: onnx-mlir/llvm-project
key: mlir-${{ runner.os }}-${{ env.LLVM_COMMIT }}
fail-on-cache-miss: true
- name: Build Raptor
run: |
MLIR_DIR=$(pwd)/onnx-mlir/llvm-project/build/lib/cmake/mlir
mkdir -p build && cd build
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DONNX_MLIR_ACCELERATORS=PIM \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DMLIR_DIR=${MLIR_DIR}
cmake --build .
- name: Run validation
run: |
python validate.py \
--raptor-path build/Debug/bin/onnx-mlir \
--onnx-include-dir onnx-mlir/include