Skip to content

Commit 1982117

Browse files
authored
vulkan: add barrier after writetimestamp (#21865)
1 parent 698d19b commit 1982117

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13014,6 +13014,7 @@ static bool ggml_vk_build_graph(ggml_backend_vk_context * ctx, ggml_cgraph * cgr
1301413014
if (vk_perf_logger_enabled && vk_perf_logger_concurrent) {
1301513015
ctx->query_node_idx[ctx->query_idx] = node_idx;
1301613016
compute_ctx->s->buffer->buf.writeTimestamp(vk::PipelineStageFlagBits::eAllCommands, ctx->query_pool, ctx->query_idx++);
13017+
ggml_vk_sync_buffers(ctx, compute_ctx);
1301713018
}
1301813019
}
1301913020
// Add all fused nodes to the unsynchronized lists.
@@ -14503,6 +14504,7 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg
1450314504
compute_ctx = ggml_vk_get_compute_ctx(ctx);
1450414505
ctx->query_idx = 0;
1450514506
compute_ctx->s->buffer->buf.writeTimestamp(vk::PipelineStageFlagBits::eAllCommands, ctx->query_pool, ctx->query_idx++);
14507+
ggml_vk_sync_buffers(ctx, compute_ctx);
1450614508
}
1450714509

1450814510
ctx->prealloc_y_last_pipeline_used = nullptr;
@@ -14739,6 +14741,7 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg
1473914741
ctx->query_nodes[ctx->query_idx] = cgraph->nodes[i];
1474014742
ctx->query_fusion_names[ctx->query_idx] = fusion_string;
1474114743
compute_ctx->s->buffer->buf.writeTimestamp(vk::PipelineStageFlagBits::eAllCommands, ctx->query_pool, ctx->query_idx++);
14744+
ggml_vk_sync_buffers(ctx, compute_ctx);
1474214745
} else {
1474314746
// track a fusion string and number of fused ops for the current node_idx
1474414747
ctx->query_fusion_names[i] = fusion_string;

0 commit comments

Comments
 (0)