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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ examples/**/.git
examples/**/*.bin
examples/**/*.engine
examples/**/*.onnx
examples/**/*.safetensors
examples/**/c-model
examples/models/core/gpt/gpt*
4 changes: 1 addition & 3 deletions docker/Dockerfile.multi
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ FROM wheel AS tritonbuild
WORKDIR /src/tensorrt_llm
RUN pip install /src/tensorrt_llm/build/tensorrt_llm*.whl
COPY ./triton_backend/ ./triton_backend/
COPY ./jenkins/scripts/get_triton_tag.sh ./jenkins/scripts/get_triton_tag.sh
COPY ./docker/Dockerfile.multi ./docker/Dockerfile.multi
RUN bash ./triton_backend/inflight_batcher_llm/scripts/build.sh
RUN bash ./triton_backend/inflight_batcher_llm/scripts/build.sh -s "r${TRITON_BASE_TAG%-py3}"


FROM release AS tritonrelease
Expand Down
2 changes: 1 addition & 1 deletion docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
34 changes: 23 additions & 11 deletions triton_backend/inflight_batcher_llm/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ 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
}

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
Expand All @@ -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 ""
Expand All @@ -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}"

Expand All @@ -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
Expand Down