vulkan: use flops instead of weight tensor size for submission heuristic#25005
Merged
Conversation
jeffbolznv
approved these changes
Jun 25, 2026
Contributor
Author
|
@ggml-org/maintainers Another approval needed. |
pwilkin
approved these changes
Jun 29, 2026
turbo-tan
pushed a commit
to turbo-tan/llama.cpp-tq3
that referenced
this pull request
Jul 1, 2026
…tic (ggml-org#25005) * vulkan: extract flops calculation into function * use flops instead of matmul src0 tensor size for submission threshold * use unsigned ints
adrianhoehne
pushed a commit
to adrianhoehne/llama.cpp
that referenced
this pull request
Jul 5, 2026
…tic (ggml-org#25005) * vulkan: extract flops calculation into function * use flops instead of matmul src0 tensor size for submission threshold * use unsigned ints
CowboyTim
pushed a commit
to aardbeiplantje/llama.cpp
that referenced
this pull request
Jul 21, 2026
…tic (ggml-org#25005) * vulkan: extract flops calculation into function * use flops instead of matmul src0 tensor size for submission threshold * use unsigned ints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
My guess for the long-running issues with DeviceLost errors on AMD and Intel due to submission timeouts is that we currently only treat matmuls as special in the submission batching logic, by taking the combined size of their weight matrices into account. But Flash Attention and convolutions are also very heavy operations that should be considered here. This doesn't work in the same way, so in this PR I'm trying to use FLOPs instead of weight matrix size weights for submission estimation. That should be easier to expand to other operators that might come in in the future.
This also fixes a bug where previously
uint64_t mul_mat_bytes_per_submit = std::min(uint64_t(100*1000*1000), ctx->last_total_mul_mat_bytes / 40u);would always submit each operator separately on the first run, becausectx->last_total_mul_mat_byteswould start out as 0, so always be smaller than 100 MiB.I'm still trying to reproduce the DeviceLost error on one of my devices.
Requirements