Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
3ad438c6
Unverified
Commit
3ad438c6
authored
Mar 29, 2024
by
bnellnm
Committed by
GitHub
Mar 29, 2024
Browse files
Fix build when nvtools is missing (#3698)
parent
203d4f82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
CMakeLists.txt
CMakeLists.txt
+4
-3
cmake/utils.cmake
cmake/utils.cmake
+11
-2
No files found.
CMakeLists.txt
View file @
3ad438c6
...
@@ -70,10 +70,11 @@ find_package(Torch REQUIRED)
...
@@ -70,10 +70,11 @@ find_package(Torch REQUIRED)
# config is used for standalone C++ binaries that link against torch).
# config is used for standalone C++ binaries that link against torch).
# The `libtorch_python.so` library defines some of the glue code between
# The `libtorch_python.so` library defines some of the glue code between
# torch/python via pybind and is required by VLLM extensions for this
# torch/python via pybind and is required by VLLM extensions for this
# reason. So, add it by manually
using `append_torchlib_if_found` from
# reason. So, add it by manually
with `find_library` using torch's
#
torch's cmake setup
.
#
installed library path
.
#
#
append_torchlib_if_found
(
torch_python
)
find_library
(
torch_python_LIBRARY torch_python PATHS
"
${
TORCH_INSTALL_PREFIX
}
/lib"
)
#
#
# Set up GPU language and check the torch version and warn if it isn't
# Set up GPU language and check the torch version and warn if it isn't
...
...
cmake/utils.cmake
View file @
3ad438c6
...
@@ -281,7 +281,7 @@ endmacro()
...
@@ -281,7 +281,7 @@ endmacro()
# not provided.
# not provided.
# COMPILE_FLAGS <flags> - Extra compiler flags passed to NVCC/hip.
# COMPILE_FLAGS <flags> - Extra compiler flags passed to NVCC/hip.
# INCLUDE_DIRECTORIES <dirs> - Extra include directories.
# INCLUDE_DIRECTORIES <dirs> - Extra include directories.
#
LINK_
LIBRARIES <libraries> - Extra link libraries.
# LIBRARIES <libraries>
- Extra link libraries.
# WITH_SOABI - Generate library with python SOABI suffix name.
# WITH_SOABI - Generate library with python SOABI suffix name.
#
#
# Note: optimization level/debug info is set via cmake build type.
# Note: optimization level/debug info is set via cmake build type.
...
@@ -327,8 +327,17 @@ function (define_gpu_extension_target GPU_MOD_NAME)
...
@@ -327,8 +327,17 @@ function (define_gpu_extension_target GPU_MOD_NAME)
target_include_directories
(
${
GPU_MOD_NAME
}
PRIVATE csrc
target_include_directories
(
${
GPU_MOD_NAME
}
PRIVATE csrc
${
GPU_INCLUDE_DIRECTORIES
}
)
${
GPU_INCLUDE_DIRECTORIES
}
)
target_link_libraries
(
${
GPU_MOD_NAME
}
PRIVATE
${
TORCH
_LIBRAR
IES
}
target_link_libraries
(
${
GPU_MOD_NAME
}
PRIVATE
torch
${
torch_python
_LIBRAR
Y
}
${
GPU_LIBRARIES
}
)
${
GPU_LIBRARIES
}
)
# Don't use `TORCH_LIBRARIES` for CUDA since it pulls in a bunch of
# dependencies that are not necessary and may not be installed.
if
(
GPU_LANGUAGE STREQUAL
"CUDA"
)
target_link_libraries
(
${
GPU_MOD_NAME
}
PRIVATE
${
CUDA_CUDA_LIB
}
${
CUDA_LIBRARIES
}
)
else
()
target_link_libraries
(
${
GPU_MOD_NAME
}
PRIVATE
${
TORCH_LIBRARIES
}
)
endif
()
install
(
TARGETS
${
GPU_MOD_NAME
}
LIBRARY DESTINATION
${
GPU_DESTINATION
}
)
install
(
TARGETS
${
GPU_MOD_NAME
}
LIBRARY DESTINATION
${
GPU_DESTINATION
}
)
endfunction
()
endfunction
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment