From 05c51f96fe60820d6c70f5fd3d4f03653caadeda Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Sun, 5 Nov 2023 00:56:32 -0400 Subject: [PATCH] cuda : fix disabling device with --tensor-split 1,0 --- ggml-cuda.cu | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ggml-cuda.cu b/ggml-cuda.cu index bdbcca0ca..e4d496498 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -7117,6 +7117,9 @@ static void ggml_cuda_op_mul_mat( CUDA_CHECK(ggml_cuda_set_device(g_main_device)); for (int64_t id = 0; id < g_device_count; ++id) { + if (g_tensor_split[id] >= (id + 1 < g_device_count ? g_tensor_split[id + 1] : 1.0f)) { + continue; + } for (int64_t is = 0; is < is_max; ++is) { CUDA_CHECK(cudaStreamWaitEvent(g_cudaStreams[g_main_device][0], src0_extra->events[id][is], 0)); }