Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions .github/workflows/mlir-tensorrt-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ jobs:
mkdir -p ${{ github.workspace }}/ccache
mkdir -p ${{ github.workspace }}/.cache.cpm

# Create cache action
- name: Create cache action
id: core-build-cache
uses: actions/cache@v4
# Restore cache, if exists.
- name: Restore cache
id: restore-cache
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-mlir-tensorrt-cache-${{ hashFiles('mlir-tensorrt/**/*.cpp', 'mlir-tensorrt/**/*.h', 'mlir-tensorrt/build_tools/**/*') }}
restore-keys: |
Expand All @@ -125,8 +125,30 @@ jobs:
${{ github.workspace }}/.cache.cpm/*
!${{ github.workspace }}/.cache.cpm/tensorrt

# Run LIT tests with TensorRT 10
- name: Run MLIR-TensorRT lit tests with TensorRT 10
# TensorRT 10 tests
- name: TensorRT 10 build
uses: addnab/docker-run-action@v3
with:
image: ${{ env.DEFAULT_IMAGE }}
options: -v ${{ github.workspace }}/mlir-tensorrt:/mlir-tensorrt -v ${{ github.workspace }}/ccache:/ccache -v ${{ github.workspace }}/.cache.cpm:/.cache.cpm --gpus all
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
run: |
cd mlir-tensorrt
./build_tools/scripts/cicd_build.sh --build_only

- name: Save cache
id: save-cache
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-mlir-tensorrt-cache-${{ hashFiles('mlir-tensorrt/**/*.cpp', 'mlir-tensorrt/**/*.h', 'mlir-tensorrt/build_tools/**/*') }}
path: |
${{ github.workspace }}/ccache
${{ github.workspace }}/.cache.cpm/*
!${{ github.workspace }}/.cache.cpm/tensorrt

- name: TensorRT 10 test
uses: addnab/docker-run-action@v3
with:
image: ${{ env.DEFAULT_IMAGE }}
Expand All @@ -138,8 +160,8 @@ jobs:
cd mlir-tensorrt
./build_tools/scripts/cicd_build.sh

# Run LIT tests with TensorRT 10 & ASAN
- name: Run MLIR-TensorRT lit tests with TensorRT 10, ASAN enabled
# TensorRT 10 & ASAN
- name: TensorRT 10 ASAN test
uses: addnab/docker-run-action@v3
with:
image: ${{ env.DEFAULT_IMAGE }}
Expand Down
26 changes: 25 additions & 1 deletion mlir-tensorrt/build_tools/scripts/cicd_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@
set -ex
set -o pipefail

# Parse command line arguments
BUILD_ONLY=false
while [[ $# -gt 0 ]]; do
case $1 in
--build_only)
BUILD_ONLY=true
shift
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--build_only]"
echo " --build_only: Only build, skip tests"
exit 1
;;
esac
done

REPO_ROOT=$(pwd)
BUILD_DIR="${REPO_ROOT}/build"
export LLVM_LIT_ARGS=${LLVM_LIT_ARGS:-"-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --timeout=1200 --time-tests -Drun_long_tests=${RUN_LONG_TESTS}"}
Expand All @@ -17,5 +34,12 @@ rm -rf ${BUILD_DIR} || true

cmake -B${BUILD_DIR} --preset github-cicd

ninja -C ${BUILD_DIR} -k 0 check-all-mlir-tensorrt
if [[ "$BUILD_ONLY" == "true" ]]; then
echo "🔨 Building only (skipping tests)..."
ninja -C ${BUILD_DIR} -k 0 all
else
echo "🔨🧪 Building and testing..."
ninja -C ${BUILD_DIR} -k 0 check-all-mlir-tensorrt
fi

ccache --show-stats || true
Loading