]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
metal : fix soft_max kernel src1 argument (#1602)
authorGeorgi Gerganov <redacted>
Fri, 8 Dec 2023 11:39:32 +0000 (13:39 +0200)
committerGeorgi Gerganov <redacted>
Fri, 8 Dec 2023 11:39:32 +0000 (13:39 +0200)
ggml-metal.m

index f9bd69dc84bbe78128c5b9a01917decc40b627f0..df2983f7c5c3ff3951d0d657c7ae33aac5f1bb6d 100644 (file)
@@ -1193,7 +1193,9 @@ void ggml_metal_graph_compute(
                             const float scale = ((float *) dst->op_params)[0];
 
                             [encoder setBuffer:id_src0 offset:offs_src0   atIndex:0];
-                            [encoder setBuffer:id_src1 offset:offs_src1   atIndex:1];
+                            if (id_src1) {
+                                [encoder setBuffer:id_src1 offset:offs_src1   atIndex:1];
+                            }
                             [encoder setBuffer:id_dst  offset:offs_dst    atIndex:2];
                             [encoder setBytes:&ne00  length:sizeof(ne00)  atIndex:3];
                             [encoder setBytes:&ne01  length:sizeof(ne01)  atIndex:4];