]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
metal : relax reorder conditions (llama/16216)
authorGeorgi Gerganov <redacted>
Thu, 25 Sep 2025 08:29:42 +0000 (11:29 +0300)
committerGeorgi Gerganov <redacted>
Mon, 29 Sep 2025 12:18:10 +0000 (15:18 +0300)
ggml/src/ggml-metal/ggml-metal-common.cpp

index e61a5706d610cdf1f15ddaf32c854aa0489c058e..3ce7d75aad6c977ad24dee99955ef6f75581b03e 100644 (file)
@@ -256,8 +256,6 @@ static std::vector<int> ggml_metal_graph_optimize_reorder(const std::vector<node
 
     // perform reorders only across these types of ops
     // can be expanded when needed
-    // IMPORTANT: do not add ops such as GGML_OP_CPY or GGML_OP_SET_ROWS
-    //            the dependencies from such ops are not always represented in the graph
     const auto & h_safe = [](ggml_op op) {
         switch (op) {
             case GGML_OP_MUL_MAT:
@@ -273,6 +271,8 @@ static std::vector<int> ggml_metal_graph_optimize_reorder(const std::vector<node
             case GGML_OP_GLU:
             case GGML_OP_SCALE:
             case GGML_OP_GET_ROWS:
+            case GGML_OP_CPY:
+            case GGML_OP_SET_ROWS:
                 return true;
             default:
                 return ggml_op_is_empty(op);