77#
88# At runtime the recipe swaps the image's FlashInfer for the first pinned
99# nightly containing the upstream SM100 low-M MXFP8 split-K kernel
10- # (flashinfer-ai/flashinfer#3847).
10+ # (flashinfer-ai/flashinfer#3847), then backports the AutoTuner non-Tensor guard
11+ # fix from flashinfer-ai/flashinfer#3918.
1112
1213source " $( dirname " $0 " ) /../../benchmark_lib.sh"
1314
@@ -23,7 +24,7 @@ check_env_vars \
2324 RANDOM_RANGE_RATIO \
2425 RESULT_FILENAME
2526
26- # --- FlashInfer nightly ------------------------------------ ------------------
27+ # --- FlashInfer nightly + AutoTuner non-Tensor guard patch ------------------
2728FLASHINFER_VERSION=0.6.15.dev20260710
2829FLASHINFER_NIGHTLY_TAG=nightly-v0.6.15-20260710
2930FLASHINFER_RELEASE_URL=" https://github.com/flashinfer-ai/flashinfer/releases/download/${FLASHINFER_NIGHTLY_TAG} "
@@ -36,6 +37,20 @@ python3 -m pip install \
3637 " ${FLASHINFER_RELEASE_URL} /flashinfer_jit_cache-${FLASHINFER_VERSION} +cu130-cp39-abi3-manylinux_2_28_$( uname -m) .whl" \
3738 || { echo " FlashInfer nightly install failed" >&2 ; exit 1; }
3839
40+ # The pinned nightly predates flashinfer-ai/flashinfer#3918. Apply only its
41+ # runtime fix; the upstream test change is intentionally not backported.
42+ FLASHINFER_PATCH=" $( dirname " $0 " ) /patches/flashinfer-autotuner-non-tensor-guard.patch"
43+ if ! command -v patch > /dev/null 2>&1 ; then
44+ apt-get update -y && apt-get install -y --no-install-recommends patch \
45+ || { echo " Failed to install patch(1)" >&2 ; exit 1; }
46+ fi
47+ SITE_PACKAGES=$( dirname " $( python3 -c " import importlib.util; print(importlib.util.find_spec('flashinfer').submodule_search_locations[0])" ) " ) \
48+ || { echo " Could not locate the installed flashinfer package" >&2 ; exit 1; }
49+ patch --dry-run -p1 -d " ${SITE_PACKAGES} " < " ${FLASHINFER_PATCH} " > /dev/null \
50+ || { echo " FlashInfer AutoTuner non-Tensor guard patch does not apply" >&2 ; exit 1; }
51+ patch -p1 -d " ${SITE_PACKAGES} " < " ${FLASHINFER_PATCH} " \
52+ || { echo " FlashInfer AutoTuner non-Tensor guard patch failed" >&2 ; exit 1; }
53+
3954# -----------------------------------------------------------------------------
4055
4156if [[ -n " ${MODEL_PATH:- } " ]]; then
0 commit comments