remove _is_foreach_op codegen special cases, clean up mutable return type checks#76190
remove _is_foreach_op codegen special cases, clean up mutable return type checks#76190bdhirsh wants to merge 6 commits intogh/bdhirsh/216/basefrom
Conversation
…type checks [ghstack-poisoned]
🔗 Helpful links
💊 CI failures summary and remediationsAs of commit 12f91b3 (more details on the Dr. CI page): Expand to see more💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
…ble return type checks" This PR cleans up some of the codegen type checks / special casing for foreach ops. In particular, as described in 76049, schemas that mutate their inputs and return the mutated input directly as an output are only really useful for method chaining. If your schema involves a mutable input that you can't easily method chain on (like a `Tensor?` or a `Tensor[]`), then we expect the return type to be void. We actually also have to allow return types of tuples of mutable tensors, since we have a bunch of ops that fit that description today. [ghstack-poisoned]
…ble return type checks" This PR cleans up some of the codegen type checks / special casing for foreach ops. In particular, as described in 76049, schemas that mutate their inputs and return the mutated input directly as an output are only really useful for method chaining. If your schema involves a mutable input that you can't easily method chain on (like a `Tensor?` or a `Tensor[]`), then we expect the return type to be void. We actually also have to allow return types of tuples of mutable tensors, since we have a bunch of ops that fit that description today. [ghstack-poisoned]
…ble return type checks" This PR cleans up some of the codegen type checks / special casing for foreach ops. In particular, as described in 76049, schemas that mutate their inputs and return the mutated input directly as an output are only really useful for method chaining. If your schema involves a mutable input that you can't easily method chain on (like a `Tensor?` or a `Tensor[]`), then we expect the return type to be void. We actually also have to allow return types of tuples of mutable tensors, since we have a bunch of ops that fit that description today. [ghstack-poisoned]
…ble return type checks" This PR cleans up some of the codegen type checks / special casing for foreach ops. In particular, as described in #76049, schemas that mutate their inputs and return the mutated input directly as an output are only really useful for method chaining. If your schema involves a mutable input that you can't easily method chain on (like a `Tensor?` or a `Tensor[]`), then we expect the return type to be void. We actually also have to allow return types of tuples of mutable tensors, since we have a bunch of ops that fit that description today. [ghstack-poisoned]
…ble return type checks" This PR cleans up some of the codegen type checks / special casing for foreach ops. In particular, as described in #76049, schemas that mutate their inputs and return the mutated input directly as an output are only really useful for method chaining. If your schema involves a mutable input that you can't easily method chain on (like a `Tensor?` or a `Tensor[]`), then we expect the return type to be void. We actually also have to allow return types of tuples of mutable tensors, since we have a bunch of ops that fit that description today. [ghstack-poisoned]
|
@pytorchbot merge this please |
|
Merge failed due to Command Raised by https://github.com/pytorch/pytorch/actions/runs/2223000776 |
…type checks (#76190) Summary: Pull Request resolved: #76190 Approved by: https://github.com/ezyang Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/74e93f727a732c9a5208c75eca0f9551399372fd Reviewed By: osalpekar Differential Revision: D35938193 Pulled By: bdhirsh fbshipit-source-id: 5a57ac39891f0f74184d7420189a9b09125d9a7f
This PR cleans up some of the codegen type checks / special casing for foreach ops.
In particular, as described in #76049, schemas that mutate their inputs and return the mutated input directly as an output are only really useful for method chaining. If your schema involves a mutable input that you can't easily method chain on (like a
Tensor?or aTensor[]), then we expect the return type to be void.We actually also have to allow return types of tuples of mutable tensors, since we have a bunch of ops that fit that description today.
Stack from ghstack: