Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move backwards step into model #64

Open
jensheit opened this issue Sep 18, 2020 · 1 comment
Open

Move backwards step into model #64

jensheit opened this issue Sep 18, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jensheit
Copy link
Member

jensheit commented Sep 18, 2020

In case of multiple chained models for example source separation + speech recognition it might be necessary to do intermediate backwards steps to reduce the required gpu memory during training.
The user could be enabled to use mulitple backwards steps by moving the backwards step and the train_step into the model.

However, we have to consider the implications for the Hook post_step, which is at the moment called after train_step but before the backwards step.

Another open question is how to handle the timer information.

@jensheit jensheit added the enhancement New feature or request label Sep 18, 2020
@boeddeker
Copy link
Member

However, we have to consider the implications for the Hook post_step, which is at the moment called after train_step but before the backwards step.

This is currently done to decrease the memory consumption (i.e. after the post step we can delete the input, and the review).


Another point to consider is, that the multi gpu source code must be changed.
I don't know if calling backward in a thread is allowed and recommended in pytorch.


I would say, we plan to implement it, when we see a demand for it.


A possible workaround (for those that need it now):

  • Use single GPU
  • Just call backward inside the model
  • Return the last loss and the trainer calls backward on this loss

The code wouldn't be pretty, but it should do the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants