Skip to content

Conversation

@apaszke
Copy link
Contributor

@apaszke apaszke commented Aug 7, 2018

As in the title. I also did a small refactor that let us loose almost 400 loc. This is a first step in moving the RNN code to C++.

@apaszke
Copy link
Contributor Author

apaszke commented Aug 7, 2018

cc @csarofeen (author of the kernels)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ezyang
Copy link
Contributor

ezyang commented Aug 7, 2018

Can we get a billing of changes?

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@apaszke
Copy link
Contributor Author

apaszke commented Aug 7, 2018

Summary of changes:

  1. Kernel changes
  • Gradients are now optional (can be nullptr) in the backward LSTM kernel. This lets us avoid allocating a zero-filled tensor in backward.
  • Changed slightly how the indexing works (ATen's TensorInfo doesn't match 100% with THC's). Biases should always be 1D, all other tensors are either 2D, or are flattened to their 1D views when they are contiguous
  1. Dispatch code changes
  • We only instantiate 2 specializations for every kernel now (we created 4 previously)
  • Dispatch code relies on templates entirely now
  • Abstracted certain duplicated patterns into helper functions
  • Used more verbose names for variables

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@ezyang
Copy link
Contributor

ezyang commented Aug 7, 2018

This all seems basically fine. I didn't approve it yet because I want docs on NEVER_SKIP, everything else is optional.

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.

apaszke 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 Aug 10, 2018
Summary:
As in the title. I also did a small refactor that let us loose almost 400 loc. This is a first step in moving the RNN code to C++.
Pull Request resolved: pytorch/pytorch#10305

Reviewed By: ezyang

Differential Revision: D9196227

Pulled By: apaszke

fbshipit-source-id: 54da905519aade29baa63ab1774a3ee1db5663ba
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
Summary:
As in the title. I also did a small refactor that let us loose almost 400 loc. This is a first step in moving the RNN code to C++.
Pull Request resolved: pytorch#10305

Reviewed By: ezyang

Differential Revision: D9196227

Pulled By: apaszke

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

4 participants