Skip to content
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

fix embedding_backward_dense decomp with broadcasting #95499

Closed
wants to merge 3 commits into from

Conversation

bdhirsh
Copy link
Contributor

@bdhirsh bdhirsh commented Feb 24, 2023

Fixes #95182

cc @soumith @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire @ngimel for another decomp fix. For this one, I tried auditing the CPU and CUDA kernels for embedding_backward_dense and just could not figure out where the unsqueeze(1) was supposed to be coming from. In the failing example, our tensor shapes are (2, 4, 3) and (2, 4), and so I just assumed that the existing decomp had a typo - we should be unsqueezing the last dim, instead of dim index 1. That fixes the repro, and the existing decomp + meta tests appear to be passing.

Stack from ghstack (oldest at bottom):

cc @soumith @voznesenskym @yanboliang @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @desertfire

@pytorch-bot
Copy link

pytorch-bot bot commented Feb 24, 2023

🔗 Helpful Links

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

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

✅ No Failures

As of commit 4919634:
💚 Looks good so far! There are no failures yet. 💚

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

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

lgtm. It might be worth figuring out why the OpInfo inputs didn't exercise this.

Copy link
Collaborator

@ngimel ngimel left a comment

Choose a reason for hiding this comment

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

Yeah this is right, thanks for the fix @bdhirsh

Fixes #95182

cc ngimel for another decomp fix. For this one, I tried auditing the CPU and CUDA kernels for `embedding_backward_dense` and just could not figure out where the `unsqueeze(1)` was supposed to be coming from. In the failing example, our tensor shapes are `(2, 4, 3)` and `(2, 4)`, and so I just assumed that the existing decomp had a typo - we should be unsqueezing the last dim, instead of dim index 1. That fixes the repro, and the existing decomp + meta tests appear to be passing.




cc soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
bdhirsh added a commit that referenced this pull request Feb 24, 2023
ghstack-source-id: dfea7c497fde1ad0c3030bc7bc6fe6e790de8954
Pull Request resolved: #95499
@bdhirsh bdhirsh added the release notes: composability release notes category label Feb 27, 2023
Fixes #95182

cc soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire ngimel for another decomp fix. For this one, I tried auditing the CPU and CUDA kernels for `embedding_backward_dense` and just could not figure out where the `unsqueeze(1)` was supposed to be coming from. In the failing example, our tensor shapes are `(2, 4, 3)` and `(2, 4)`, and so I just assumed that the existing decomp had a typo - we should be unsqueezing the last dim, instead of dim index 1. That fixes the repro, and the existing decomp + meta tests appear to be passing.




cc soumith voznesenskym yanboliang penguinwu anijain2305 EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng Xia-Weiwen wenzhe-nrv jiayisunx desertfire

[ghstack-poisoned]
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 5, 2023
cyyever pushed a commit to cyyever/pytorch_private that referenced this pull request Mar 27, 2023
pruthvistony added a commit to ROCm/pytorch that referenced this pull request May 2, 2023
@facebook-github-bot facebook-github-bot deleted the gh/bdhirsh/384/head branch June 8, 2023 15:46
jhavukainen pushed a commit to kulinseth/pytorch that referenced this pull request Mar 15, 2024
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.

None yet

4 participants