Skip to content

Conversation

swolchok
Copy link
Contributor

@swolchok swolchok commented Aug 22, 2025

[ghstack-poisoned]
Copy link

pytorch-bot bot commented Aug 22, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161240

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 75fa587 with merge base a85711d (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

swolchok added a commit that referenced this pull request Aug 22, 2025
get_write_alias() call count reduction explained briefly in code comment.

We don't need to check write_aliases against None in the final outs_to_return calculation because we just did that check.


ghstack-source-id: 8560549
Pull-Request: #161240
@swolchok swolchok requested review from bdhirsh and jingsh August 22, 2025 03:18
@swolchok swolchok added the topic: not user facing topic category label Aug 22, 2025
[ghstack-poisoned]
swolchok added a commit that referenced this pull request Aug 22, 2025
get_write_alias() call count reduction explained briefly in code comment.

We don't need to check write_aliases against None in the final outs_to_return calculation because we just did that check.


ghstack-source-id: 16ae73c
Pull-Request: #161240
…aliasing"

get_write_alias() call count reduction explained briefly in code comment.

We don't need to check write_aliases against None in the final outs_to_return calculation because we just did that check.

[ghstack-poisoned]
…aliasing"

get_write_alias() call count reduction explained briefly in code comment.

We don't need to check write_aliases against None in the final outs_to_return calculation because we just did that check.

[ghstack-poisoned]
if not all(x is not None for x in schema_info_outs_write_aliases):
raise RuntimeError("Unsupported schema: " + str(func._schema))

if len(func._schema.returns) == 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you change this line? it may indeed be the same length as schema_info_outs_write_aliases but this doesn't seem clearly perf motivated and i'm not actually sure they are the same

Copy link
Contributor

Choose a reason for hiding this comment

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

this seems ok upon closer look

Copy link
Contributor Author

Choose a reason for hiding this comment

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

func._schema.returns is a pybind; accessing it will cost more than the alternative

@pytorchmergebot
Copy link
Collaborator

Starting merge as part of PR stack under #161285

pytorchmergebot pushed a commit that referenced this pull request Aug 25, 2025
…ly_alias_match (#161284)

Containers are truthy iff they're non-empty.
Pull Request resolved: #161284
Approved by: https://github.com/Skylion007, https://github.com/wconstab
ghstack dependencies: #161231, #161234, #161235, #161240
pytorchmergebot pushed a commit that referenced this pull request Aug 25, 2025
Drives down the overhead of return_and_correct_storage_aliasing slightly. Hopefully you'll agree it doesn't compromise readability.
Pull Request resolved: #161285
Approved by: https://github.com/wconstab
ghstack dependencies: #161231, #161234, #161235, #161240, #161284
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…ytorch#161240)

get_write_alias() call count reduction explained briefly in code comment.

We don't need to check write_aliases against None in the final outs_to_return calculation because we just did that check.
Pull Request resolved: pytorch#161240
Approved by: https://github.com/wconstab
ghstack dependencies: pytorch#161231, pytorch#161234, pytorch#161235
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
markc-614 pushed a commit to markc-614/pytorch that referenced this pull request Sep 17, 2025
…#161285)

Drives down the overhead of return_and_correct_storage_aliasing slightly. Hopefully you'll agree it doesn't compromise readability.
Pull Request resolved: pytorch#161285
Approved by: https://github.com/wconstab
ghstack dependencies: pytorch#161231, pytorch#161234, pytorch#161235, pytorch#161240, pytorch#161284
@github-actions github-actions bot deleted the gh/swolchok/791/head branch September 25, 2025 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants