Skip to content
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

Only do meta registrations if we have the ops #7500

Merged
merged 4 commits into from
Apr 7, 2023

Conversation

ezyang
Copy link
Contributor

@ezyang ezyang commented Apr 5, 2023

Fixes #7472

Signed-off-by: Edward Z. Yang ezyang@meta.com

Signed-off-by: Edward Z. Yang <ezyang@meta.com>
@pytorch-bot
Copy link

pytorch-bot bot commented Apr 5, 2023

🔗 Helpful Links

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

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 Failures

As of commit 7a58ba1:

NEW FAILURES - The following jobs have failed:

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

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

One Q below but LGTM (after lint job is fixed), thanks @ezyang


def register_meta(op):
def wrapper(fn):
_meta_lib.impl(op, fn)
Copy link
Member

@NicolasHug NicolasHug Apr 6, 2023

Choose a reason for hiding this comment

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

I assume it wouldn't be enough to only put the if torchvision.extension._has_ops(): block as below? (instead of protecting the entire file in the if... block)

Suggested change
_meta_lib.impl(op, fn)
if torchvision.extension._has_ops():
_meta_lib.impl(op, fn)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately not, because I directly access torch.ops.torchvision to program the decorator. I guess I could stringify register_meta to avoid this.

Signed-off-by: Edward Z. Yang <ezyang@meta.com>
@ezyang
Copy link
Contributor Author

ezyang commented Apr 6, 2023

OK, did a stringy strategy

ezyang added 2 commits April 6, 2023 11:52
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
@ezyang ezyang merged commit 1c4f0c4 into pytorch:main Apr 7, 2023
@github-actions
Copy link

github-actions bot commented Apr 7, 2023

Hey @ezyang!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

@NicolasHug NicolasHug added other if you have no clue or if you will manually handle the PR in the release notes module: ops labels Apr 11, 2023
facebook-github-bot pushed a commit that referenced this pull request Apr 24, 2023
Summary: Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Reviewed By: vmoens

Differential Revision: D45183661

fbshipit-source-id: 808a5d461b4217e7a00295675311fedd99e3d23a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed module: ops other if you have no clue or if you will manually handle the PR in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: '_OpNamespace' 'torchvision' object has no attribute 'roi_align'
3 participants