Skip to content

Commit 62eccbf

Browse files
committed
metal : fuse non-sequential nodes
1 parent 63b54c8 commit 62eccbf

File tree

3 files changed

+159
-136
lines changed

3 files changed

+159
-136
lines changed

ggml/src/ggml-metal/ggml-metal-context.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,13 @@ void ggml_metal_set_n_cb(ggml_metal_t ctx, int n_cb) {
542542
ctx->debug_graph,
543543
ctx->debug_fusion);
544544

545-
for (int idx = idx_start; idx < idx_end;) {
545+
for (int idx = 0; idx < ggml_metal_op_n_nodes(ctx_op); ++idx) {
546546
const int res = ggml_metal_op_encode(ctx_op, idx);
547547
if (res == 0) {
548548
break;
549549
}
550550

551-
idx += res;
551+
idx += res - 1;
552552
}
553553

554554
ggml_metal_op_free(ctx_op);

0 commit comments

Comments
 (0)