Skip to content

Fix donation in sdpa vector - #3121

Merged
angeloskath merged 2 commits into
mainfrom
sdpa-fix
Feb 12, 2026
Merged

angeloskath merged 2 commits into
mainfrom
sdpa-fix

Conversation

@angeloskath

@angeloskath angeloskath commented Feb 12, 2026 •

Copy link
Copy Markdown
Member

Sneaky bug that would only show up when vector sdpa would donate the queries to the input and also be large enough to warrant a command encoder commit.

The bug is that arrays registered as temporaries should not span command encoders because they are removed from the list of outputs we keep track of.

I also deleted a few outdated checks for donation because they are pointless since we changed moving the buffer to copying it.

Fixes the issue in ml-explore/mlx-lm#868 .

@awni awni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice find!!

@angeloskath
angeloskath merged commit c184262 into main Feb 12, 2026
16 checks passed
@angeloskath
angeloskath deleted the sdpa-fix branch February 12, 2026 18:46
rabbitson87 pushed a commit to rabbitson87/mlx that referenced this pull request Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants