File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 32
32
useMpi ? false ,
33
33
useRocm ? config . rocmSupport ,
34
34
rocmGpuTargets ? builtins . concatStringsSep ";" rocmPackages . clr . gpuTargets ,
35
+ rocmUseWmma ? true ,
35
36
enableCurl ? true ,
36
37
useVulkan ? false ,
37
38
buildAllCudaFaQuants ? false ,
92
93
libcublas
93
94
] ;
94
95
95
- rocmBuildInputs = with rocmPackages ; [
96
- clr
97
- hipblas
98
- rocblas
99
- llvm . lld
100
- llvm . bintools
101
- ] ;
96
+ rocmBuildInputs =
97
+ with rocmPackages ;
98
+ [
99
+ clr
100
+ hipblas
101
+ rocblas
102
+ llvm . lld
103
+ llvm . bintools
104
+ ]
105
+ ++ optionals rocmUseWmma [ rocmPackages . rocwmma ] ;
102
106
103
107
vulkanBuildInputs = [
104
108
vulkan-headers
@@ -198,6 +202,10 @@ effectiveStdenv.mkDerivation (finalAttrs: {
198
202
( cmakeFeature "AMDGPU_TARGETS" rocmGpuTargets )
199
203
( cmakeBool "GGML_CUDA_FA_ALL_QUANTS" buildAllCudaFaQuants )
200
204
]
205
+ ++ optionals rocmUseWmma [
206
+ ( cmakeBool "GGML_HIP_ROCWMMA_FATTN" rocmUseWmma )
207
+ ( cmakeFeature "GGML_HIP_ROCWMMA_PATH" "${ rocmPackages . rocwmma } " )
208
+ ]
201
209
++ optionals useMetalKit [
202
210
( lib . cmakeFeature "CMAKE_C_FLAGS" "-D__ARM_FEATURE_DOTPROD=1" )
203
211
( cmakeBool "GGML_METAL_EMBED_LIBRARY" ( ! precompileMetalShaders ) )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ endif()
39
39
find_package (hip REQUIRED)
40
40
find_package (hipblas REQUIRED)
41
41
find_package (rocblas REQUIRED)
42
- if (GGML_HIP_ROCWMMA_FATTN)
42
+ if (GGML_HIP_ROCWMMA_FATTN AND NOT GGML_HIP_ROCWMMA_PATH )
43
43
CHECK_INCLUDE_FILE_CXX("rocwmma/rocwmma.hpp" FOUND_ROCWMMA)
44
44
if (NOT ${FOUND_ROCWMMA} )
45
45
message (FATAL_ERROR "rocwmma has not been found" )
@@ -111,6 +111,9 @@ endif()
111
111
112
112
if (GGML_HIP_ROCWMMA_FATTN)
113
113
add_compile_definitions (GGML_HIP_ROCWMMA_FATTN)
114
+ if (GGML_HIP_ROCWMMA_PATH)
115
+ target_include_directories (ggml-hip PRIVATE ${GGML_HIP_ROCWMMA_PATH} /include )
116
+ endif ()
114
117
endif ()
115
118
116
119
if (NOT GGML_HIP_MMQ_MFMA)
You can’t perform that action at this time.
0 commit comments