Skip to content

Conversation

EthanSteinberg
Copy link
Contributor

@EthanSteinberg EthanSteinberg commented Oct 11, 2019

The current embedding backwards CUDA kernel is somewhat broken. It effectively ignores padding_idx and also incorrectly drops an index from the input.

This commit fixes that bug and fixes the unit test so that this behavior won't break in the future.

This fixes #26302.

@pytorchbot pytorchbot added module: cuda Related to torch.cuda, and CUDA support in general module: nn Related to torch.nn module: operators labels Oct 11, 2019
The current embedding backwards cuda kernel is somewhat broken. It
effectively ignores padding_idx and also incorrectly drops an index from the input.

This commit fixes that bug and fixes the unit test so that this behavior
won't break in the future.
@EthanSteinberg
Copy link
Contributor Author

@bddppq Would it be possible for you to review this change or assign an appropriate reviewer? I think you were last person to review a change to the relevant CUDA kernel.

@soumith soumith requested review from ngimel and colesbury October 11, 2019 22:18
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.

@ngimel has imported 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 Oct 14, 2019
Summary:
The current embedding backwards CUDA kernel is somewhat broken. It effectively ignores padding_idx and also incorrectly drops an index from the input.

This commit fixes that bug and fixes the unit test so that this behavior won't break in the future.

This fixes pytorch/pytorch#26302.
Pull Request resolved: pytorch/pytorch#27731

Differential Revision: D17893803

Pulled By: ngimel

fbshipit-source-id: 4ba02a17ec0e29a7016d65480d4ff0c276550616
@facebook-github-bot
Copy link
Contributor

@ngimel merged this pull request in 848d1ba.

thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
Summary:
The current embedding backwards CUDA kernel is somewhat broken. It effectively ignores padding_idx and also incorrectly drops an index from the input.

This commit fixes that bug and fixes the unit test so that this behavior won't break in the future.

This fixes pytorch#26302.
Pull Request resolved: pytorch#27731

Differential Revision: D17893803

Pulled By: ngimel

fbshipit-source-id: 4ba02a17ec0e29a7016d65480d4ff0c276550616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged module: cuda Related to torch.cuda, and CUDA support in general module: nn Related to torch.nn
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradient for embedding vector at padding_idx is not zero when on GPU
5 participants