Skip to content

Implement a Caffe2 standalone LSTM operator (#17461)#17725

Closed
houseroad wants to merge 1 commit intopytorch:masterfrom
houseroad:export-D14351575
Closed

Implement a Caffe2 standalone LSTM operator (#17461)#17725
houseroad wants to merge 1 commit intopytorch:masterfrom
houseroad:export-D14351575

Conversation

@houseroad
Copy link
Member

Summary:
Pull Request resolved: #17461

Implementing a standalone LSTM Operator in Caffe2 adopted from this Aten implementation: diffusion/FBS/browse/master/fbcode/caffe2/aten/src/ATen/native/RNN.cpp. The most tricky thing in this exercise was that caffe2::Tensor has no copy constructor that made it necessary to implement a custom templated copy constructor for the different Tensor containers used in the code. Also there was no way to use off-the-shelf C2 operators in my code easily so I had to copy some code that is doing basic matmul, cat, split, transpose and linear as utility functions.

Two things missing:

  • Profiling this implementation against the current ONNXified LSTM op
  • Make this operator available to use in PyTorch

Differential Revision: D14351575

Summary:
Pull Request resolved: pytorch#17461

Implementing a standalone LSTM Operator in Caffe2 adopted from this Aten implementation: diffusion/FBS/browse/master/fbcode/caffe2/aten/src/ATen/native/RNN.cpp. The most tricky thing in this exercise was that caffe2::Tensor has no copy constructor that made it necessary to implement a custom templated copy constructor for the different Tensor containers used in the code. Also there was no way to use off-the-shelf C2 operators in my code easily so I had to copy some code that is doing basic matmul, cat, split, transpose and linear as utility functions.

Two things missing:

- Profiling this implementation against the current ONNXified LSTM op
- Make this operator available to use in PyTorch

Differential Revision: D14351575

fbshipit-source-id: 4a2d39559c02f3f0182f4a640e9729995bfb5767
@houseroad houseroad closed this Mar 7, 2019
@houseroad houseroad deleted the export-D14351575 branch March 7, 2019 01:11
facebook-github-bot pushed a commit that referenced this pull request Mar 7, 2019
Summary:
Pull Request resolved: #17726

Pull Request resolved: #17725

Pull Request resolved: #17461

Implementing a standalone LSTM Operator in Caffe2 adopted from this Aten implementation: diffusion/FBS/browse/master/fbcode/caffe2/aten/src/ATen/native/RNN.cpp. The most tricky thing in this exercise was that caffe2::Tensor has no copy constructor that made it necessary to implement a custom templated copy constructor for the different Tensor containers used in the code. Also there was no way to use off-the-shelf C2 operators in my code easily so I had to copy some code that is doing basic matmul, cat, split, transpose and linear as utility functions.

Two things missing:

- Profiling this implementation against the current ONNXified LSTM op
- Make this operator available to use in PyTorch

Reviewed By: dzhulgakov

Differential Revision: D14351575

fbshipit-source-id: 3b99b53212cf593c7a49e45580b5a07b90809e64
@ezyang ezyang added the merged label Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants