Skip to content

Future-proofing Embedding.cu against heuristic changes#9851

Closed
mcarilli wants to merge 0 commit intopytorch:masterfrom
mcarilli:master
Closed

Future-proofing Embedding.cu against heuristic changes#9851
mcarilli wants to merge 0 commit intopytorch:masterfrom
mcarilli:master

Conversation

@mcarilli
Copy link
Collaborator

Currently, the heuristic in aten/native/cuda/Embedding.cu only chooses my embedding_backward_feature_kernel if ntokens <= 768.

@FDecaYed pointed out that my bounds checking logic fails if the kernel is launched with ntokens > 1024. Currently, this never occurs, but this PR applies his fix so that the kernel does support ntokens > 1024, allowing the "768" heuristic to be adjusted in the future without breaking anything.

THCUNN/LookupTable.cu uses the same kernel, with the same heuristic. I didn't apply the fix here because I strongly suspect this is dead code (at least, I was unable to find a Python-side exposure for it). Do you mind if we attempt stripping this file out, as a separate PR?

@mcarilli mcarilli changed the title Future-proofing embedding.py against heuristic changes Future-proofing Embedding.cu against heuristic changes Jul 26, 2018
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.

weiyangfb has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@ssnl
Copy link
Collaborator

ssnl commented Aug 21, 2018

@pytorchbot retest this please

@weiyangfb
Copy link
Contributor

@mcarilli Sorry I was trying to rebase your PR but accidentally had it deleted. I created a new PR here: #10959. Let me know if there is anything question/comment.

@mcarilli
Copy link
Collaborator Author

No worries, as long as the changes make it in eventually.

facebook-github-bot pushed a commit that referenced this pull request Aug 28, 2018
Summary:
- rebase of #9851
Pull Request resolved: #10959

Differential Revision: D9542292

Pulled By: weiyangfb

fbshipit-source-id: ce51864d203c8ed89da3817f1da020a0ee932960
zdevito pushed a commit to zdevito/ATen that referenced this pull request Aug 28, 2018
Summary:
- rebase of pytorch/pytorch#9851
Pull Request resolved: pytorch/pytorch#10959

Differential Revision: D9542292

Pulled By: weiyangfb

fbshipit-source-id: ce51864d203c8ed89da3817f1da020a0ee932960
PenghuiCheng pushed a commit to PenghuiCheng/pytorch that referenced this pull request Sep 11, 2018
Summary:
- rebase of pytorch#9851
Pull Request resolved: pytorch#10959

Differential Revision: D9542292

Pulled By: weiyangfb

fbshipit-source-id: ce51864d203c8ed89da3817f1da020a0ee932960
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.

6 participants