diff --git a/abseil.sh b/abseil.sh index a96c02a365..c07fd5d103 100644 --- a/abseil.sh +++ b/abseil.sh @@ -1,6 +1,6 @@ package: abseil version: "%(tag_basename)s" -tag: "20240722.0" +tag: "20250814.0" requires: - "GCC-Toolchain:(?!osx)" license: Apache v2 diff --git a/autotools.sh b/autotools.sh index 776e9974dd..9e973727ef 100644 --- a/autotools.sh +++ b/autotools.sh @@ -17,7 +17,10 @@ build_requires: #!/bin/bash -e unset CXXFLAGS -unset CFLAGS +# Not unset: GCC 14 turns implicit declarations, implicit int and mismatched +# pointers into errors, and these sources predate that. gettext 0.20.1 calls +# free() without , for one. +export CFLAGS="-Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types" export EMACS=no case $ARCHITECTURE in @@ -81,22 +84,15 @@ pushd libtool* hash -r popd -# Do not judge me. I am simply trying to float. -# Apparently slc6 needs a different order compared -# to the rest. -case $ARCHITECTURE in - slc6*|ubuntu14*) - # automake -- requires: m4, autoconf, gettext - pushd automake* - $USE_AUTORECONF && [ -e bootstrap ] && sh ./bootstrap - ./configure --prefix $INSTALLROOT - make MAKEINFO=true ${JOBS+-j $JOBS} - make MAKEINFO=true install - hash -r - popd - ;; - *) ;; -esac +# automake -- requires: m4, autoconf. Must come before gettext, whose +# autoreconf needs our aclocal rather than the host's. +pushd automake* + if $USE_AUTORECONF && [ -e bootstrap ]; then sh ./bootstrap; fi + ./configure --prefix $INSTALLROOT + make MAKEINFO=true ${JOBS+-j $JOBS} + make MAKEINFO=true install + hash -r +popd # gettext -- requires: nothing special @@ -121,22 +117,6 @@ pushd gettext* hash -r popd -# Do not judge me. I am simply trying to float. -case $ARCHITECTURE in - slc6*|ubuntu14*) ;; - *) - # automake -- requires: m4, autoconf, gettext - pushd automake* - $USE_AUTORECONF && [ -e bootstrap ] && sh ./bootstrap - ./configure --prefix $INSTALLROOT - make MAKEINFO=true ${JOBS+-j $JOBS} - make MAKEINFO=true install - hash -r - popd - ;; -esac - - # pkgconfig -- requires: nothing special pushd pkg-config* OLD_LDFLAGS="$LDFLAGS" diff --git a/cudnn_frontend.sh b/cudnn_frontend.sh new file mode 100644 index 0000000000..82e4e857be --- /dev/null +++ b/cudnn_frontend.sh @@ -0,0 +1,21 @@ +package: cudnn_frontend +version: "%(tag_basename)s" +tag: v1.24.0 +license: MIT +source: https://github.com/NVIDIA/cudnn-frontend +build_requires: + - alibuild-recipe-tools +--- +#!/bin/bash -e + +# ONNXRuntime's CUDA provider pulls this in with FetchContent, which aliBuild +# forbids from downloading (-DFETCHCONTENT_FULLY_DISCONNECTED=ON). It is handed +# $CUDNN_FRONTEND_ROOT as FETCHCONTENT_SOURCE_DIR_CUDNN_FRONTEND and calls +# add_subdirectory() on it, so install the source tree rather than headers. +# Version from onnxruntime's cmake/deps.txt at the tag we build. +rsync -a --chmod=ug=rwX --exclude '**/.git' --delete --delete-excluded \ + "$SOURCEDIR"/ "$INSTALLROOT"/ + +MODULEDIR="$INSTALLROOT/etc/modulefiles" +mkdir -p "$MODULEDIR" +alibuild-generate-module --cmake > "$MODULEDIR/$PKGNAME" diff --git a/cutlass.sh b/cutlass.sh new file mode 100644 index 0000000000..c52939b9f3 --- /dev/null +++ b/cutlass.sh @@ -0,0 +1,20 @@ +package: cutlass +version: "%(tag_basename)s" +tag: v4.4.2 +license: BSD-3-Clause +source: https://github.com/NVIDIA/cutlass +build_requires: + - alibuild-recipe-tools +--- +#!/bin/bash -e + +# Source tree, not an install: ONNXRuntime receives $CUTLASS_ROOT as +# FETCHCONTENT_SOURCE_DIR_CUTLASS and add_subdirectory()s it. See +# cudnn_frontend.sh, which exists for the same reason. +# Version from onnxruntime's cmake/deps.txt at the tag we build. +rsync -a --chmod=ug=rwX --exclude '**/.git' --delete --delete-excluded \ + "$SOURCEDIR"/ "$INSTALLROOT"/ + +MODULEDIR="$INSTALLROOT/etc/modulefiles" +mkdir -p "$MODULEDIR" +alibuild-generate-module --cmake > "$MODULEDIR/$PKGNAME" diff --git a/gpu-system.sh b/gpu-system.sh index dbbdb79752..29457db638 100644 --- a/gpu-system.sh +++ b/gpu-system.sh @@ -202,7 +202,22 @@ prefer_system_check: | add_feature - miopen fi - if [[ $ALIBUILD_O2_FORCE_GPU_MIGRAPHX == 1 ]] || [[ $GPU_FEATURES =~ (^|-)"miopen"(-|_|$) && ${ALIBUILD_O2_FORCE_GPU_MIGRAPHX} != 0 && -d /opt/rocm/lib/migraphx ]]; then + # MIGraphX has to be new enough for the ONNXRuntime we build, not merely + # present: its provider references migraphx_shape_fp4x2_type, which appears + # in MIGraphX 7.1 (bf16 and fp8e5m2fnuz arrived in 6.4). On anything older + # every other file compiles and the build then dies on three enum cases, so + # gate on the API itself -- this turns MIGraphX back on by itself once the + # host is upgraded, with no disable left behind to forget about. + # + # ROCm 6.x keeps these headers in a self-contained prefix under lib/, which + # is on no default include path; onnxruntime.sh finds the prefix and passes + # it. Look in both places. + MIGRAPHX_C_API= + for _hdr in /opt/rocm/lib/migraphx/include/migraphx/migraphx.h \ + /opt/rocm/include/migraphx/migraphx.h; do + if [[ -f $_hdr ]] && grep -q fp4x2 "$_hdr"; then MIGRAPHX_C_API=$_hdr; break; fi + done + if [[ $ALIBUILD_O2_FORCE_GPU_MIGRAPHX == 1 ]] || [[ $GPU_FEATURES =~ (^|-)"miopen"(-|_|$) && ${ALIBUILD_O2_FORCE_GPU_MIGRAPHX} != 0 && -n $MIGRAPHX_C_API ]]; then add_feature - migraphx fi @@ -214,8 +229,20 @@ prefer_system_check: | add_feature - tensorrt fi - if [[ $ALIBUILD_O2_FORCE_GPU == "1" ]] && ! [[ $GPU_FEATURES =~ (^|-)"miopen"(-|_|$) && ${GPU_FEATURES} =~ (^|-)"migraphx"(-|_|$) && ${GPU_FEATURES} =~ (^|-)"cudnn"(-|_|$) && ${GPU_FEATURES} =~ (^|-)"tensorrt"(-|_|$) ]]; then - GPU_FEATURES="error-ALIBUILD_O2_FORCE_GPU=1 set, but not all ML libraries detected" + # MIGraphX is gated on the C API above, so it is legitimately absent when the + # host ROCm is older than the ONNXRuntime needs -- demand it only when it + # could have been enabled, otherwise FORCE_GPU=1 makes that state unreachable + # and even ALIBUILD_O2_FORCE_GPU_MIGRAPHX=0 cannot opt out. + _ml_required="miopen cudnn tensorrt" + if [[ ${ALIBUILD_O2_FORCE_GPU_MIGRAPHX} == 1 ]] || [[ ${ALIBUILD_O2_FORCE_GPU_MIGRAPHX} != 0 && -n $MIGRAPHX_C_API ]]; then + _ml_required="$_ml_required migraphx" + fi + _ml_missing= + for _ml in $_ml_required; do + [[ $GPU_FEATURES =~ (^|-)"$_ml"(-|_|$) ]] || _ml_missing="$_ml_missing $_ml" + done + if [[ $ALIBUILD_O2_FORCE_GPU == "1" && -n $_ml_missing ]]; then + GPU_FEATURES="error-ALIBUILD_O2_FORCE_GPU=1 set, but not all ML libraries detected:$_ml_missing" break fi diff --git a/grpc.sh b/grpc.sh index f2cd150a84..61150c436a 100644 --- a/grpc.sh +++ b/grpc.sh @@ -1,6 +1,6 @@ package: grpc version: "%(tag_basename)s" -tag: v1.71.0 +tag: v1.74.0 requires: - protobuf - c-ares diff --git a/mesos.sh b/mesos.sh index 22e506a22f..83d27259b0 100644 --- a/mesos.sh +++ b/mesos.sh @@ -1,6 +1,6 @@ package: mesos version: v1.11.0 -tag: 1.11.0-alice5 +tag: 1.11.0-alice6 source: https://github.com/AliceO2Group/mesos.git requires: - zlib diff --git a/onnx.sh b/onnx.sh index 014b8f94ba..293ac22862 100644 --- a/onnx.sh +++ b/onnx.sh @@ -1,7 +1,7 @@ package: onnx -version: "v1.17.0-alice2" -tag: v1.17.0-alice2 -source: https://github.com/alisw/onnx +version: "v1.22.0" +tag: v1.22.0 +source: https://github.com/onnx/onnx license: ApacheV2+BSD2C+CC0 requires: - "GCC-Toolchain:(?!osx)" diff --git a/onnxruntime.sh b/onnxruntime.sh index 71ceffd222..4a2574d69b 100644 --- a/onnxruntime.sh +++ b/onnxruntime.sh @@ -1,6 +1,6 @@ package: ONNXRuntime version: "%(tag_basename)s" -tag: v1.22.0 +tag: v1.29.0 license: MIT source: https://github.com/microsoft/onnxruntime requires: @@ -13,6 +13,8 @@ requires: - Eigen3 - onnx - gpu-system + - "cudnn_frontend:(?!osx)" + - "cutlass:(?!osx)" build_requires: - date - safe_int @@ -73,13 +75,21 @@ fi # Optional GPU features ### MIGraphX -if [[ "$ORT_ROCM_BUILD" -eq 1 ]] && [[ ${O2_GPU_MIGRAPHX_AVAILABLE:-0} == 1 ]] && [[ -z "$ORT_MIGRAPHX_BUILD" ]]; then - ORT_MIGRAPHX_BUILD="0" # Disable for now, not working +# Not gated on ORT_ROCM_BUILD: upstream removed the ROCm execution provider +# after v1.22, so MIGraphX is the only remaining AMD path and has to stand on +# its own. It needs hip and migraphx from the ROCm installation. +if [[ ${O2_GPU_MIGRAPHX_AVAILABLE:-0} == 1 ]] && [[ -z "$ORT_MIGRAPHX_BUILD" ]]; then + ORT_MIGRAPHX_BUILD="1" elif [[ -z "$ORT_MIGRAPHX_BUILD" ]]; then ORT_MIGRAPHX_BUILD="0" fi ### TensorRT -if [[ "$ORT_CUDA_BUILD" -eq 1 ]] && [[ ${O2_GPU_TENSORRT_AVAILABLE:-0} == 1 ]] && [[ -z "$ORT_TENSORRT_BUILD" ]]; then +# Also gated on onnx_tensorrt being available. Its provider FetchContents that +# source, which we build with FETCHCONTENT_FULLY_DISCONNECTED=ON and nothing in +# alidist provides -- so on a TensorRT-capable host the configure step fails +# outright. Gating on the root, as with cudnn_frontend and cutlass, turns it +# back on by itself once a recipe supplies one. +if [[ "$ORT_CUDA_BUILD" -eq 1 ]] && [[ ${O2_GPU_TENSORRT_AVAILABLE:-0} == 1 ]] && [[ -n "$ONNX_TENSORRT_ROOT" ]] && [[ -z "$ORT_TENSORRT_BUILD" ]]; then ORT_TENSORRT_BUILD="1" elif [[ -z "$ORT_TENSORRT_BUILD" ]]; then ORT_TENSORRT_BUILD="0" @@ -93,6 +103,22 @@ export ORT_MIGRAPHX_BUILD=$ORT_MIGRAPHX_BUILD export ORT_TENSORRT_BUILD=$ORT_TENSORRT_BUILD EOF +# MIGraphX installs into a self-contained prefix under lib/ on ROCm 6.x +# (/opt/rocm/lib/migraphx/include/migraphx/version.h), which is on no default +# include path: onnxruntime's provider then fails on even +# though find_package(migraphx) succeeded. Find the prefix and pass it, rather +# than assuming the headers sit beside ROCm's own. +if [[ "$ORT_MIGRAPHX_BUILD" == 1 ]]; then + for _p in "${O2_GPU_ROCM_HOME:-/opt/rocm}/lib/migraphx" "${O2_GPU_ROCM_HOME:-/opt/rocm}"; do + if [[ -f "$_p/include/migraphx/version.h" ]]; then + MIGRAPHX_HOME=$_p + CXXFLAGS="$CXXFLAGS -isystem $_p/include" + break + fi + done + echo "MIGRAPHX_HOME=${MIGRAPHX_HOME:-}" +fi + echo "O2_GPU_ROCM_HOME=$O2_GPU_ROCM_HOME" echo "O2_GPU_CUDA_HOME=$O2_GPU_CUDA_HOME" @@ -149,7 +175,9 @@ cmake "cmake" ${PROTOBUF_ROOT:+-DONNX_CUSTOM_PROTOC_EXECUTABLE=$PROTOBUF_ROOT/bin/protoc} \ ${RE2_ROOT:+-DRE2_INCLUDE_DIR=${RE2_ROOT}/include} \ ${BOOST_ROOT:+-DBOOST_INCLUDE_DIR=${BOOST_ROOT}/include} \ + ${BOOST_ROOT:+-DFETCHCONTENT_SOURCE_DIR_MP11=${BOOST_ROOT}} \ -Donnxruntime_USE_MIGRAPHX=${ORT_MIGRAPHX_BUILD} \ + ${MIGRAPHX_HOME:+-DAMD_MIGRAPHX_HOME=${MIGRAPHX_HOME}} \ -Donnxruntime_USE_ROCM=${ORT_ROCM_BUILD} \ -Donnxruntime_ROCM_HOME=${O2_GPU_ROCM_HOME} \ -Donnxruntime_CUDA_HOME=${O2_GPU_CUDA_HOME} \ @@ -164,12 +192,13 @@ cmake "cmake" -DMSVC=OFF \ -Donnxruntime_USE_CUDA=${ORT_CUDA_BUILD} \ -Donnxruntime_USE_CUDA_NHWC_OPS=${ORT_CUDA_BUILD} \ - -DFETCHCONTENT_SOURCE_DIR_CUDNN_FRONTEND=${CUDNN_FRONTEND_ROOT} \ - -DFETCHCONTENT_SOURCE_DIR_CUTLASS=${CUTLASS_ROOT} \ + ${CUDNN_FRONTEND_ROOT:+-DFETCHCONTENT_SOURCE_DIR_CUDNN_FRONTEND=${CUDNN_FRONTEND_ROOT}} \ + ${CUTLASS_ROOT:+-DFETCHCONTENT_SOURCE_DIR_CUTLASS=${CUTLASS_ROOT}} \ + ${ONNX_TENSORRT_ROOT:+-DFETCHCONTENT_SOURCE_DIR_ONNX_TENSORRT=${ONNX_TENSORRT_ROOT}} \ -Donnxruntime_FUZZ_ENABLED=OFF \ -Donnxruntime_USE_FLASH_ATTENTION=OFF \ -Donnxruntime_USE_LEAN_ATTENTION=OFF \ - -Donnxruntime_USE_MEMORY_EFFICIENT_ATTENTION=OFF \ + -Donnxruntime_USE_MEMORY_EFFICIENT_ATTENTION=ON \ -DCMAKE_CUDA_FLAGS="${CXXFLAGS} -Wno-error=deprecated-enum-float-conversion -Wno-error -Wno-error=missing-requires -w" \ -DCMAKE_HIP_FLAGS="${CXXFLAGS} -Wno-error=deprecated-enum-float-conversion -Wno-error -Wno-error=missing-requires -w" \ -DCMAKE_CXX_FLAGS="${CXXFLAGS} -Wno-unknown-warning -Wno-unknown-warning-option -Wno-pass-failed -Wno-error=unused-but-set-variable -Wno-pass-failed=transform-warning -Wno-error=deprecated -Wno-error=maybe-uninitialized -Wno-error=deprecated-enum-enum-conversion -Wno-error -Wno-error=missing-requires -w" \ diff --git a/protobuf.sh b/protobuf.sh index 82899957f9..51ca18b1f9 100644 --- a/protobuf.sh +++ b/protobuf.sh @@ -1,6 +1,6 @@ package: protobuf -version: v29.3 -tag: v29.3 +version: v31.1 +tag: v31.1 source: https://github.com/protocolbuffers/protobuf license: Google BSD Like build_requires: