Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowRoseCx committed Jul 9, 2023
1 parent b58c189 commit 8432e9d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ ifdef LLAMA_HIPBLAS
CC := $(ROCM_PATH)/llvm/bin/clang
CXX := $(ROCM_PATH)/llvm/bin/clang++
GPU_TARGETS = gfx803 gfx900 gfx906 gfx908 gfx90a gfx1030 gfx1100
LLAMA_CUDA_DMMV_X ?= 256
LLAMA_CUDA_DMMV_Y ?= 2

LLAMA_CUDA_DMMV_X ?= 64
LLAMA_CUDA_MMV_Y ?= 2
LLAMA_CUDA_FORCE_DMMV = true
CFLAGS += -DGGML_USE_HIPBLAS -DGGML_USE_CUBLAS $(shell $(ROCM_PATH)/bin/hipconfig -C)
CXXFLAGS += -DGGML_USE_HIPBLAS -DGGML_USE_CUBLAS $(shell $(ROCM_PATH)/bin/hipconfig -C)
LDFLAGS += -L/opt/rocm/lib -Wl,-rpath=$(ROCM_PATH)/lib -lhipblas -lamdhip64
Expand All @@ -190,25 +190,25 @@ ifdef LLAMA_CUDA_DMMV_X
CXXFLAGS += -DGGML_CUDA_DMMV_X=$(LLAMA_CUDA_DMMV_X)
else
CXXFLAGS += -DGGML_CUDA_DMMV_X=32
endif # LLAMA_CUDA_DMMV_X
endif
ifeq ($(LLAMA_CUDA_FORCE_DMMV), true)
CXXFLAGS += -DGGML_CUDA_FORCE_DMMV
endif
ifdef LLAMA_CUDA_MMV_Y
CXXFLAGS += -DGGML_CUDA_MMV_Y=$(LLAMA_CUDA_MMV_Y)
else ifdef LLAMA_CUDA_DMMV_Y
CXXFLAGS += -DGGML_CUDA_MMV_Y=$(LLAMA_CUDA_DMMV_Y) # for backwards compatibility
else
CXXFLAGS += -DGGML_CUDA_MMV_Y=1
endif # LLAMA_CUDA_MMV_Y
endif

ifdef LLAMA_CUDA_KQUANTS_ITER
CXXFLAGS += -DK_QUANTS_PER_ITERATION=$(LLAMA_CUDA_KQUANTS_ITER)
else
CXXFLAGS += -DK_QUANTS_PER_ITERATION=2
endif

ggml-cuda.o: CXXFLAGS += $(addprefix --offload-arch=,$(GPU_TARGETS)) \
-DGGML_CUDA_DMMV_X=$(LLAMA_CUDA_DMMV_X) \
-DGGML_CUDA_MMV_Y=$(LLAMA_CUDA_DMMV_Y) \
-DGGML_CUDA_FORCE_DMMV
ggml-cuda.o: CXXFLAGS += $(addprefix --offload-arch=,$(GPU_TARGETS))


# DGGML_CUDA_DMMV_F16 does not currently work with AMD.
Expand Down

0 comments on commit 8432e9d

Please sign in to comment.