-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[torch.library] Add mechanism to add tags during define #111912
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
Conversation
We extend torch.library.Library.define and torch.library.define with a tags argument. Test Plan: - new test [ghstack-poisoned]
🔗 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 FailuresAs of commit 813df03 with merge base 28ebe5d ( 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]
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.
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. |
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.
A typical end user isn't going to know what "test the operator so the tag applies" means.
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.
Thanks for the feedback, I'll link the gdoc.
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.
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]
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
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
…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
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
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
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
…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
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
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
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
…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
Stack from ghstack (oldest at bottom):
We extend torch.library.Library.define and torch.library.define
with a tags argument.
Test Plan: