Skip to content

Commit 5c973c6

Browse files
committed
Add sync logging to show fusion effects
1 parent bee8468 commit 5c973c6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11348,7 +11348,13 @@ static bool ggml_vk_build_graph(ggml_backend_vk_context * ctx, ggml_cgraph * cgr
1134811348
}
1134911349
}
1135011350
}
11351+
11352+
#define ENABLE_SYNC_LOGGING 0
11353+
1135111354
if (need_sync) {
11355+
#if ENABLE_SYNC_LOGGING
11356+
std::cerr << "sync" << std::endl;
11357+
#endif
1135211358
ctx->unsynced_nodes_written.clear();
1135311359
ctx->unsynced_nodes_read.clear();
1135411360
ggml_vk_sync_buffers(ctx, compute_ctx);
@@ -11366,6 +11372,18 @@ static bool ggml_vk_build_graph(ggml_backend_vk_context * ctx, ggml_cgraph * cgr
1136611372
}
1136711373
}
1136811374
}
11375+
#if ENABLE_SYNC_LOGGING
11376+
if (!dryrun) {
11377+
for (int i = 0; i < ctx->num_additional_fused_ops + 1; ++i) {
11378+
auto *n = cgraph->nodes[node_idx + i];
11379+
std::cerr << node_idx + i << " " << ggml_op_name(n->op) << " " << n->name;
11380+
if (n->op == GGML_OP_GLU) {
11381+
std::cerr << " " << ggml_glu_op_name(ggml_get_glu_op(n)) << " " << (n->src[1] ? "split" : "single") << " ";
11382+
}
11383+
std::cerr << std::endl;
11384+
}
11385+
}
11386+
#endif
1136911387

1137011388
switch (node->op) {
1137111389
case GGML_OP_REPEAT:

0 commit comments

Comments
 (0)