Repository navigation
Add Method.set_output and write unplanned input mutations in place in pybindings #23183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nil-is-all
merged 18 commits into
pytorch:main
from
IlyasMoutawwakil:pybindings-method-set-output
Oct 28, 2026
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fc99f94
allow inplace io binding in mlx and add python runtime interface
IlyasMoutawwakil 84f3705
Add Method.set_output and write unplanned input mutations in place in…
IlyasMoutawwakil 75fa40a
Harden PyMethod output bindings and document caller-owned outputs
IlyasMoutawwakil ea6e85f
Merge old remote branch, keeping the rebased version
IlyasMoutawwakil fd0dbab
Merge remote-tracking branch 'upstream/main' into pybindings-method-s…
IlyasMoutawwakil a08f44e
Refuse execute after a failed set_inputs, reject non-contiguous bound…
IlyasMoutawwakil d576a7e
Merge upstream/main into pybindings-method-set-output
IlyasMoutawwakil 032b05c
Merge branch 'main' into pybindings-method-set-output
IlyasMoutawwakil a576582
Plan outputs too when testing a memory planned mutated input
IlyasMoutawwakil ccea46f
Merge branch 'main' into pybindings-method-set-output
IlyasMoutawwakil b28bb4b
Clone outputs that are inputs unless clone_outputs=False
IlyasMoutawwakil 0ad204b
Merge main and adapt output bindings to portable tensor views
IlyasMoutawwakil bf8ba10
Merge main into pybindings-method-set-output
IlyasMoutawwakil 23ecda0
Match main's message for a replaced aliased input
IlyasMoutawwakil 7b552a3
Return an input that is also an output as main does
IlyasMoutawwakil b0b8f9c
set_output: refuse ATen builds and shared memory, raise ValueError
IlyasMoutawwakil d8b663c
Apply clang-format
IlyasMoutawwakil c38d1cf
Merge remote-tracking branch 'upstream/main' into pr23183-resolve
IlyasMoutawwakil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the bound output is also an input (a mutated input), this runs after
set_inputsand re-points the input's value at the bound tensor. So if I bind output 0 to tensor A and then call with cache B, the method reads and writes A and silently ignores B. Since mutated unplanned inputs are now handled automatically (below), shouldset_outputjust reject outputs that alias an input? That's easy once aliasing is detected structurally.