-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Use name for output variables instead of out in JIT #17386
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
facebook-github-bot
left a comment
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.
@cpuhrsch has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
I am pretty sure that renaming line was necessary to make the |
|
@zdevito - ok, it looks like it's worth digging deeper into this. |
|
The generated code changeset affects but doesn't impact any Python functions. Since the JIT doesn't care about the names of keyword arguments, it looks like these functions aren't exposed via Python anyway. All other functions for which it matters are thus presumably already using |
facebook-github-bot
left a comment
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.
@cpuhrsch has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
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.
@cpuhrsch has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
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.
@cpuhrsch has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
here too.
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.
this looks weird -- output is an output in this case.
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.
here too.
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.
here too.
tools/jit/gen_jit_dispatch.py
Outdated
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.
can you clean this up?
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.
is this note correct? There are a bunch of cases with multiple output arguments that are Tensors AFAII.
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's determined above. typenames is of the same length as output_args and typename is set to be TensorList[len(typenames)] if that's longer than 1.
facebook-github-bot
left a comment
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.
@cpuhrsch has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
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.
@cpuhrsch has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
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.
@cpuhrsch has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
This is the codegen changeset. |
facebook-github-bot
left a comment
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.
@cpuhrsch has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
| change (e.g., you will probably need to update `tools/autograd/derivatives.yaml` at | ||
| least). For more details please see the section on `variants`. | ||
|
|
||
| As a convention we use 'out' to indicate an output argument. This aligns with the |
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.
nit: this message is a little strange. "This aligns with the Python bindings" is true, but the python bindings should be generated based on the schema here (and I think most would expect it is).
This also doesn't apply to operators with multiple output arguments.
"Check the generated code when making a change
to make sure you're not breaking the API when renaming an argument name of an
existing function."
this applies to any parameter you rename, not just output arguments.
facebook-github-bot
left a comment
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.
@cpuhrsch is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: This adds 88 matches. Pull Request resolved: pytorch/pytorch#17386 Differential Revision: D14179139 Pulled By: cpuhrsch fbshipit-source-id: 2c3263b8e4d084db84791e53290e8c8b1b7aecd5
Summary: Stacked on top of pytorch/pytorch#17386 Brings us to 1014/1106 of writing. Pull Request resolved: pytorch/pytorch#17385 Differential Revision: D14248008 Pulled By: cpuhrsch fbshipit-source-id: 033e00de91e3edf7ae01ca03ebe436c0446b3b5c
This adds 88 matches.