Repository navigation
Conversation
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/180987
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (1 Unrelated Failure)As of commit 16aa556 with merge base a55ca57 ( UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. [ghstack-poisoned]
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. ghstack-source-id: c9b736a Pull Request resolved: #180987
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. [ghstack-poisoned]
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. ghstack-source-id: 414f929 Pull Request resolved: #180987
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. [ghstack-poisoned]
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. ghstack-source-id: 420dbf4 Pull Request resolved: #180987
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. [ghstack-poisoned]
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. ghstack-source-id: aac8a79 Pull Request resolved: #180987
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
This PR needs a
|
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
The failure is interesting. Resolution is I'm deleting the warning but going to keep everything else. |
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. [ghstack-poisoned]
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. [ghstack-poisoned]
|
Starting merge as part of PR stack under #181100 |
1 similar comment
|
Starting merge as part of PR stack under #181100 |
An inplace operator mutates its first positional argument and returns it. For custom operators (defined via torch.library), the first argument must be a plain Tensor(a!), must be the only mutable argument, and the operator must return exactly that tensor. Native operators have relaxed requirements (e.g. Tensor[] self, multiple mutable args) but this is subject to change. This PR adds a Tag.inplace tag, auto-applies it to all native inplace operators via torchgen, and validates the schema when custom operators are defined with this tag via torch.library.define. Test Plan: - python test/custom_operator/test_inplace.py Authored with Claude. Pull Request resolved: #181099 Approved by: https://github.com/angelayi ghstack dependencies: #181380, #180987
Allow custom operators tagged with torch.Tag.inplace to go through auto_functionalize during torch.compile. The functional form of e.g. `foo_(Tensor(a!) self, Tensor other) -> Tensor(a!)` passes self as a base in _all_bases (with view info) so that the reinplacing pass can do clone analysis—unlike out= ops where the mutable args are write-only and clones are never needed. Test Plan: - python test/test_inplace_tag.py Pull Request resolved: #181100 Approved by: https://github.com/aorenste, https://github.com/angelayi ghstack dependencies: #181380, #180987, #181099
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. Pull Request resolved: pytorch#180987 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#180851, pytorch#180852
…torch#181098) test/custom_operator/** tests are not actually run in CI (except for one of them...) Pull Request resolved: pytorch#181098 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#180851, pytorch#180852, pytorch#180987
…rch#180987)" This reverts commit 9c406e3. Reverted pytorch#180987 on behalf of https://github.com/ZainRizvi due to Sorry but this is breaking internally. See diff D102001674 and D102198161 for details. To validate your fixes internally, you can follow the instructions here: https://fburl.com/fixing-ghfirst-reverts ([comment](pytorch#180987 (comment)))
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. Pull Request resolved: pytorch#180987 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#181380
An inplace operator mutates its first positional argument and returns it. For custom operators (defined via torch.library), the first argument must be a plain Tensor(a!), must be the only mutable argument, and the operator must return exactly that tensor. Native operators have relaxed requirements (e.g. Tensor[] self, multiple mutable args) but this is subject to change. This PR adds a Tag.inplace tag, auto-applies it to all native inplace operators via torchgen, and validates the schema when custom operators are defined with this tag via torch.library.define. Test Plan: - python test/custom_operator/test_inplace.py Authored with Claude. Pull Request resolved: pytorch#181099 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#181380, pytorch#180987
) Allow custom operators tagged with torch.Tag.inplace to go through auto_functionalize during torch.compile. The functional form of e.g. `foo_(Tensor(a!) self, Tensor other) -> Tensor(a!)` passes self as a base in _all_bases (with view info) so that the reinplacing pass can do clone analysis—unlike out= ops where the mutable args are write-only and clones are never needed. Test Plan: - python test/test_inplace_tag.py Pull Request resolved: pytorch#181100 Approved by: https://github.com/aorenste, https://github.com/angelayi ghstack dependencies: pytorch#181380, pytorch#180987, pytorch#181099
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. Pull Request resolved: pytorch#180987 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#180851, pytorch#180852
…torch#181098) test/custom_operator/** tests are not actually run in CI (except for one of them...) Pull Request resolved: pytorch#181098 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#180851, pytorch#180852, pytorch#180987
…rch#180987)" This reverts commit 9c406e3. Reverted pytorch#180987 on behalf of https://github.com/ZainRizvi due to Sorry but this is breaking internally. See diff D102001674 and D102198161 for details. To validate your fixes internally, you can follow the instructions here: https://fburl.com/fixing-ghfirst-reverts ([comment](pytorch#180987 (comment)))
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. Pull Request resolved: pytorch#180987 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#181380
An inplace operator mutates its first positional argument and returns it. For custom operators (defined via torch.library), the first argument must be a plain Tensor(a!), must be the only mutable argument, and the operator must return exactly that tensor. Native operators have relaxed requirements (e.g. Tensor[] self, multiple mutable args) but this is subject to change. This PR adds a Tag.inplace tag, auto-applies it to all native inplace operators via torchgen, and validates the schema when custom operators are defined with this tag via torch.library.define. Test Plan: - python test/custom_operator/test_inplace.py Authored with Claude. Pull Request resolved: pytorch#181099 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#181380, pytorch#180987
) Allow custom operators tagged with torch.Tag.inplace to go through auto_functionalize during torch.compile. The functional form of e.g. `foo_(Tensor(a!) self, Tensor other) -> Tensor(a!)` passes self as a base in _all_bases (with view info) so that the reinplacing pass can do clone analysis—unlike out= ops where the mutable args are write-only and clones are never needed. Test Plan: - python test/test_inplace_tag.py Pull Request resolved: pytorch#181100 Approved by: https://github.com/aorenste, https://github.com/angelayi ghstack dependencies: pytorch#181380, pytorch#180987, pytorch#181099
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. Pull Request resolved: pytorch#180987 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#180851, pytorch#180852
…torch#181098) test/custom_operator/** tests are not actually run in CI (except for one of them...) Pull Request resolved: pytorch#181098 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#180851, pytorch#180852, pytorch#180987
…rch#180987)" This reverts commit 9c406e3. Reverted pytorch#180987 on behalf of https://github.com/ZainRizvi due to Sorry but this is breaking internally. See diff D102001674 and D102198161 for details. To validate your fixes internally, you can follow the instructions here: https://fburl.com/fixing-ghfirst-reverts ([comment](pytorch#180987 (comment)))
Operators tagged with Tag.out have well-defined fake kernel semantics: return the out= arguments in declaration order. This extends the existing auto-fake-kernel mechanism (which handles mutable ops with no returns) to also cover Tag.out ops, removing the need for users to manually write trivial fake/meta kernels for these operators. Also warns when users manually register a Meta kernel for a non-builtin Tag.out operator, since the automatic registration is preferred and the manual version is easy to get wrong. Authored with Claude. Pull Request resolved: pytorch#180987 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#181380
An inplace operator mutates its first positional argument and returns it. For custom operators (defined via torch.library), the first argument must be a plain Tensor(a!), must be the only mutable argument, and the operator must return exactly that tensor. Native operators have relaxed requirements (e.g. Tensor[] self, multiple mutable args) but this is subject to change. This PR adds a Tag.inplace tag, auto-applies it to all native inplace operators via torchgen, and validates the schema when custom operators are defined with this tag via torch.library.define. Test Plan: - python test/custom_operator/test_inplace.py Authored with Claude. Pull Request resolved: pytorch#181099 Approved by: https://github.com/angelayi ghstack dependencies: pytorch#181380, pytorch#180987
) Allow custom operators tagged with torch.Tag.inplace to go through auto_functionalize during torch.compile. The functional form of e.g. `foo_(Tensor(a!) self, Tensor other) -> Tensor(a!)` passes self as a base in _all_bases (with view info) so that the reinplacing pass can do clone analysis—unlike out= ops where the mutable args are write-only and clones are never needed. Test Plan: - python test/test_inplace_tag.py Pull Request resolved: pytorch#181100 Approved by: https://github.com/aorenste, https://github.com/angelayi ghstack dependencies: pytorch#181380, pytorch#180987, pytorch#181099
Stack from ghstack (oldest at bottom):
Operators tagged with Tag.out have well-defined fake kernel semantics:
return the out= arguments in declaration order. This extends the
existing auto-fake-kernel mechanism (which handles mutable ops with no
returns) to also cover Tag.out ops, removing the need for users to
manually write trivial fake/meta kernels for these operators.
Also warns when users manually register a Meta kernel for a non-builtin
Tag.out operator, since the automatic registration is preferred and the
manual version is easy to get wrong.
Authored with Claude.