Skip to content

Commit 180eef4

Browse files
committed
Add sync logging to show fusion effects
1 parent 81853b5 commit 180eef4

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
@@ -11291,7 +11291,13 @@ static bool ggml_vk_build_graph(ggml_backend_vk_context * ctx, ggml_cgraph * cgr
1129111291
}
1129211292
}
1129311293
}
11294+
11295+
#define ENABLE_SYNC_LOGGING 0
11296+
1129411297
if (need_sync) {
11298+
#if ENABLE_SYNC_LOGGING
11299+
std::cerr << "sync" << std::endl;
11300+
#endif
1129511301
ctx->unsynced_nodes_written.clear();
1129611302
ctx->unsynced_nodes_read.clear();
1129711303
ggml_vk_sync_buffers(ctx, compute_ctx);
@@ -11309,6 +11315,18 @@ static bool ggml_vk_build_graph(ggml_backend_vk_context * ctx, ggml_cgraph * cgr
1130911315
}
1131011316
}
1131111317
}
11318+
#if ENABLE_SYNC_LOGGING
11319+
if (!dryrun) {
11320+
for (int i = 0; i < ctx->num_additional_fused_ops + 1; ++i) {
11321+
auto *n = cgraph->nodes[node_idx + i];
11322+
std::cerr << node_idx + i << " " << ggml_op_name(n->op) << " " << n->name;
11323+
if (n->op == GGML_OP_GLU) {
11324+
std::cerr << " " << ggml_glu_op_name(ggml_get_glu_op(n)) << " " << (n->src[1] ? "split" : "single") << " ";
11325+
}
11326+
std::cerr << std::endl;
11327+
}
11328+
}
11329+
#endif
1131211330

1131311331
switch (node->op) {
1131411332
case GGML_OP_REPEAT:

0 commit comments

Comments
 (0)