Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion ggml/src/ggml-vulkan/ggml-vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16308,7 +16308,18 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg
uint32_t submit_count = 0;
uint64_t batch_flops = 0;
uint64_t total_flops = 0;
uint64_t flops_per_submit = std::min(uint64_t(200'000'000'000), ctx->last_total_flops / 40u);
uint64_t flops_cap = 200'000'000'000ULL;

// On weaker AMD GPUs larger submissions can hit a driver timeout, submit more often to avoid this
if (ctx->device->vendor_id == VK_VENDOR_ID_AMD && ctx->device->shader_core_count > 0) {
if (ctx->device->architecture == AMD_GCN && ctx->device->shader_core_count < 32) {
flops_cap = 500'000'000ULL * ctx->device->shader_core_count;
} else if (ctx->device->architecture != AMD_GCN && ctx->device->shader_core_count < 24) {
flops_cap = 2'000'000'000ULL * ctx->device->shader_core_count;
}
}
uint64_t flops_per_submit = std::min(flops_cap, ctx->last_total_flops / 40u);

for (int i = 0; i < cgraph->n_nodes; i++) {
if (first_node_in_batch) {
submit_node_idx = i;
Expand Down
Loading