vulkan: for small AMD GPUs, reduce submission threshold based on CU count (#25240)

This commit is contained in:
Ruben Ortlam
2026-07-08 18:15:18 +02:00
committed by GitHub
parent 81ff7abe50
commit 0bbc87b163
+12 -1
View File
@@ -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;