Skip to content

Conversation

@cpuhrsch
Copy link
Contributor

@cpuhrsch cpuhrsch commented Feb 22, 2019

This adds 88 matches.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Feb 22, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@cpuhrsch cpuhrsch changed the title [DRAFT] Use name for output variables instead of out in JIT Use name for output variables instead of out in JIT Feb 22, 2019
@zdevito
Copy link
Contributor

zdevito commented Feb 22, 2019

I am pretty sure that renaming line was necessary to make the out keyword-only argument work. It was added in this PR: https://github.com/pytorch/pytorch/pull/13093/files which adds support for that. It is possible it is no longer necessary if all the _out variants have renamed their output variable to out.

@cpuhrsch cpuhrsch changed the title Use name for output variables instead of out in JIT [DO NOT LAND] Use name for output variables instead of out in JIT Feb 22, 2019
@cpuhrsch
Copy link
Contributor Author

@zdevito - ok, it looks like it's worth digging deeper into this.

@cpuhrsch
Copy link
Contributor Author

The generated code changeset affects

        modified:   build/aten/src/ATen/Declarations.yaml
        modified:   torch/csrc/jit/generated/register_aten_ops_0.cpp
        modified:   torch/csrc/jit/generated/register_aten_ops_1.cpp
        modified:   torch/csrc/jit/generated/register_aten_ops_2.cpp

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 out as the output name as is required by the Python frontend.

@cpuhrsch cpuhrsch requested a review from zdevito February 22, 2019 19:07
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Contributor

Choose a reason for hiding this comment

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

here too.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

here too.

Copy link
Contributor

Choose a reason for hiding this comment

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

here too.

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

@cpuhrsch
Copy link
Contributor Author

This is the codegen changeset.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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
Copy link
Contributor

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.

@cpuhrsch cpuhrsch changed the title [DO NOT LAND] Use name for output variables instead of out in JIT Use name for output variables instead of out in JIT Feb 27, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a 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.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Feb 28, 2019
Summary:
This adds 88 matches.
Pull Request resolved: pytorch/pytorch#17386

Differential Revision: D14179139

Pulled By: cpuhrsch

fbshipit-source-id: 2c3263b8e4d084db84791e53290e8c8b1b7aecd5
facebook-github-bot pushed a commit that referenced this pull request Mar 12, 2019
Summary:
Stacked on top of #17386

Brings us to 1014/1106 of writing.
Pull Request resolved: #17385

Differential Revision: D14248008

Pulled By: cpuhrsch

fbshipit-source-id: 033e00de91e3edf7ae01ca03ebe436c0446b3b5c
zdevito pushed a commit to zdevito/ATen that referenced this pull request Mar 12, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants