Skip to content

Fix eval cleanup deadlock by committing GPU streams before waiting - #4556

Open
ronaldmannak wants to merge 2 commits into
ml-explore:mainfrom
PicoMLX:eval-hang
Open

ronaldmannak wants to merge 2 commits into
ml-explore:mainfrom
PicoMLX:eval-hang

Conversation

@ronaldmannak

Copy link
Copy Markdown

The exception-cleanup path added in #3675 can deadlock when evaluation throws after a CPU stream has queued a wait on uncommitted GPU work.

This PR commits all open GPU streams before syncing any stream. I've added test_eval_exception_after_cross_stream_wait which will hang without the fix

  • ☑️ I understand it is strictly prohibited to use AI to write PR description
  • AI usage disclosure: Opus 5.5 found the issue while testing distributed code

@ronaldmannak ronaldmannak changed the title Commit GPU streams before the wait Fix eval cleanup deadlock by committing GPU streams before waiting Sep 24, 2026

This branch has not been deployed

No deployments
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.

1 participant