Repository navigation
Pass the caller stream through complex l2_norm and scatter max/min VJP - #4818
Open
Augustas11 wants to merge 1 commit into
Open
Augustas11 wants to merge 1 commit into
Augustas11 wants to merge 1 commit into
Conversation
operator* and operator== build on the default stream. Complex l2_norm and the max/min scatter gradient both went through them.
This branch has not been deployed
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.
AI usage disclosure: drafted with AI assistance from a stream audit. Both call sites were checked against
multiplyandequalinmlx/ops.h, which take a stream. The test suite has not been run locally.Follow-up to #4746. Two call sites still drop the stream the caller passed, and the stream checker misses them because they are operator overloads.
Complex
l2_normdidabs(a, s) * abs(a, s).operator*takes no stream, so the product is built on the thread's default stream. Real inputs already go throughsquare(a, s). The complex path now usesmultiply(abs(a, s), abs(a, s), s).Max and min
Scatter::vjpdidgathered_result == updatesinside amultiplythat already receivedstream().operator==takes no stream. That comparison is nowequal(gathered_result, updates, stream()).This only changes complex
l2_normand the max/min scatter gradient.The existing cross-thread test in
tests/scheduler_tests.cppnow builds both graphs on a thread-unsafe stream and evaluates them from the other thread: a complexlinalg::norm, and ascatter_maxVJP.Augustas from Malibu