2024-09-25 06:27:28 -06:00
|
|
|
cmake_minimum_required(VERSION 3.22)
|
|
|
|
project(text-generation-inference LANGUAGES C CXX CUDA)
|
|
|
|
|
|
|
|
# Update some policies
|
|
|
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
|
|
|
cmake_policy(SET CMP0135 NEW)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
|
|
|
|
# Define some overall constants
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
set(TORCH_VERSION "2.3.1" "Version of PyTorch to build against")
|
|
|
|
|
|
|
|
# Define options
|
|
|
|
option(TGI_BUILD_CCL "Flag to enable/disable build of tgiccl collective library" ON)
|
|
|
|
|
|
|
|
# Add some modules
|
|
|
|
include(FetchContent)
|
2024-09-27 10:53:56 -06:00
|
|
|
include(cmake/fmt.cmake)
|
2024-09-26 15:31:07 -06:00
|
|
|
include(cmake/spdlog.cmake)
|
2024-09-25 06:27:28 -06:00
|
|
|
|
|
|
|
# Let's find LibTorch
|
|
|
|
include(cmake/torch.cmake)
|
2024-09-27 10:53:56 -06:00
|
|
|
find_package(Torch REQUIRED)
|
2024-09-25 06:27:28 -06:00
|
|
|
find_package(Python3 COMPONENTS Interpreter)
|
|
|
|
|
2024-09-27 10:53:56 -06:00
|
|
|
# TGI common
|
|
|
|
add_subdirectory(common)
|
2024-09-25 06:27:28 -06:00
|
|
|
|
|
|
|
# Include submodules
|
|
|
|
if (${TGI_BUILD_CCL})
|
|
|
|
add_subdirectory(tgiccl)
|
|
|
|
endif ()
|