Skip to content

Conversation

zou3519
Copy link
Contributor

@zou3519 zou3519 commented Oct 24, 2023

We extend torch.library.Library.define and torch.library.define
with a tags argument.

Test Plan:
- new test

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Oct 24, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 813df03 with merge base 28ebe5d (image):
💚 Looks good so far! There are no failures yet. 💚

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

We extend torch.library.Library.define and torch.library.define
with a tags argument. This makes them consistent with their C++ counterpart.

Test Plan:
- new test

[ghstack-poisoned]
We extend torch.library.Library.define and torch.library.define
with a tags argument.

Test Plan:
- new test

[ghstack-poisoned]
Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

It'll be convenient if it also takes list/single tag.

torch/library.py Outdated
tags (optional): Tuple of torch.Tag to add to the operator. Adding
torch.Tag may change the behavior of the operator,
please throughly test the operator to ensure the
Tag applies.
Copy link
Contributor

Choose a reason for hiding this comment

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

A typical end user isn't going to know what "test the operator so the tag applies" means.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, I'll link the gdoc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nvm, no doc for now. I'll clarify the comment.

We extend torch.library.Library.define and torch.library.define
with a tags argument.

Test Plan:
- new test

[ghstack-poisoned]
@zou3519 zou3519 added the release notes: composability release notes category label Oct 25, 2023
pytorchmergebot pushed a commit that referenced this pull request Oct 25, 2023
Unlike the previous torch.library.define, this schema doesn't take a
name (the name is a part of the qualname). We separated out the qualname
from the schema in the new APIs so that they're all consistent with each
other (they all accept the qualname separately).

Test Plan:
- new tests
Pull Request resolved: #111915
Approved by: https://github.com/suo, https://github.com/ezyang
ghstack dependencies: #111912
pytorchmergebot pushed a commit that referenced this pull request Oct 25, 2023
Summary:

Fixes #111926. The workflow is:
- create a blank file with the correct name
- run a test with PYTORCH_OPCHECK_ACCEPT=1

Test Plan:
- tested locally

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: #111948
Approved by: https://github.com/ezyang
ghstack dependencies: #111912, #111915
pytorchmergebot pushed a commit that referenced this pull request Oct 25, 2023
…iant ops (#111933)

This PR:
- adds the pt2 compliant tag. This tag specifies that the operator works
  with the PT2 compilation APIs. A custom op author should test their
  ops with opcheck if they choose to add this tag.
- adds a config for Dynamo to allow only pt2 compliant ops into the
  graph and graph break on all other OpOverload/OpOverloadPacket.

Bikeshedding help wanted on the name of the tag. It should be easily
grep-able so we can set up rules for it.

Test Plan:
- new tests

Reviewers:

Subscribers:

Tasks:

Tags:

Pull Request resolved: #111933
Approved by: https://github.com/ezyang
ghstack dependencies: #111912, #111915, #111948
@facebook-github-bot facebook-github-bot deleted the gh/zou3519/745/head branch October 29, 2023 14:23
xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Nov 7, 2023
We extend torch.library.Library.define and torch.library.define
with a tags argument.

Test Plan:
- new test
Pull Request resolved: pytorch#111912
Approved by: https://github.com/ezyang
xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Nov 7, 2023
Unlike the previous torch.library.define, this schema doesn't take a
name (the name is a part of the qualname). We separated out the qualname
from the schema in the new APIs so that they're all consistent with each
other (they all accept the qualname separately).

Test Plan:
- new tests
Pull Request resolved: pytorch#111915
Approved by: https://github.com/suo, https://github.com/ezyang
ghstack dependencies: pytorch#111912
xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Nov 7, 2023
Summary:

Fixes pytorch#111926. The workflow is:
- create a blank file with the correct name
- run a test with PYTORCH_OPCHECK_ACCEPT=1

Test Plan:
- tested locally

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: pytorch#111948
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#111912, pytorch#111915
xuhancn pushed a commit to xuhancn/pytorch that referenced this pull request Nov 7, 2023
…iant ops (pytorch#111933)

This PR:
- adds the pt2 compliant tag. This tag specifies that the operator works
  with the PT2 compilation APIs. A custom op author should test their
  ops with opcheck if they choose to add this tag.
- adds a config for Dynamo to allow only pt2 compliant ops into the
  graph and graph break on all other OpOverload/OpOverloadPacket.

Bikeshedding help wanted on the name of the tag. It should be easily
grep-able so we can set up rules for it.

Test Plan:
- new tests

Reviewers:

Subscribers:

Tasks:

Tags:

Pull Request resolved: pytorch#111933
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#111912, pytorch#111915, pytorch#111948
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
We extend torch.library.Library.define and torch.library.define
with a tags argument.

Test Plan:
- new test
Pull Request resolved: pytorch#111912
Approved by: https://github.com/ezyang
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
Unlike the previous torch.library.define, this schema doesn't take a
name (the name is a part of the qualname). We separated out the qualname
from the schema in the new APIs so that they're all consistent with each
other (they all accept the qualname separately).

Test Plan:
- new tests
Pull Request resolved: pytorch#111915
Approved by: https://github.com/suo, https://github.com/ezyang
ghstack dependencies: pytorch#111912
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
Summary:

Fixes pytorch#111926. The workflow is:
- create a blank file with the correct name
- run a test with PYTORCH_OPCHECK_ACCEPT=1

Test Plan:
- tested locally

Reviewers:

Subscribers:

Tasks:

Tags:
Pull Request resolved: pytorch#111948
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#111912, pytorch#111915
Skylion007 pushed a commit to Skylion007/pytorch that referenced this pull request Nov 14, 2023
…iant ops (pytorch#111933)

This PR:
- adds the pt2 compliant tag. This tag specifies that the operator works
  with the PT2 compilation APIs. A custom op author should test their
  ops with opcheck if they choose to add this tag.
- adds a config for Dynamo to allow only pt2 compliant ops into the
  graph and graph break on all other OpOverload/OpOverloadPacket.

Bikeshedding help wanted on the name of the tag. It should be easily
grep-able so we can set up rules for it.

Test Plan:
- new tests

Reviewers:

Subscribers:

Tasks:

Tags:

Pull Request resolved: pytorch#111933
Approved by: https://github.com/ezyang
ghstack dependencies: pytorch#111912, pytorch#111915, pytorch#111948
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants