vulkan: Preprocess FA mask to detect all-neg-inf and all-zero.#19281
Merged
jeffbolznv merged 1 commit intoggml-org:masterfrom Feb 5, 2026
Merged
vulkan: Preprocess FA mask to detect all-neg-inf and all-zero.#19281jeffbolznv merged 1 commit intoggml-org:masterfrom
jeffbolznv merged 1 commit intoggml-org:masterfrom
Conversation
Collaborator
Author
|
I was initially surprised at how much the scalar path benefited from this. I had assumed that slower math would mean the stalls would be a smaller percentage of the time. But I guess the smaller tile size means less math per stall, so it ends up benefiting as much or more than the coopmat paths. |
Member
|
Do I understand correctly that all gains here are effectively thanks to the "skip loading of all-zero masks", since the "all-inf" case was already being handled in #17186? |
Collaborator
Author
|
The previous change skipped the math for all-inf blocks. This change skips loading the mask for all-inf and all-zero blocks. The mask load is relatively expensive and with the way the code is structured there wasn't anything for the SM to do while waiting on the load. |
Write out a 2-bit code per block and avoid loading the mask when it matches these two common cases. Apply this optimization when the mask is relatively large (i.e. prompt processing).
6195385 to
a95c994
Compare
0cc4m
approved these changes
Feb 5, 2026
liparetejas
pushed a commit
to liparetejas/llama.cpp
that referenced
this pull request
Feb 23, 2026
…org#19281) Write out a 2-bit code per block and avoid loading the mask when it matches these two common cases. Apply this optimization when the mask is relatively large (i.e. prompt processing).
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.
Write out a 2-bit code per block and avoid loading the mask when it matches these two common cases.
Apply this optimization when the mask is relatively large (i.e. prompt processing).