2727 CPM_SOURCE_CACHE : ${{ github.workspace }}/mlir-tensorrt/.cache.cpm
2828 CMAKE_PRESET : distribution-wheels
2929 CCACHE_RESTORE_KEY : mlir-tensorrt-ccache-v1-${{ matrix.arch }}-distribution-wheels
30- CPM_KEY : mlir-tensorrt-cpm-v1
3130 CPM_RESTORE_KEY : mlir-tensorrt-cpm-v1
3231 runs-on : ${{ matrix.github_runner }}
3332 timeout-minutes : 120
6867 | sort | sha256sum | cut -d' ' -f1)
6968 echo "key=${{ env.CCACHE_RESTORE_KEY }}-${hash}" >> $GITHUB_OUTPUT
7069
70+ # Compute cpm key after checkout
71+ - name : Compute CPM Key
72+ id : cpm-key
73+ run : |
74+ hash=$(sha256sum mlir-tensorrt/DependencyProvider.cmake | cut -d' ' -f1)
75+ echo "key=${{ env.CPM_RESTORE_KEY }}-${hash}" >> $GITHUB_OUTPUT
76+
7177 # Restore cache, if exists.
7278 - name : Restore CCache
7379 id : restore-ccache
8389 id : restore-cpm
8490 uses : actions/cache/restore@v4
8591 with :
86- key : ${{ env.CPM_KEY }}
92+ key : ${{ steps.cpm-key.outputs.key }}
8793 enableCrossOsArchive : true
8894 restore-keys : |
8995 ${{ env.CPM_RESTORE_KEY }}
@@ -102,11 +108,9 @@ jobs:
102108 set -euo pipefail
103109 set -x
104110 cd mlir-tensorrt
105- export MLIR_TRT_DOWNLOAD_TENSORRT_VERSION=${{ matrix.trt }}
106111 # TODO: remove this, once patch is in our rockylinux prebuilt image
107112 dnf install -yq patch
108- # build wheels for mlir-tensorrt-compiler, mlir-tensorrt-runtime
109- PACKAGES="mlir_tensorrt_compiler mlir_tensorrt_runtime" \
113+ # build wheels for all available packages
110114 ./build_tools/scripts/cicd-build-wheels.sh
111115
112116 # Save ccache when cache is not hit or cache was a fallback(cache-matched is not the same as the cache key)
@@ -122,22 +126,42 @@ jobs:
122126 - name : Save CPM Cache
123127 # cpm cache is shared across x86_64 and aarch64, we let only x86_64 to save cpm cache when in cache miss case
124128 # this is to avoid both x86_64 and aarch64 to save cpm cache when in cache miss case
125- if : ${{ matrix.arch == 'x86_64' &&
126- (
127- steps.restore-cpm.outputs.cache-hit != 'true' ||
128- steps.restore-cpm.outputs['cache-matched-key'] != env.CPM_KEY
129- )
130- }}
129+ if : ${{ matrix.arch == 'x86_64' && steps.restore-cpm.outputs.cache-hit != 'true' }}
131130 uses : actions/cache/save@v4
132131 with :
133- key : ${{ env.CPM_KEY }}
132+ key : ${{ steps.cpm-key.outputs.key }}
134133 enableCrossOsArchive : true
135134 # exclude only works for the relative path pattern
136135 path : |
137136 mlir-tensorrt/.cache.cpm/*
138137 !mlir-tensorrt/.cache.cpm/tensorrt
139138 !mlir-tensorrt/.cache.cpm/tensorrt/**
140139
140+ - name : Smoke Test Wheels With CUDA:${{ matrix.cuda }} + TensorRT:${{ matrix.trt }}
141+ env :
142+ ENABLE_ASAN : " OFF"
143+ run : |
144+ set -euo pipefail
145+ set -x
146+ cd mlir-tensorrt
147+ uv sync --python 3.10 --extra cu13
148+ source .venv/bin/activate
149+ export JAX_PLATFORMS="mlir_tensorrt,cpu"
150+
151+ # Compute TensorRT library path from CPM cache by locating libnvinfer.so
152+ echo "CPM_SOURCE_CACHE: ${{ env.CPM_SOURCE_CACHE }}"
153+ CPM_TRT_DIR="${{ env.CPM_SOURCE_CACHE }}/tensorrt"
154+ TensorRT_LIB_PATH="$(find "${CPM_TRT_DIR}" -type f -name 'libnvinfer.so*' 2>/dev/null | head -n1 | xargs -r dirname)"
155+ if [[ -z "${TensorRT_LIB_PATH}" ]]; then
156+ echo "Error: Could not locate libnvinfer.so under ${CPM_TRT_DIR}" >&2
157+ exit 1
158+ fi
159+ echo "TensorRT_LIB_PATH: ${TensorRT_LIB_PATH}"
160+ export LD_LIBRARY_PATH="${TensorRT_LIB_PATH}:$LD_LIBRARY_PATH"
161+ uv pip install dist/mlir_tensorrt_jax-*-cp310-cp310*.whl
162+ # smoke test wheels
163+ python3 -m pytest integrations/PJRT/test/JAX/ -v
164+
141165 # Upload wheels to GitHub Actions artifact
142166 - name : Upload Wheels
143167 uses : actions/upload-artifact@v4
0 commit comments