use ccache for raptor build
All checks were successful
Validate Operations / validate-operations (push) Successful in 57m44s

This commit is contained in:
NiccoloN
2026-03-30 17:43:22 +02:00
parent 3625edc80a
commit 42f8aee57f

View File

@@ -5,6 +5,11 @@ env:
PROTOBUF_REF: v34.0
CMAKE_VERSION: 4.3.0
MOLD_LINKER_FLAGS: -fuse-ld=mold
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_MAXSIZE: 10G
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_COMPILERCHECK: content
CCACHE_NOHASHDIR: "true"
on:
push:
@@ -24,7 +29,7 @@ jobs:
- name: Install system dependencies
run: |
sudo apt update
sudo apt install -y cmake ninja-build build-essential mold curl ca-certificates
sudo apt install -y cmake ninja-build build-essential mold curl ca-certificates ccache
- name: Install CMake
run: |
@@ -69,34 +74,43 @@ jobs:
- name: Install Python dependencies
run: pip install numpy onnx colorama
- name: Restore Raptor Build Cache
id: restore-raptor-build-cache
uses: ./.github/actions/restore-raptor-build-cache
- name: Restore ccache
id: restore-ccache
uses: actions/cache/restore@v4
with:
key: raptor-build-${{ runner.os }}-${{ github.ref_name }}-${{ env.LLVM_COMMIT }}-${{ env.PROTOBUF_REF }}-${{ env.CMAKE_VERSION }}-${{ github.sha }}
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ env.LLVM_COMMIT }}-${{ env.PROTOBUF_REF }}-${{ env.CMAKE_VERSION }}-${{ github.sha }}
restore-keys: |
raptor-build-${{ runner.os }}-${{ github.ref_name }}-${{ env.LLVM_COMMIT }}-${{ env.PROTOBUF_REF }}-${{ env.CMAKE_VERSION }}-
raptor-build-${{ runner.os }}-${{ env.LLVM_COMMIT }}-${{ env.PROTOBUF_REF }}-${{ env.CMAKE_VERSION }}-
ccache-${{ runner.os }}-${{ github.ref_name }}-${{ env.LLVM_COMMIT }}-${{ env.PROTOBUF_REF }}-${{ env.CMAKE_VERSION }}-
ccache-${{ runner.os }}-${{ env.LLVM_COMMIT }}-${{ env.PROTOBUF_REF }}-${{ env.CMAKE_VERSION }}-
- name: Build Raptor
id: build-raptor
run: |
ccache --set-config=max_size=${CCACHE_MAXSIZE}
ccache --zero-stats
ccache --show-config
ccache --show-stats
MLIR_DIR=$(pwd)/onnx-mlir/llvm-project/build/lib/cmake/mlir
cmake -S . -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DONNX_MLIR_ACCELERATORS=PIM \
-DONNX_MLIR_CCACHE_BUILD=ON \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DMLIR_DIR=${MLIR_DIR} \
-DCMAKE_EXE_LINKER_FLAGS="${MOLD_LINKER_FLAGS}" \
-DCMAKE_SHARED_LINKER_FLAGS="${MOLD_LINKER_FLAGS}" \
-DCMAKE_MODULE_LINKER_FLAGS="${MOLD_LINKER_FLAGS}"
cmake --build build
ccache --show-stats
- name: Save Raptor Build Cache
if: steps.build-raptor.outcome == 'success' && steps.restore-raptor-build-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/save-raptor-build-cache
- name: Save ccache
if: steps.build-raptor.outcome == 'success' && steps.restore-ccache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: raptor-build-${{ runner.os }}-${{ github.ref_name }}-${{ env.LLVM_COMMIT }}-${{ env.PROTOBUF_REF }}-${{ env.CMAKE_VERSION }}-${{ github.sha }}
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ env.LLVM_COMMIT }}-${{ env.PROTOBUF_REF }}-${{ env.CMAKE_VERSION }}-${{ github.sha }}
- name: Run validation
run: |