File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,7 @@ option(GGML_CUDA_GRAPHS "ggml: use CUDA graphs (llama.cpp on
157157option (GGML_HIP "ggml: use HIP" OFF )
158158option (GGML_HIP_GRAPHS "ggml: use HIP graph, experimental, slow" OFF )
159159option (GGML_HIP_NO_VMM "ggml: do not try to use HIP VMM" ON )
160+ option (GGML_HIP_ROCWMMA_FATTN "ggml: enable rocWMMA for FlashAttention" OFF )
160161option (GGML_HIP_UMA "ggml: use HIP unified memory architecture" OFF )
161162option (GGML_VULKAN "ggml: use Vulkan" OFF )
162163option (GGML_VULKAN_CHECK_RESULTS "ggml: run Vulkan op checks" OFF )
Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ endif()
3939find_package (hip REQUIRED)
4040find_package (hipblas REQUIRED)
4141find_package (rocblas REQUIRED)
42+ if (GGML_HIP_ROCWMMA_FATTN)
43+ CHECK_INCLUDE_FILE_CXX("rocwmma/rocwmma.hpp" FOUND_ROCWMMA)
44+ if (NOT ${FOUND_ROCWMMA} )
45+ message (FATAL_ERROR "rocwmma is not found" )
46+ endif ()
47+ endif ()
4248
4349if (${hip_VERSION} VERSION_LESS 5.5)
4450 message (FATAL_ERROR "At least ROCM/HIP V5.5 is required" )
@@ -107,6 +113,10 @@ if (GGML_HIP_NO_VMM)
107113 add_compile_definitions (GGML_HIP_NO_VMM)
108114endif ()
109115
116+ if (GGML_HIP_ROCWMMA_FATTN)
117+ add_compile_definitions (GGML_HIP_ROCWMMA_FATTN)
118+ endif ()
119+
110120if (CXX_IS_HIPCC)
111121 set_source_files_properties (${GGML_SOURCES_ROCM} PROPERTIES LANGUAGE CXX)
112122 target_link_libraries (ggml-hip PRIVATE hip::device)
You can’t perform that action at this time.
0 commit comments