]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
CUDA: only support F32/F16 for GGML_OP_REPEAT (#24533)
authorleonardHONG <redacted>
Mon, 15 Jun 2026 06:11:00 +0000 (14:11 +0800)
committerGitHub <redacted>
Mon, 15 Jun 2026 06:11:00 +0000 (09:11 +0300)
ggml/src/ggml-cuda/ggml-cuda.cu
tests/test-backend-ops.cpp

index 61041bdc16b3f978795de5e789ed7399498fb5b7..01c29a8c680db83751fa66770cf0b4ec2c2c28b2 100644 (file)
@@ -5337,8 +5337,9 @@ static bool ggml_backend_cuda_device_supports_op(ggml_backend_dev_t dev, const g
             } break;
         case GGML_OP_REPEAT:
             {
+                // the CUDA REPEAT path only implements F32/F16; other types assert at runtime
                 ggml_type src0_type = op->src[0]->type;
-                return src0_type != GGML_TYPE_I32 && src0_type != GGML_TYPE_I16;
+                return src0_type == GGML_TYPE_F32 || src0_type == GGML_TYPE_F16;
             } break;
         case GGML_OP_REPEAT_BACK:
                 return op->type == GGML_TYPE_F32 && (op->src[0]->ne[2]*op->src[0]->ne[3]) <= (1 << 15);
index 00d90fc2b4b3a3d45616efc931585a50eb9331b7..3afd5878a317bee9675fe7d0e82e9e39f322cdd7 100644 (file)
@@ -8086,6 +8086,7 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
         test_cases.emplace_back(new test_repeat(GGML_TYPE_F32, {10, 5, 4, ne3}, {1, 1, 1, 2}));
         test_cases.emplace_back(new test_repeat(GGML_TYPE_I32, {10, 5, 4, ne3}, {2, 1, 1, 1}));
         test_cases.emplace_back(new test_repeat(GGML_TYPE_I16, {10, 5, 4, ne3}, {1, 1, 1, 2}));
+        test_cases.emplace_back(new test_repeat(GGML_TYPE_BF16, {10, 5, 4, ne3}, {2, 1, 1, 1}));
     }
 
     for (bool view : {false, true}) {