From: Aman Gupta Date: Wed, 19 Nov 2025 10:25:05 +0000 (+0800) Subject: cuda: fix rope fusion for gemma3 (llama/17378) X-Git-Tag: upstream/0.9.4.395~148 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=af29200932ae40a33a8adcc1a19dfb63b0399c8d;p=pkg%2Fggml%2Fsources%2Fggml cuda: fix rope fusion for gemma3 (llama/17378) --- diff --git a/src/ggml-cuda/ggml-cuda.cu b/src/ggml-cuda/ggml-cuda.cu index 7d792e60..889801cb 100644 --- a/src/ggml-cuda/ggml-cuda.cu +++ b/src/ggml-cuda/ggml-cuda.cu @@ -3001,6 +3001,10 @@ static void update_cuda_graph_executable(ggml_backend_cuda_context * cuda_ctx) { static bool ggml_cuda_should_fuse_rope_set_rows(const ggml_tensor * rope, const ggml_tensor * view, const ggml_tensor * set_rows) { + + if (rope->op != GGML_OP_ROPE || view->op != GGML_OP_VIEW || set_rows->op != GGML_OP_SET_ROWS) { + return false; + } // ne3 not tested if (rope->src[0]->ne[3] != 1) { return false;