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

tracks all outputs including TBPTT and multiple optimizers #2890

Merged
merged 21 commits into from
Aug 9, 2020

Conversation

williamFalcon
Copy link
Contributor

@williamFalcon williamFalcon commented Aug 8, 2020

Enables behavior that was previously not possible:

  • passes the outputs of every time step back to the user for epoch_end hooks and for each optimizer in training.
  • also enables auto-reduce and auto-padding when using a Result object

Finishes #2354
Fixes #2320

@mergify mergify bot requested a review from a team August 8, 2020 18:43
@pep8speaks
Copy link

pep8speaks commented Aug 8, 2020

Hello @williamFalcon! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-08-09 02:51:37 UTC

@codecov
Copy link

codecov bot commented Aug 9, 2020

Codecov Report

Merging #2890 into master will increase coverage by 0%.
The diff coverage is 93%.

@@          Coverage Diff           @@
##           master   #2890   +/-   ##
======================================
  Coverage      90%     90%           
======================================
  Files          79      79           
  Lines        7236    7328   +92     
======================================
+ Hits         6530    6617   +87     
- Misses        706     711    +5     

@williamFalcon williamFalcon changed the title [WIP] tracks all outputs including TBPTT and multiple optimizers tracks all outputs including TBPTT and multiple optimizers Aug 9, 2020
@williamFalcon williamFalcon merged commit 256059a into master Aug 9, 2020
@Borda Borda deleted the all_train_outs branch August 9, 2020 10:30
@Borda Borda added the feature Is an improvement or enhancement label Aug 9, 2020
Comment on lines +636 to +640
try:
sample_obj = opt_idx_outputs[0][0] if isinstance(opt_idx_outputs[0], list) else opt_idx_outputs[0]
is_result_obj = len(epoch_output) > 0 and isinstance(sample_obj, Result)
except IndexError as e:
is_result_obj = False
Copy link
Contributor

@awaelchli awaelchli Aug 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@williamFalcon I believe this can be improved. The problem I see here is that, if anywhere else, for example in Result, an IndexError occurs then it will propagate to here and be treated wrongly. I highly recommend not to use exception handling for these types of control flow problems, as it can make debugging a lot more painful searching for the real origin. See also #2266

@mergify mergify bot requested a review from a team August 9, 2020 21:11
@Borda Borda added this to the 0.9.0 milestone Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Partially missing training_step outputs in training_epoch_end
4 participants