Skip to content

Commit 845233e

Browse files
committed
vad : only use CPU backend for VAD processing [no ci]
This commit modifies the VAD code to only use the CPU backend for VAD processing. There is currently an issue with the GPU backend which I need to investigate further. It is also not clear to me if running the VAD processing on a GPU is actually beneficial.
1 parent 6d66934 commit 845233e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/whisper.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -4879,12 +4879,15 @@ struct whisper_vad_context * whisper_vad_init_with_params_no_state(struct whispe
48794879
buft_list_t buft_list = make_buft_list(wparams);
48804880

48814881
auto create_tensor = [&](vad_tensor type, ggml_tensor * meta) -> ggml_tensor * {
4882+
/* TODO: Should GPU backend be used for VAD processing?
48824883
ggml_op op = VAD_TENSOR_OPS.at(type);
48834884
ggml_backend_buffer_type_t buft = select_weight_buft(hparams, meta, op, buft_list);
48844885
if (!buft) {
48854886
throw std::runtime_error(format("failed to find a compatible buffer type for tensor %s", VAD_TENSOR_NAMES.at(type)));
48864887
}
4887-
4888+
*/
4889+
// Only use CPU backend for now.
4890+
ggml_backend_buffer_type_t buft = ggml_backend_cpu_buffer_type();
48884891
ggml_context * ctx = get_ctx(buft);
48894892
ggml_tensor * tensor = ggml_dup_tensor(ctx, meta);
48904893
model.tensors[VAD_TENSOR_NAMES.at(type)] = tensor;

0 commit comments

Comments
 (0)