@@ -16,7 +16,7 @@ RWKV_REPO?=https://github.com/donomii/go-rwkv.cpp
16
16
RWKV_VERSION? =661e7ae26d442f5cfebd2a0881b44e8c55949ec6
17
17
18
18
# whisper.cpp version
19
- WHISPER_CPP_VERSION? =b29b3b29240aac8b71ce8e5a4360c1f1562ad66f
19
+ WHISPER_CPP_VERSION? =c118733a29ad4a984015a5c08fd585086d01087a
20
20
21
21
# bert.cpp version
22
22
BERT_VERSION? =710044b124545415f555e4260d16b146c725a6e4
@@ -36,6 +36,7 @@ export CMAKE_ARGS?=
36
36
37
37
CGO_LDFLAGS? =
38
38
CGO_LDFLAGS_WHISPER? =
39
+ CGO_LDFLAGS_WHISPER+ =-lggml
39
40
CUDA_LIBPATH? =/usr/local/cuda/lib64/
40
41
GO_TAGS? =
41
42
BUILD_ID? =
@@ -82,31 +83,40 @@ ifeq ($(OS),Darwin)
82
83
else ifneq ($(BUILD_TYPE),metal)
83
84
CMAKE_ARGS+=-DGGML_METAL=OFF
84
85
export GGML_NO_ACCELERATE=1
86
+ export GGML_NO_METAL=1
85
87
endif
86
88
87
89
ifeq ($(BUILD_TYPE),metal)
88
90
# -lcblas removed: it seems to always be listed as a duplicate flag.
89
91
CGO_LDFLAGS += -framework Accelerate
90
92
endif
93
+ else
94
+ CGO_LDFLAGS_WHISPER+ =-lgomp
91
95
endif
92
96
93
97
ifeq ($(BUILD_TYPE ) ,openblas)
94
98
CGO_LDFLAGS+=-lopenblas
95
- export WHISPER_OPENBLAS =1
99
+ export GGML_OPENBLAS =1
96
100
endif
97
101
98
-
99
102
ifeq ($(BUILD_TYPE ) ,cublas)
100
103
CGO_LDFLAGS+=-lcublas -lcudart -L$(CUDA_LIBPATH)
101
104
export GGML_CUDA=1
102
- export WHISPER_CUDA=1
103
105
CGO_LDFLAGS_WHISPER+=-L$(CUDA_LIBPATH)/stubs/ -lcuda -lcufft
104
106
endif
105
107
106
108
ifeq ($(BUILD_TYPE ) ,vulkan)
107
109
CMAKE_ARGS+=-DGGML_VULKAN=1
108
110
endif
109
111
112
+ ifneq (,$(findstring sycl,$(BUILD_TYPE ) ) )
113
+ export GGML_SYCL=1
114
+ endif
115
+
116
+ ifeq ($(BUILD_TYPE ) ,sycl_f16)
117
+ export GGML_SYCL_F16=1
118
+ endif
119
+
110
120
ifeq ($(BUILD_TYPE ) ,hipblas)
111
121
ROCM_HOME ?= /opt/rocm
112
122
ROCM_PATH ?= /opt/rocm
@@ -115,7 +125,7 @@ ifeq ($(BUILD_TYPE),hipblas)
115
125
export CC=$(ROCM_HOME)/llvm/bin/clang
116
126
# llama-ggml has no hipblas support, so override it here.
117
127
export STABLE_BUILD_TYPE=
118
- export WHISPER_HIPBLAS =1
128
+ export GGML_HIPBLAS =1
119
129
GPU_TARGETS ?= gfx900,gfx906,gfx908,gfx940,gfx941,gfx942,gfx90a,gfx1030,gfx1031,gfx1100,gfx1101
120
130
AMDGPU_TARGETS ?= "$(GPU_TARGETS)"
121
131
CMAKE_ARGS+=-DGGML_HIPBLAS=ON -DAMDGPU_TARGETS="$(AMDGPU_TARGETS)" -DGPU_TARGETS="$(GPU_TARGETS)"
@@ -125,12 +135,11 @@ endif
125
135
ifeq ($(BUILD_TYPE ) ,metal)
126
136
CGO_LDFLAGS+=-framework Foundation -framework Metal -framework MetalKit -framework MetalPerformanceShaders
127
137
export GGML_METAL=1
128
- export WHISPER_METAL=1
129
138
endif
130
139
131
140
ifeq ($(BUILD_TYPE ) ,clblas)
132
141
CGO_LDFLAGS+=-lOpenCL -lclblast
133
- export WHISPER_CLBLAST =1
142
+ export GGML_OPENBLAS =1
134
143
endif
135
144
136
145
# glibc-static or glibc-devel-static required
@@ -248,7 +257,7 @@ sources/whisper.cpp:
248
257
cd sources/whisper.cpp && git checkout -b build $(WHISPER_CPP_VERSION ) && git submodule update --init --recursive --depth 1
249
258
250
259
sources/whisper.cpp/libwhisper.a : sources/whisper.cpp
251
- cd sources/whisper.cpp && $(MAKE ) libwhisper.a
260
+ cd sources/whisper.cpp && $(MAKE ) libwhisper.a libggml.a
252
261
253
262
get-sources : sources/go-llama.cpp sources/gpt4all sources/go-piper sources/go-rwkv.cpp sources/whisper.cpp sources/go-bert.cpp sources/go-stable-diffusion sources/go-tiny-dream
254
263
@@ -792,7 +801,7 @@ backend-assets/grpc/tinydream: sources/go-tiny-dream sources/go-tiny-dream/libti
792
801
$(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/tinydream ./backend/go/image/tinydream
793
802
794
803
backend-assets/grpc/whisper : sources/whisper.cpp sources/whisper.cpp/libwhisper.a backend-assets/grpc
795
- CGO_LDFLAGS=" $( CGO_LDFLAGS) $( CGO_LDFLAGS_WHISPER) " C_INCLUDE_PATH=$(CURDIR ) /sources/whisper.cpp LIBRARY_PATH=$(CURDIR ) /sources/whisper.cpp \
804
+ CGO_LDFLAGS=" $( CGO_LDFLAGS) $( CGO_LDFLAGS_WHISPER) " C_INCLUDE_PATH=" $( CURDIR) /sources/whisper.cpp/include: $( CURDIR ) /sources/whisper.cpp/ggml/include " LIBRARY_PATH=$(CURDIR ) /sources/whisper.cpp \
796
805
$(GOCMD ) build -ldflags " $( LD_FLAGS) " -tags " $( GO_TAGS) " -o backend-assets/grpc/whisper ./backend/go/transcribe/
797
806
798
807
backend-assets/grpc/local-store : backend-assets/grpc
0 commit comments