File tree 3 files changed +13
-5
lines changed
3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -335,6 +335,7 @@ if (LLAMA_HIPBLAS)
335
335
target_compile_definitions (ggml-rocm PRIVATE GGML_CUDA_DMMV_Y=${LLAMA_CUDA_DMMV_Y} )
336
336
set_source_files_properties (ggml-cuda.cu PROPERTIES LANGUAGE CXX)
337
337
target_link_libraries (ggml-rocm PRIVATE hip::device PUBLIC hip::host roc::hipblas)
338
+ add_compile_definitions (K_QUANTS_PER_ITERATION=${LLAMA_CUDA_KQUANTS_ITER} )
338
339
339
340
if (LLAMA_STATIC)
340
341
message (FATAL_ERROR "Static linking not supported for HIP/ROCm" )
Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ ifndef UNAME_M
21
21
UNAME_M := $(shell uname -m)
22
22
endif
23
23
24
- CCV = $(shell $(CC ) --version | head -n 1)
25
- CXXV = $(shell $(CXX ) --version | head -n 1)
24
+ CCV : = $(shell $(CC ) --version | head -n 1)
25
+ CXXV : = $(shell $(CXX ) --version | head -n 1)
26
26
27
27
# Mac OS + Arm can report x86_64
28
28
# ref: https://github.com/ggerganov/whisper.cpp/issues/66#issuecomment-1282546789
@@ -207,13 +207,18 @@ ifdef LLAMA_HIPBLAS
207
207
ROCM_PATH ?= /opt/rocm
208
208
CC := $(ROCM_PATH)/llvm/bin/clang
209
209
CXX := $(ROCM_PATH)/llvm/bin/clang++
210
- GPU_TARGETS = gfx900 gfx906 gfx908 gfx90a gfx1030
210
+ GPU_TARGETS = gfx803 gfx900 gfx906 gfx908 gfx90a gfx1030
211
211
LLAMA_CUDA_DMMV_X ?= 32
212
212
LLAMA_CUDA_DMMV_Y ?= 1
213
213
CFLAGS += -DGGML_USE_HIPBLAS -DGGML_USE_CUBLAS $(shell $(ROCM_PATH)/bin/hipconfig -C)
214
214
CXXFLAGS += -DGGML_USE_HIPBLAS -DGGML_USE_CUBLAS $(shell $(ROCM_PATH)/bin/hipconfig -C)
215
215
LDFLAGS += -L/opt/rocm/lib -Wl,-rpath=$(ROCM_PATH)/lib -lhipblas -lamdhip64
216
216
OBJS += ggml-cuda.o
217
+ ifdef LLAMA_CUDA_KQUANTS_ITER
218
+ CXXFLAGS += -DK_QUANTS_PER_ITERATION=$(LLAMA_CUDA_KQUANTS_ITER)
219
+ else
220
+ CXXFLAGS += -DK_QUANTS_PER_ITERATION=2
221
+ endif
217
222
ggml-cuda.o : CXXFLAGS += $(addprefix --offload-arch=,$(GPU_TARGETS ) )
218
223
ggml-cuda.o : CXXFLAGS += -DGGML_CUDA_DMMV_X=$(LLAMA_CUDA_DMMV_X )
219
224
ggml-cuda.o : CXXFLAGS += -DGGML_CUDA_DMMV_Y=$(LLAMA_CUDA_DMMV_Y )
Original file line number Diff line number Diff line change @@ -230,9 +230,11 @@ inline static void* ggml_aligned_malloc(size_t size) {
230
230
#endif
231
231
#elif defined(GGML_USE_OPENBLAS)
232
232
#include <cblas.h>
233
- #elif defined(GGML_USE_CUBLAS) | defined(GGML_USE_HIPBLAS)
233
+ #endif
234
+ #if defined(GGML_USE_CUBLAS)
234
235
#include "ggml-cuda.h"
235
- #elif defined(GGML_USE_CLBLAST)
236
+ #endif
237
+ #if defined(GGML_USE_CLBLAST)
236
238
#include "ggml-opencl.h"
237
239
#endif
238
240
You can’t perform that action at this time.
0 commit comments