From 0dcfe45c1c0e04bc74ebaf714fcca3c8b30e11f6 Mon Sep 17 00:00:00 2001 From: Howard Su Date: Tue, 20 Jun 2023 23:58:37 +0800 Subject: [PATCH] Fix crash when running train with CUDA enabled --- ggml-cuda.cu | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ggml-cuda.cu b/ggml-cuda.cu index 36a251ecce973..b46d4c8ab20ab 100644 --- a/ggml-cuda.cu +++ b/ggml-cuda.cu @@ -2634,6 +2634,10 @@ void ggml_cuda_free_scratch() { bool ggml_cuda_compute_forward(struct ggml_compute_params * params, struct ggml_tensor * tensor){ ggml_cuda_func_t func; + + if (tensor->op == GGML_OP_NONE) + return true; + const bool any_on_device = tensor->backend == GGML_BACKEND_GPU || tensor->src0->backend == GGML_BACKEND_GPU || tensor->src0->backend == GGML_BACKEND_GPU_SPLIT || (tensor->src1 != nullptr && tensor->src1->backend == GGML_BACKEND_GPU);