Skip to content
Draft
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ qa/L0_openai/openai
tensorrtllm_models
tensorrtllm_mistral_models/
custom_tokenizer
CMakeUserPresets.json
631 changes: 482 additions & 149 deletions CMakeLists.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": 6,
"include": ["cmake/CMakePresets.json"]
}
File renamed without changes.
88 changes: 88 additions & 0 deletions cmake/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"version": 6,
"cmakeMinimumRequired": { "major": 3, "minor": 25, "patch": 0 },
"vendor": {
"note": "AUTHORITATIVE PRESET FILE. When building from server/ all downstream repos (core, common, backend) are included via add_subdirectory and inherit these variables. Downstream repos have their own CMakePresets.json for standalone builds only."
},
"configurePresets": [
{
"name": "conan-base",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"toolchainFile": "${sourceDir}/build/${presetName}/conan/generators/conan_toolchain.cmake",
"cacheVariables": { "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" }
},
{
"name": "release",
"inherits": "conan-base",
"displayName": "Release (GPU + HTTP + gRPC + Metrics)",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "ON",
"TRITON_ENABLE_HTTP": "ON",
"TRITON_ENABLE_GRPC": "ON",
"TRITON_ENABLE_METRICS": "ON"
}
},
{
"name": "debug",
"inherits": "conan-base",
"displayName": "Debug (GPU + HTTP + gRPC + Metrics)",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"TRITON_ENABLE_GPU": "ON",
"TRITON_ENABLE_HTTP": "ON",
"TRITON_ENABLE_GRPC": "ON",
"TRITON_ENABLE_METRICS": "ON"
}
},
{
"name": "cpu-only",
"inherits": "conan-base",
"displayName": "Release CPU-only",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "OFF",
"TRITON_ENABLE_METRICS_GPU": "OFF",
"TRITON_ENABLE_HTTP": "ON",
"TRITON_ENABLE_GRPC": "ON",
"TRITON_ENABLE_METRICS": "ON"
}
},
{
"name": "all-features",
"inherits": "conan-base",
"displayName": "Release - all features (no cloud storage)",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "ON",
"TRITON_ENABLE_HTTP": "ON",
"TRITON_ENABLE_GRPC": "ON",
"TRITON_ENABLE_METRICS": "ON",
"TRITON_ENABLE_METRICS_GPU": "ON",
"TRITON_ENABLE_METRICS_CPU": "ON",
"TRITON_ENABLE_TRACING": "ON",
"TRITON_ENABLE_ENSEMBLE": "ON",
"TRITON_ENABLE_GCS": "OFF",
"TRITON_ENABLE_S3": "OFF",
"TRITON_ENABLE_AZURE_STORAGE": "OFF",
"TRITON_ENABLE_IDENTITY_BACKEND": "ON",
"TRITON_ENABLE_REPEAT_BACKEND": "ON",
"TRITON_ENABLE_SQUARE_BACKEND": "ON",
"TRITON_ENABLE_PYTHON_BACKEND": "OFF",
"TRITON_ENABLE_ONNXRUNTIME_BACKEND": "OFF",
"TRITON_ENABLE_PYTORCH_BACKEND": "OFF",
"TRITON_ENABLE_TENSORRT_BACKEND": "OFF",
"TRITON_ENABLE_VLLM_BACKEND": "OFF",
"TRITON_ENABLE_TENSORRTLLM_BACKEND": "OFF"
}
}
],
"buildPresets": [
{ "name": "release", "configurePreset": "release" },
{ "name": "debug", "configurePreset": "debug" },
{ "name": "cpu-only", "configurePreset": "cpu-only" },
{ "name": "all-features", "configurePreset": "all-features" }
]
}
110 changes: 110 additions & 0 deletions cmake/TritonCheckCxxAbi.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# TritonCheckCxxAbi.cmake
#
# Detects the _GLIBCXX_USE_CXX11_ABI value that the current build will use and
# validates that the Conan-provided binary packages were compiled with the same
# ABI setting. A mismatch causes silent link failures or runtime crashes when
# mixing old ABI (=0) and new ABI (=1) translation units.
#
# Usage (call once, early in the root CMakeLists.txt after find_package calls):
# include(cmake/TritonCheckCxxAbi.cmake)
# triton_check_cxx_abi()
#
# The macro sets TRITON_GLIBCXX_USE_CXX11_ABI (cache variable) to 0 or 1.

macro(triton_check_cxx_abi)
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
return()
endif()

# ---------------------------------------------------------------
# 1. Probe the ABI the compiler will use for this build.
# ---------------------------------------------------------------
include(CheckCXXSourceCompiles)
set(_abi_probe_src "
#include <string>
#if _GLIBCXX_USE_CXX11_ABI
int use_new_abi = 1;
#else
int use_new_abi = 0;
#endif
int main() { return use_new_abi; }
")
# Ask the compiler directly via try_compile output rather than
# running the binary, so cross-compilation works too.
file(WRITE "${CMAKE_BINARY_DIR}/_abi_probe.cpp" "${_abi_probe_src}")
try_compile(
_abi_compile_ok
"${CMAKE_BINARY_DIR}/_abi_probe_build"
SOURCES "${CMAKE_BINARY_DIR}/_abi_probe.cpp"
CXX_STANDARD 17
OUTPUT_VARIABLE _abi_compile_output
)

if(NOT _abi_compile_ok)
message(WARNING "TritonCheckCxxAbi: could not compile ABI probe. Skipping ABI check.")
return()
endif()

# Extract the _GLIBCXX_USE_CXX11_ABI value by compiling a file that
# emits a preprocessor-expanded value we can grep.
file(WRITE "${CMAKE_BINARY_DIR}/_abi_value.cpp"
"#include <string>\nint abi_value = _GLIBCXX_USE_CXX11_ABI;\n")
execute_process(
COMMAND "${CMAKE_CXX_COMPILER}" -E -dM
"${CMAKE_BINARY_DIR}/_abi_value.cpp"
OUTPUT_VARIABLE _abi_macros
ERROR_QUIET
)

if(_abi_macros MATCHES "#define _GLIBCXX_USE_CXX11_ABI ([01])")
set(_detected_abi "${CMAKE_MATCH_1}")
else()
# Default: GCC >= 5 defaults to 1 (new ABI).
set(_detected_abi 1)
endif()

set(TRITON_GLIBCXX_USE_CXX11_ABI "${_detected_abi}"
CACHE STRING "Detected _GLIBCXX_USE_CXX11_ABI value (0=old, 1=new)" FORCE)
message(STATUS "TritonCheckCxxAbi: _GLIBCXX_USE_CXX11_ABI = ${TRITON_GLIBCXX_USE_CXX11_ABI}")

# ---------------------------------------------------------------
# 2. Validate Conan-provided binary packages that embed ABI info.
# ---------------------------------------------------------------
# Conan 2 records the compiler.libcxx setting in the package ID.
# If the Conan toolchain was generated we can cross-check via the
# conanbuildinfo vars; otherwise we skip silently.
if(DEFINED CONAN_COMPILER_LIBCXX)
if("${CONAN_COMPILER_LIBCXX}" STREQUAL "libstdc++" AND
"${TRITON_GLIBCXX_USE_CXX11_ABI}" STREQUAL "1")
message(FATAL_ERROR
"ABI MISMATCH: Build is using new C++11 ABI "
"(_GLIBCXX_USE_CXX11_ABI=1) but Conan packages were built "
"with libstdc++ (old ABI). Re-run 'conan install' with "
"compiler.libcxx=libstdc++11 in the host profile.")
endif()
if("${CONAN_COMPILER_LIBCXX}" STREQUAL "libstdc++11" AND
"${TRITON_GLIBCXX_USE_CXX11_ABI}" STREQUAL "0")
message(FATAL_ERROR
"ABI MISMATCH: Build is using old ABI "
"(_GLIBCXX_USE_CXX11_ABI=0) but Conan packages were built "
"with libstdc++11 (new ABI). Re-run 'conan install' with "
"compiler.libcxx=libstdc++ in the host profile, or remove "
"-D_GLIBCXX_USE_CXX11_ABI=0 from your compile flags.")
endif()
endif()

# ---------------------------------------------------------------
# 3. Warn if a user has manually set a conflicting compile flag.
# ---------------------------------------------------------------
if(DEFINED CMAKE_CXX_FLAGS AND
CMAKE_CXX_FLAGS MATCHES "_GLIBCXX_USE_CXX11_ABI=([01])")
set(_flag_abi "${CMAKE_MATCH_1}")
if(NOT "${_flag_abi}" STREQUAL "${_detected_abi}")
message(WARNING
"TritonCheckCxxAbi: CMAKE_CXX_FLAGS sets "
"_GLIBCXX_USE_CXX11_ABI=${_flag_abi} but the compiler "
"default is ${_detected_abi}. This will likely cause "
"linker errors with Conan-provided binary packages.")
endif()
endif()
endmacro()
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": 6,
"vendor": {
"triton": {
"component": "TritonClient",
"platform": "Ubuntu aarch64, CPU-only (Graviton, Neoverse, Apple Silicon dev)",
"notes": [
"CPU-only client build for aarch64 — no CUDA required.",
"Targets AWS Graviton, Ampere Altra, and NVIDIA Grace (CPU die).",
"Run cmake from the client/ source directory."
],
"conan_install": [
"conan install client/",
" --profile:host=server/conan/profiles/linux-gcc13-release-aarch64",
" --profile:build=server/conan/profiles/linux-gcc13-release",
" -o '&:enable_gpu=False'",
" -o '&:enable_grpc=True'",
" -o '&:enable_http=True'",
" --build=missing",
" --output-folder=client/build/triton-client-release-cpu-ubuntu-aarch64/conan",
"",
"cmake --preset triton-client-release-cpu-ubuntu-aarch64",
"cmake --build --preset triton-client-release-cpu-ubuntu-aarch64",
"cmake --build --preset triton-client-release-cpu-ubuntu-aarch64 --target wheels"
]
}
},
"configurePresets": [
{
"name": "triton-client-release-cpu-ubuntu-aarch64",
"displayName": "TritonClient — Release, CPU-only, Ubuntu, aarch64",
"description": "CPU-only client library build for Ubuntu Linux on aarch64.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"toolchainFile": "${sourceDir}/build/${presetName}/conan/generators/conan_toolchain.cmake",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "OFF",
"TRITON_ENABLE_CC_HTTP": "ON",
"TRITON_ENABLE_CC_GRPC": "ON",
"TRITON_ENABLE_PYTHON_HTTP": "ON",
"TRITON_ENABLE_PYTHON_GRPC": "ON",
"TRITON_ENABLE_PERF_ANALYZER": "ON",
"TRITON_ENABLE_EXAMPLES": "ON",
"TRITON_ENABLE_TESTS": "ON"
}
}
],
"buildPresets": [
{
"name": "triton-client-release-cpu-ubuntu-aarch64",
"configurePreset": "triton-client-release-cpu-ubuntu-aarch64",
"jobs": 8
}
],
"testPresets": [
{
"name": "triton-client-release-cpu-ubuntu-aarch64",
"configurePreset": "triton-client-release-cpu-ubuntu-aarch64",
"filter": { "exclude": { "label": "requires-gpu" } }
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"version": 6,
"vendor": {
"triton": {
"component": "TritonClient",
"platform": "Ubuntu x86_64, CPU-only (no NVIDIA GPU required)",
"notes": [
"CPU-only client build — no CUDA toolkit required.",
"CUDA shared memory operations are disabled.",
"Run cmake from the client/ source directory."
],
"conan_install": [
"conan install client/",
" --profile:host=server/conan/profiles/linux-gcc13-release",
" --profile:build=server/conan/profiles/linux-gcc13-release",
" -o '&:enable_gpu=False'",
" -o '&:enable_grpc=True'",
" -o '&:enable_http=True'",
" --build=missing",
" --output-folder=client/build/triton-client-release-cpu-ubuntu-x86_64/conan",
"",
"cmake --preset triton-client-release-cpu-ubuntu-x86_64",
"cmake --build --preset triton-client-release-cpu-ubuntu-x86_64",
"cmake --build --preset triton-client-release-cpu-ubuntu-x86_64 --target wheels"
]
}
},
"configurePresets": [
{
"name": "triton-client-release-cpu-ubuntu-x86_64",
"displayName": "TritonClient — Release, CPU-only, Ubuntu, x86_64",
"description": "CPU-only client library build for Ubuntu Linux on x86_64. No CUDA required.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"toolchainFile": "${sourceDir}/build/${presetName}/conan/generators/conan_toolchain.cmake",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_BUILD_TYPE": "Release",
"TRITON_ENABLE_GPU": "OFF",
"TRITON_ENABLE_CC_HTTP": "ON",
"TRITON_ENABLE_CC_GRPC": "ON",
"TRITON_ENABLE_PYTHON_HTTP": "ON",
"TRITON_ENABLE_PYTHON_GRPC": "ON",
"TRITON_ENABLE_PERF_ANALYZER": "ON",
"TRITON_ENABLE_EXAMPLES": "ON",
"TRITON_ENABLE_TESTS": "ON"
}
}
],
"buildPresets": [
{
"name": "triton-client-release-cpu-ubuntu-x86_64",
"configurePreset": "triton-client-release-cpu-ubuntu-x86_64",
"jobs": 8
}
],
"testPresets": [
{
"name": "triton-client-release-cpu-ubuntu-x86_64",
"configurePreset": "triton-client-release-cpu-ubuntu-x86_64",
"filter": { "exclude": { "label": "requires-gpu" } }
}
]
}
Loading
Loading