Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
squashed commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWilkinson committed Jul 31, 2024
1 parent 1d90d74 commit ef704ac
Show file tree
Hide file tree
Showing 31 changed files with 6,165 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ target/
profile_default/
ipython_config.py

# generated files
**/generated/**

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
Expand Down
42 changes: 42 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,48 @@ if(VLLM_GPU_LANG STREQUAL "CUDA")
"-gencode arch=compute_90a,code=sm_90a")
endif()

#
# For the CUTLASS-Marlin (marlinv2, mixed precision cutlass kernels) we
# automatically generate sources for various preselected input type pairs
# and schedules.
# Generate sources:
execute_process(
COMMAND ${CMAKE_COMMAND} -E env
PYTHONPATH=${CMAKE_CURRENT_SOURCE_DIR}/csrc/cutlass_extensions/:${CUTLASS_DIR}/python/:$PYTHONPATH
${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/csrc/quantization/marlinv2/generate.py
RESULT_VARIABLE marlinv2_generation_result
OUTPUT_VARIABLE marlinv2_generation_output
OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/marlinv2_generation.log
ERROR_FILE ${CMAKE_CURRENT_BINARY_DIR}/marlinv2_generation.log
)

if (NOT marlinv2_generation_result EQUAL 0)
file(READ ${CMAKE_CURRENT_BINARY_DIR}/marlinv2_generation.log log)
message(FATAL_ERROR "MarlinV2 generation failed."
" Result: \"${marlinv2_generation_result}\""
"\nCheck the log for details: "
"${CMAKE_CURRENT_BINARY_DIR}/marlinv2_generation.log")
else()
message(STATUS "MarlinV2 generation completed successfully.")
endif()

# Add marlinv2 generated sources
file(GLOB MARLINV2_GEN_SOURCES "csrc/quantization/marlinv2/generated/*.cu")
list(APPEND VLLM_EXT_SRC ${MARLINV2_GEN_SOURCES})
message(STATUS "MarlinV2 generated sources: ${MARLINV2_GEN_SOURCES}")

# See comment above for scaled_mm_c3x (same if condition)
if(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER 12.0)
set_source_files_properties(
${MARLINV2_GEN_SOURCES}
PROPERTIES
COMPILE_FLAGS
"-gencode arch=compute_90a,code=sm_90a")
endif()

# Add pytorch binding
list(APPEND VLLM_EXT_SRC
csrc/quantization/marlinv2/marlinv2_pytorch.cu)
endif()

define_gpu_extension_target(
Expand Down
Loading

0 comments on commit ef704ac

Please sign in to comment.