Skip to content

Commit 45898a9

Browse files
ggerganovstruct
authored andcommitted
metal : relax reorder conditions (ggml-org#16216)
1 parent 8b57b66 commit 45898a9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml/src/ggml-metal/ggml-metal-common.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ static std::vector<int> ggml_metal_graph_optimize_reorder(const std::vector<node
256256

257257
// perform reorders only across these types of ops
258258
// can be expanded when needed
259-
// IMPORTANT: do not add ops such as GGML_OP_CPY or GGML_OP_SET_ROWS
260-
// the dependencies from such ops are not always represented in the graph
261259
const auto & h_safe = [](ggml_op op) {
262260
switch (op) {
263261
case GGML_OP_MUL_MAT:
@@ -273,6 +271,8 @@ static std::vector<int> ggml_metal_graph_optimize_reorder(const std::vector<node
273271
case GGML_OP_GLU:
274272
case GGML_OP_SCALE:
275273
case GGML_OP_GET_ROWS:
274+
case GGML_OP_CPY:
275+
case GGML_OP_SET_ROWS:
276276
return true;
277277
default:
278278
return ggml_op_is_empty(op);

0 commit comments

Comments
 (0)