KEMBAR78
[core IR] Add decomps for `aten.sum` and `aten.squeeze` variants by SS-JIA · Pull Request #110645 · pytorch/pytorch · GitHub
Skip to content

Conversation

@SS-JIA
Copy link
Contributor

@SS-JIA SS-JIA commented Oct 5, 2023

Summary:

Context

Both aten.sum and aten.squeeze have a "most generic" variant in the form of aten.sum.dim_IntList and aten.squeeze.dims respectively. Add decompositions for other non generic variants of these operators to express them using the most generic variant.

Note that to register these decomps, the reference implementation under _refs had to be removed as registered decompositions. cc: @lezcano @peterbell10

Test Plan: Github CI + Meta Internal CI

Differential Revision: D49965952

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @aakhundov @ColinPeppler

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 5, 2023

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit 382eeca with merge base 17348b0 (image):

UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:

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

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

SS-JIA pushed a commit to SS-JIA/pytorch that referenced this pull request Oct 5, 2023
…orch#110645)

Summary:

## Context

Both `aten.sum` and `aten.squeeze` have a "most generic" variant in the form of `aten.sum.dim_IntList` and `aten.squeeze.dims` respectively. Add decompositions for other non generic variants of these operators to express them using the most generic variant.

Note that to register these decomps, the reference implementation under `_refs` had to be removed as registered decompositions.

Test Plan: Github CI + Meta Internal CI

Differential Revision: D49965952
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

@SS-JIA
Copy link
Contributor Author

SS-JIA commented Oct 6, 2023

Updated to address comments.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

SS-JIA pushed a commit to SS-JIA/pytorch that referenced this pull request Oct 6, 2023
…orch#110645)

Summary:

## Context

Both `aten.sum` and `aten.squeeze` have a "most generic" variant in the form of `aten.sum.dim_IntList` and `aten.squeeze.dims` respectively. Add decompositions for other non generic variants of these operators to express them using the most generic variant.

Note that to register these decomps, the reference implementation under `_refs` had to be removed as registered decompositions.

Test Plan: Github CI + Meta Internal CI

Differential Revision: D49965952
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

Copy link
Collaborator

@lezcano lezcano left a comment

Choose a reason for hiding this comment

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

These two were already being decomposed by the ref. It's a bit annoying to have to factor them out into their own decompositions. I think a proper fix going forward would be to fix the issues with prims: Either make the usable (removing the broadcasting behaviour and dispatching them to the core ATen ops) or remove them completely. Otherwise, we are going to end up with plenty of these tiny decompositions, rather than the tighter all-in-one that we have implemented in refs.

cc @ezyang

…orch#110645)

Summary:

## Context

Both `aten.sum` and `aten.squeeze` have a "most generic" variant in the form of `aten.sum.dim_IntList` and `aten.squeeze.dims` respectively. Add decompositions for other non generic variants of these operators to express them using the most generic variant.

Note that to register these decomps, the reference implementation under `_refs` had to be removed as registered decompositions.

Test Plan: Github CI + Meta Internal CI

Reviewed By: manuelcandales

Differential Revision: D49965952
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49965952

@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 7, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

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.

7 participants