[None][fix] Fix build of tritonbuild/tritonrelease image (#7003)

Signed-off-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com>
Co-authored-by: Dimitrios Bariamis <12195802+dbari@users.noreply.github.com>
Signed-off-by: Wangshanshan <30051912+dominicshanshan@users.noreply.github.com>
This commit is contained in:
Dimitrios Bariamis 2025-08-20 16:57:39 +02:00 committed by Jonas Yang CN
parent 44cc308e6a
commit b0558c73fc
3 changed files with 25 additions and 12 deletions

View File

@ -9,5 +9,6 @@ examples/**/.git
examples/**/*.bin
examples/**/*.engine
examples/**/*.onnx
examples/**/*.safetensors
examples/**/c-model
examples/models/core/gpt/gpt*

View File

@ -137,7 +137,7 @@ CODE_DIR ?= /code/tensorrt_llm
EXTRA_VOLUMES ?=
CCACHE_DIR ?= $(CODE_DIR)/cpp/.ccache
CONAN_DIR ?= $(CODE_DIR)/cpp/.conan
USER_CACHE_DIR ?= $(HOME_DIR)/.cache
USER_CACHE_DIR ?= $(shell readlink -f "${HOME_DIR}/.cache")
RUN_CMD ?=
CONTAINER_NAME ?= tensorrt_llm
WORK_DIR ?= $(CODE_DIR)

View File

@ -8,6 +8,7 @@ Help()
echo "h Print this Help."
echo "t Location of tensorrt library"
echo "u Option to build unit tests"
echo "s Triton short tag, e.g. 'r25.06'"
echo
}
@ -15,7 +16,7 @@ TRT_ROOT='/usr/local/tensorrt'
BUILD_UNIT_TESTS='false'
# Get the options
while getopts ":ht:u" option; do
while getopts ":ht:us:" option; do
case $option in
h) # display Help
Help
@ -24,6 +25,8 @@ while getopts ":ht:u" option; do
TRT_ROOT=$OPTARG;;
u) # Option to build unit tests
BUILD_UNIT_TESTS='true';;
s) # Triton short tag
TRITON_SHORT_TAG=$OPTARG;;
\?) # Invalid option
echo "Error: Invalid option"
echo ""
@ -35,14 +38,22 @@ done
echo "Using TRT_ROOT=${TRT_ROOT}"
echo "Using BUILD_UNIT_TESTS=${BUILD_UNIT_TESTS}"
DIRNAME="$(dirname "$(realpath "$0")")"
if [ -z "$TRITON_SHORT_TAG" ]; then
# Get TRITON_SHORT_TAG from docker/Dockerfile.multi
LLM_ROOT="${DIRNAME}/../../.."
TRITON_SHORT_TAG=$("$LLM_ROOT/jenkins/scripts/get_triton_tag.sh" "$LLM_ROOT")
fi
echo "Using TRITON_SHORT_TAG=${TRITON_SHORT_TAG}"
set -x
apt-get update
apt-get install -y --no-install-recommends rapidjson-dev
BUILD_DIR=$(dirname $0)/../build
mkdir $BUILD_DIR
BUILD_DIR=$(cd -- "$BUILD_DIR" && pwd)
cd $BUILD_DIR
BUILD_DIR=$(realpath "$DIRNAME/../build")
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR" || exit 1
export LD_LIBRARY_PATH="/usr/local/cuda/compat/lib.real:${LD_LIBRARY_PATH}"
@ -51,12 +62,13 @@ if [[ "$BUILD_UNIT_TESTS" == "true" ]]; then
BUILD_TESTS_ARG="-DBUILD_TESTS=ON -DUSE_CXX11_ABI=ON"
fi
# TODO: Remove specifying Triton version after cmake version is upgraded to 3.31.8
# Get TRITON_SHORT_TAG from docker/Dockerfile.multi
LLM_ROOT=$BUILD_DIR/../../..
LLM_ROOT=$(cd -- "$LLM_ROOT" && pwd)
TRITON_SHORT_TAG=$("$LLM_ROOT/jenkins/scripts/get_triton_tag.sh" "$LLM_ROOT")
cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install ${BUILD_TESTS_ARG} -DTRITON_COMMON_REPO_TAG=${TRITON_SHORT_TAG} -DTRITON_CORE_REPO_TAG=${TRITON_SHORT_TAG} -DTRITON_THIRD_PARTY_REPO_TAG=${TRITON_SHORT_TAG} -DTRITON_BACKEND_REPO_TAG=${TRITON_SHORT_TAG} ..
cmake -DCMAKE_INSTALL_PREFIX:PATH="$(pwd)/install" \
${BUILD_TESTS_ARG} \
-DTRITON_COMMON_REPO_TAG="${TRITON_SHORT_TAG}" \
-DTRITON_CORE_REPO_TAG="${TRITON_SHORT_TAG}" \
-DTRITON_THIRD_PARTY_REPO_TAG="${TRITON_SHORT_TAG}" \
-DTRITON_BACKEND_REPO_TAG="${TRITON_SHORT_TAG}" \
..
make install
mkdir -p /opt/tritonserver/backends/tensorrtllm