Skip to content

Run test/custom_operator/** in CI - #181380

Closed
zou3519 wants to merge 2 commits into
gh/zou3519/7/basefrom
gh/zou3519/7/head
Closed

zou3519 wants to merge 2 commits into
gh/zou3519/7/basefrom
gh/zou3519/7/head

Conversation

@zou3519

@zou3519 zou3519 commented Apr 24, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

My guess is they were blocklisted because
test/custom_operator/test_custom_ops.py requires some special setup. This
PR removes everything except that file from the blocklist.

Test Plan:

  • check the test is run in CI

My guess is they were blocklisted because
test/custom_operator/test_custom_ops.py requires some special setup. This
PR removes everything except that file from the blocklist.

Test Plan:
- check the test is run in CI

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Apr 24, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/181380

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 1 New Failure

As of commit 78335d9 with merge base a55ca57 (image):

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

result = torch.library.infer_schema(foo_op_7, mutates_args=mutates_args)
self.assertEqual(result, "(Scalar x) -> Scalar")

@unittest.expectedFailure

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test is failing now, can file an issue to look into it later

My guess is they were blocklisted because
test/custom_operator/test_custom_ops.py requires some special setup. This
PR removes everything except that file from the blocklist.

Test Plan:
- check the test is run in CI

[ghstack-poisoned]
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #181100

1 similar comment
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Starting merge as part of PR stack under #181100

pytorchmergebot pushed a commit that referenced this pull request Apr 25, 2026
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: #180987
Approved by: https://github.com/angelayi
ghstack dependencies: #181380
pytorchmergebot pushed a commit that referenced this pull request Apr 25, 2026
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
pytorchmergebot pushed a commit that referenced this pull request Apr 25, 2026
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
@github-actions
github-actions Bot deleted the gh/zou3519/7/head branch May 25, 2026 02:31
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
My guess is they were blocklisted because
test/custom_operator/test_custom_ops.py requires some special setup. This
PR removes everything except that file from the blocklist.

Test Plan:
- check the test is run in CI
Pull Request resolved: pytorch#181380
Approved by: https://github.com/angelayi
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
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
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
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
aperson30 pushed a commit to aperson30/pytorch that referenced this pull request Jun 20, 2026
)

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
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
My guess is they were blocklisted because
test/custom_operator/test_custom_ops.py requires some special setup. This
PR removes everything except that file from the blocklist.

Test Plan:
- check the test is run in CI
Pull Request resolved: pytorch#181380
Approved by: https://github.com/angelayi
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
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
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
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
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
)

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
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
My guess is they were blocklisted because
test/custom_operator/test_custom_ops.py requires some special setup. This
PR removes everything except that file from the blocklist.

Test Plan:
- check the test is run in CI
Pull Request resolved: pytorch#181380
Approved by: https://github.com/angelayi
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
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
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
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
aws-kingrj pushed a commit to amazon-contributing/upstream-to-pytorch that referenced this pull request Jul 29, 2026
)

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-td Do not run TD on this PR Merged topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants