Skip to content

Commit 142df17

Browse files
authored
vulkan: use a fixed 1KB buffer for the add_rms_fusion opt (#17514)
1 parent e509411 commit 142df17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5289,7 +5289,8 @@ static void ggml_vk_init(ggml_backend_vk_context * ctx, size_t idx) {
52895289
ctx->prealloc_size_x = 0;
52905290
ctx->prealloc_size_y = 0;
52915291
ctx->prealloc_size_split_k = 0;
5292-
ctx->prealloc_size_add_rms_partials = 0;
5292+
// Fixed size of 1KB, for deterministic behavior
5293+
ctx->prealloc_size_add_rms_partials = 1024;
52935294

52945295
ctx->fence = ctx->device->device.createFence({});
52955296
ctx->almost_ready_fence = ctx->device->device.createFence({});
@@ -13095,7 +13096,6 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg
1309513096
ctx->fused_ops_write_mask = 0;
1309613097
}
1309713098

13098-
ctx->prealloc_size_add_rms_partials = std::max(ctx->prealloc_size_add_rms_partials, ctx->prealloc_size_add_rms_partials_offset);
1309913099
ctx->last_total_mul_mat_bytes = total_mul_mat_bytes;
1310013100

1310113101
if (vk_perf_logger_enabled) {

0 commit comments

Comments
 (0)