Skip to content

Commit d2d6de2

Browse files
author
Sayan Shaw
committed
disable triton
1 parent 57dab62 commit d2d6de2

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ set(OCOS_ONNXRUNTIME_PKG_URI "" CACHE STRING
112112
set(OCOS_BUILD_PRESET "" CACHE STRING
113113
"Specify the build preset cmake settings file path, like 'token_api_only' which includes ./cmake/presets/token_api_only.cmake")
114114

115-
# AzureOp can be enabled by environment varaible OCOS_ENABLE_AZURE == 1
116-
if (DEFINED ENV{OCOS_ENABLE_AZURE})
115+
# AzureOp can be enabled by environment variable OCOS_ENABLE_AZURE=1
116+
if (DEFINED ENV{OCOS_ENABLE_AZURE} AND "$ENV{OCOS_ENABLE_AZURE}" STREQUAL "1")
117117
set(OCOS_ENABLE_AZURE ON CACHE INTERNAL "" FORCE)
118-
message(STATUS "=> AzureOp is enabled env variable.")
118+
message(STATUS "=> AzureOp is enabled via environment variable.")
119119
endif()
120120

121121
function(disable_all_operators)

cmake/externals/triton.cmake

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ if (WIN32)
7777
set(triton_patch_exe ${PROJECT_SOURCE_DIR}/cmake/externals/git.Win32.2.41.03.patch/patch.exe)
7878
set(triton_dependencies ${VCPKG_DEPENDENCIES})
7979
else()
80-
# RapidJSON 1.1.0 (released in 2016) has C++ compatibility issues with GCC 14 (deprecated std::iterator,
81-
# const member assignment). Use master branch which includes these fixes and already has cmake_minimum_required 3.5.
82-
#
83-
# Note: Newer RapidJSON uses modern CMake with exported targets and changed the variable name from
84-
# RAPIDJSON_INCLUDE_DIRS to RapidJSON_INCLUDE_DIRS. Triton expects the uppercase version, so we pass
85-
# RAPIDJSON_INCLUDE_DIRS directly as a cmake argument to the triton build.
80+
# RapidJSON 1.1.0 (released in 2016) is compatible with the triton build. Later code is not compatible without
81+
# patching due to the change in variable name for the include dir from RAPIDJSON_INCLUDE_DIRS to
82+
# RapidJSON_INCLUDE_DIRS in the generated cmake file used by find_package:
83+
# https://github.com/Tencent/rapidjson/commit/b91c515afea9f0ba6a81fc670889549d77c83db3
84+
# The triton code here https://github.com/triton-inference-server/common/blob/main/CMakeLists.txt is using
85+
# RAPIDJSON_INCLUDE_DIRS so the build fails if a newer RapidJSON version is used. It will find the package but the
86+
# include path will be wrong so the build error is delayed/misleading and non-trivial to understand/resolve.
8687
set(RapidJSON_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/_deps/rapidjson)
8788
set(RapidJSON_INSTALL_DIR ${RapidJSON_PREFIX}/install)
8889
ExternalProject_Add(RapidJSON
8990
PREFIX ${RapidJSON_PREFIX}
90-
GIT_REPOSITORY https://github.com/Tencent/rapidjson.git
91-
GIT_TAG master
92-
GIT_SHALLOW TRUE
91+
URL https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.zip
92+
URL_HASH SHA1=0fe7b4f7b83df4b3d517f4a202f3a383af7a0818
9393
CMAKE_ARGS -DRAPIDJSON_BUILD_DOC=OFF
9494
-DRAPIDJSON_BUILD_EXAMPLES=OFF
9595
-DRAPIDJSON_BUILD_TESTS=OFF
@@ -100,10 +100,10 @@ else()
100100

101101
ExternalProject_Get_Property(RapidJSON SOURCE_DIR BINARY_DIR)
102102
# message(STATUS "RapidJSON src=${SOURCE_DIR} binary=${BINARY_DIR}")
103-
# Set RapidJSON_ROOT_DIR for find_package. The cmake config files are installed to lib/cmake/RapidJSON
104-
set(RapidJSON_ROOT_DIR ${RapidJSON_INSTALL_DIR}/lib/cmake/RapidJSON)
105-
# Triton expects RAPIDJSON_INCLUDE_DIRS (uppercase). Pass it directly as a cmake arg.
106-
set(triton_extra_cmake_args -DRAPIDJSON_INCLUDE_DIRS=${RapidJSON_INSTALL_DIR}/include)
103+
# Set RapidJSON_ROOT_DIR for find_package. The required RapidJSONConfig.cmake file is generated in the binary dir
104+
set(RapidJSON_ROOT_DIR ${BINARY_DIR})
105+
106+
set(triton_extra_cmake_args "")
107107
set(triton_patch_exe patch)
108108
set(triton_dependencies RapidJSON)
109109

@@ -145,4 +145,4 @@ ExternalProject_Add(triton
145145
add_dependencies(triton ${triton_dependencies})
146146

147147
ExternalProject_Get_Property(triton SOURCE_DIR BINARY_DIR)
148-
set(triton_THIRD_PARTY_DIR ${BINARY_DIR}/third-party)
148+
set(triton_THIRD_PARTY_DIR ${BINARY_DIR}/third-party)

0 commit comments

Comments
 (0)