Skip to content

Fix missing stream in layer_norm and sdpa fallbacks - #4663

Merged
zcbenz merged 2 commits into
ml-explore:mainfrom
AkshayShah03:fix-fast-fallback-streams
Oct 10, 2026
Merged

zcbenz merged 2 commits into
ml-explore:mainfrom
AkshayShah03:fix-fast-fallback-streams

Conversation

@AkshayShah03

Copy link
Copy Markdown
Contributor
  • ☑️ I understand it is strictly prohibited to use AI to write PR description
  • AI usage disclosure: Claude Code was used to help locate the bug, write the fix and the C++ test, and run the builds and tests. I reviewed and verified the changes.

fix #4659 multiply(xc, rsqrt(...)) falls back to to_stream({}), where converting bool mask in SDPA faced same bug, both fixed, new c++ test to check primitive stream.

@zcbenz
zcbenz force-pushed the fix-fast-fallback-streams branch from 35b40d1 to e3bdd74 Compare October 9, 2026 10:19
AkshayShah03 and others added 2 commits October 10, 2026 10:15
…ersion

The fast::layer_norm fallback built one multiply without the stream, so
it ran on the default stream instead of the caller's. The bool-to-additive
mask conversion in scaled_dot_product_attention had the same problem with
its where. Fixes ml-explore#4659.
@zcbenz
zcbenz force-pushed the fix-fast-fallback-streams branch from e3bdd74 to 5ce4ec9 Compare October 10, 2026 01:15
@zcbenz zcbenz changed the title Pass stream to layer_norm fallback multiply and SDPA bool mask where Fix missing stream in layer_norm and sdpa fallbacks Oct 10, 2026
@zcbenz
zcbenz merged commit 0fdcdc0 into ml-explore:main Oct 10, 2026
30 checks passed
@BrewTestBot BrewTestBot mentioned this pull request Oct 15, 2026
3 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fast::layer_norm fallback runs one multiply on the default stream

2 participants