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

Deprecate unsupported types in operator registration #124863

Open
zou3519 opened this issue Apr 24, 2024 · 1 comment
Open

Deprecate unsupported types in operator registration #124863

zou3519 opened this issue Apr 24, 2024 · 1 comment
Labels
high priority module: custom-operators custom operators, custom ops, custom-operators, custom-ops module: pt2-dispatcher PT2 dispatcher-related issues (e.g., aotdispatch, functionalization, faketensor, custom-op, months oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@zou3519
Copy link
Contributor

zou3519 commented Apr 24, 2024

We support some weird types:

import torch
lib = torch.library.Library("mylib", "FRAGMENT")
lib.define("foo(Tensor[][][][] x) -> Tensor")

PyTorch does not give full support for this type; for example, the dispatcher will just ignore x when dispatching.

We should:

  1. identify an acceptable list of input/output types for custom ops and put it somewhere as the source of truth. torchgen may have this already; export has their own list: https://github.com/pytorch/pytorch/blob/main/torch/_export/serde/schema.py#L155
  2. deprecate registering operators that are not of this type.

cc @ezyang @gchanan @kadeng @msaroufim @bdhirsh @anijain2305 @chauhang

@zou3519 zou3519 added high priority module: pt2-dispatcher PT2 dispatcher-related issues (e.g., aotdispatch, functionalization, faketensor, custom-op, labels Apr 24, 2024
@zou3519 zou3519 added module: custom-operators custom operators, custom ops, custom-operators, custom-ops oncall: pt2 labels Apr 24, 2024
@zou3519
Copy link
Contributor Author

zou3519 commented Apr 24, 2024

Hi-pri because people run into this pretty often and get confused about why it doesn't work.

@xmfan xmfan added triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module and removed triage review labels May 21, 2024
@zou3519 zou3519 added the months label Jun 20, 2024
@zou3519 zou3519 removed their assignment Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority module: custom-operators custom operators, custom ops, custom-operators, custom-ops module: pt2-dispatcher PT2 dispatcher-related issues (e.g., aotdispatch, functionalization, faketensor, custom-op, months oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants