[Cute, Flex, Fwd, Sm100] Allow vectorized score_mod definitions#2215
Closed
reubenconducts wants to merge 7 commits into
Closed
[Cute, Flex, Fwd, Sm100] Allow vectorized score_mod definitions#2215reubenconducts wants to merge 7 commits into
reubenconducts wants to merge 7 commits into
Conversation
drisspg
reviewed
Jan 29, 2026
drisspg
reviewed
Jan 29, 2026
drisspg
reviewed
Jan 29, 2026
drisspg
reviewed
Jan 29, 2026
drisspg
reviewed
Jan 29, 2026
Collaborator
drisspg
left a comment
There was a problem hiding this comment.
some comments but I like the direction
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.
This PR is a
score_mod"power user" update that allows the user to specify vectorization for a givenscore_mod. It does so in two ways:score_mod.__vec_size__and have the kernel read that, instead of using the current logic (vec_size = 2 if noaux_tensorsare present, otherwise 1)buf.__assumed_align__andbuf.__leading_dim__for anyaux_tensors, allowing vectorized loads in thescore_modwhen set.These options are not exposed in the API; they must be set specific to the given
score_modandaux_tensors, and are thus a "power user" feature.For a kv bias load
score_mod, we see up to 2.9x speedup:Passing tests, comparing bitwise equality between many vectorized and unvectorized score mods:


Of course, there is added complexity in defining
score_mods to be performant, but it's strictly contained to within thescore_moddefinition (plus the 3 attributes mentioned above).Still TODO, reserved for later PRs:
mask_modapplicationcc: @drisspg @v0i0