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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

primTorch: support refs and decompositions when ATen and Python disagree #83931

Open
nkaretnikov opened this issue Aug 23, 2022 · 1 comment
Open
Labels
module: primTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@nkaretnikov
Copy link
Collaborator

nkaretnikov commented Aug 23, 2022

馃悰 Describe the bug

  1. Policy (related): We need to agree on how to handle refs/decomps like binary_cross_entropy where the ATen op and the Python frontend have different number/type of arguments. Right now, binary_cross_entropy just defines a decomp. Do we want to split the ref/decomp implementations for these (with a shared core/conversion logic) or handle in some other way?

  2. Bug: if register_decomposition is used with ops like these to define one Python function that's both registered as a ref and a decomp, there are no type signature checks in register_decomposition to catch this. So it'll just run and we might not notice unless it breaks for some other reason.

I have a demo branch with this issue here, see the commit message and notes in the topmost commit:
https://github.com/nkaretnikov/pytorch/commits/primtorch-l1-loss-decomp-ref-compat-issue

Versions

master (e0f2eba)

cc @ezyang @mruberry @ngimel

@ezyang
Copy link
Contributor

ezyang commented Aug 23, 2022

The aten decomp is higher priority. You can write the ref in terms of the aten decomp, but I don't think it is that important to do.

@ngimel ngimel added module: primTorch triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: primTorch 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

3 participants