-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Moved Autograd Fallback Interface to Header for Use by Out-of-tree Backends #159639
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
base: gh/fffrog/129/base
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/159639
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 52c5b69 with merge base ff0d56d ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "topic: not user facing" |
@pytorchbot label "topic: not user facing" |
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.
Will let @soulitzer review this one
Thank you. |
So sorry to you @soulitzer, could you help to take a look at this? |
Sorry for the delay @FFFrog, I just returned from PTO Anyhow we probably don't want to expose the macro in the header, and instead just the function declaration |
Thank you for your reply :D
Okay, here's the snippet: pytorch/test/cpp_extensions/open_registration_extension/torch_openreg/csrc/aten/OpenRegExtra.cpp Lines 160 to 162 in df07a46
New accelerators maybe want to add forward functions for new operators, so it would be convenient if we could expose |
Thanks for the context! btw, we do already have fallback APIs exposed in torch/csrc/autograd/autograd_not_implemented_fallback.h.
What this PR exposes is a wrapper on top of the latter API, that has another of layer of indirection handling the case where the particular build of PyTorch does not have autograd. It's probably fine to expose the version (with better naming, and after collocating the wrapper next to the other APIs), but I wonder if the existing APIs already work for your case @FFFrog? |
Stack from ghstack (oldest at bottom):
As the title stated.
The new backend located in out-of-tree need to add custom operators as well,
so alse need to implemet autograd fallback.