From: Cebtenzzre Date: Fri, 4 Aug 2023 15:34:32 +0000 (-0400) Subject: CUDA: check if event is NULL before cudaStreamWaitEvent (#2505) X-Git-Tag: gguf-v0.4.0~357 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=02f9d96a866268700b8d8e7acbbcb4392c5ff345;p=pkg%2Fggml%2Fsources%2Fllama.cpp CUDA: check if event is NULL before cudaStreamWaitEvent (#2505) Fixes #2503 --- diff --git a/ggml-cuda.cu b/ggml-cuda.cu index e0192bc6..4321e467 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -5203,7 +5203,7 @@ static void ggml_cuda_op(const ggml_tensor * src0, const ggml_tensor * src1, ggm if (split && g_device_count > 1) { CUDA_CHECK(cudaSetDevice(g_main_device)); for (int id = 0; id < g_device_count; ++id) { - if (id != g_main_device) { + if (id != g_main_device && src0_extra->events[id]) { CUDA_CHECK(cudaStreamWaitEvent(g_cudaStreams_main[g_main_device], src0_extra->events[id])); } }