Skip to content

[pull] master from pytorch:master#24

Merged
pull[bot] merged 3 commits intopeterjc123:masterfrom
pytorch:master
Sep 26, 2019
Merged

[pull] master from pytorch:master#24
pull[bot] merged 3 commits intopeterjc123:masterfrom
pytorch:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Sep 26, 2019

See Commits and Changes for more details.


Created by pull[bot]. Want to support this open source service? Please star it : )

Natalia Gimelshein and others added 3 commits September 25, 2019 17:38
Summary:
An attempt to enable double backward for non-cudnn LSTM and GRU (see #25315, #20449). RNN works already because it does not rely on fused kernels.
This does not implement double backward function itself, because that is pretty hard to spell out. Instead, it implements backward using differentiable operations, so that double backward can be done automatically.
The good: seems to work, no effect on performance on the usual case without double backward. because fused lstm backward is used.
The bad: Performance of backward and, especially, double backward, is pretty bad. Scripting would still be a preferred way if we want a performant solution. Performance and/or memory use can be slightly improved if in-place variants can be used for sigmoid_backward and tanh_backward to avoid cat in the end, but I'm not yet sure it's possible, and in any case it is only slight improvement.
The ugly: I could not figure out a way to reuse workspace that contains the sum of the gates with the applied sigmoid and tanh operations, so that's probably another perf and memory hit.
cc soumith, albanD. If you think this approach is viable, I can extend to GRU and RNN.
Thanks to mcarilli whose approach to double backward in weight norm I copied.
Pull Request resolved: #26660

Test Plan: added tests to check gradgrad for GRU and LSTM with cudnn disabled.

Differential Revision: D17581489

Pulled By: ngimel

fbshipit-source-id: efd204289e9a0e94d94896a0b3bff5cf6246cafa
Summary:
#24604
Pull Request resolved: #26481

Differential Revision: D17489859

Pulled By: ifedan

fbshipit-source-id: 0702044c7c0f78e5e30826e8a5a83da27156bdb3
Summary: Pull Request resolved: #26855

Test Plan: Imported from OSS

Differential Revision: D17589837

Pulled By: IvanKobzarev

fbshipit-source-id: 0084538e9b9d760a8728cdcd5723fc7fae5838c7
@pull pull Bot added the ⤵️ pull label Sep 26, 2019
@pull pull Bot merged commit ed82a28 into peterjc123:master Sep 26, 2019
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.

2 participants