A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 07:00 UTC
[CI/Build] Support compilation with local cutlass path (#10423) (#10424)
wchen61 committed
Nov 20, 2024 at 13:35 UTC
7629a9c6e5e29d60be9ef60e4afb9842effcdc73
2 files changed
+27
-2
CMakeLists.txt
+15
-2
@@ -206,7 +206,19 @@ if(VLLM_GPU_LANG STREQUAL "CUDA")
206
# Set CUTLASS_REVISION manually -- its revision detection doesn't work in this case.
207
set(CUTLASS_REVISION "v3.5.1" CACHE STRING "CUTLASS revision to use")
208
209
- FetchContent_Declare(
209
+ # Use the specified CUTLASS source directory for compilation if VLLM_CUTLASS_SRC_DIR is provided
210
+ if (DEFINED ENV{VLLM_CUTLASS_SRC_DIR})
211
+ set(VLLM_CUTLASS_SRC_DIR $ENV{VLLM_CUTLASS_SRC_DIR})
212
+ endif()
213
+
214
+ if(VLLM_CUTLASS_SRC_DIR)
215
+ if(NOT IS_ABSOLUTE VLLM_CUTLASS_SRC_DIR)
216
+ get_filename_component(VLLM_CUTLASS_SRC_DIR "${VLLM_CUTLASS_SRC_DIR}" ABSOLUTE)
217
+ endif()
218
+ message(STATUS "The VLLM_CUTLASS_SRC_DIR is set, using ${VLLM_CUTLASS_SRC_DIR} for compilation")
219
+ FetchContent_Declare(cutlass SOURCE_DIR ${VLLM_CUTLASS_SRC_DIR})
220
+ else()
221
+ FetchContent_Declare(
222
cutlass
223
GIT_REPOSITORY https://github.com/nvidia/cutlass.git
224
GIT_TAG v3.5.1
@@ -216,7 +228,8 @@ if(VLLM_GPU_LANG STREQUAL "CUDA")
228
# Important: If GIT_SHALLOW is enabled then GIT_TAG works only with branch names and tags.
229
# So if the GIT_TAG above is updated to a commit hash, GIT_SHALLOW must be set to FALSE
230
GIT_SHALLOW TRUE
219
- )
231
+ )
232
+ endif()
233
FetchContent_MakeAvailable(cutlass)
234
235
list(APPEND VLLM_EXT_SRC
docs/source/getting_started/installation.rst
+12
@@ -170,6 +170,18 @@ To build vLLM using an existing PyTorch installation:
170
$ pip install -e . --no-build-isolation
171
172
173
+Use the local cutlass for compilation
174
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
175
+Currently, before starting the build process, vLLM fetches cutlass code from GitHub. However, there may be scenarios where you want to use a local version of cutlass instead.
176
+To achieve this, you can set the environment variable VLLM_CUTLASS_SRC_DIR to point to your local cutlass directory.
177
+
178
+.. code-block:: console
179
+
180
+ $ git clone https://github.com/vllm-project/vllm.git
181
+ $ cd vllm
182
+ $ VLLM_CUTLASS_SRC_DIR=/path/to/cutlass pip install -e .
183
+
184
+
185
Troubleshooting
186
~~~~~~~~~~~~~~~
187