- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3.6k
 
          Fix _should_reload_dl_epoch causing inconsistent validation dataloader reloading
          #11036
        
          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
          
     Merged
      
      
            awaelchli
  merged 11 commits into
  Lightning-AI:master
from
adamviola:bugfix/inconsistent-dl-reloading
  
      
      
   
  Dec 28, 2021 
      
    
                
     Merged
            
            
  
    Fix _should_reload_dl_epoch causing inconsistent validation dataloader reloading
  
  #11036
              
                    awaelchli
  merged 11 commits into
  Lightning-AI:master
from
adamviola:bugfix/inconsistent-dl-reloading
  
      
      
   
  Dec 28, 2021 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    95ac137    to
    123984d      
    Compare
  
    _should_reload_dl_epoch causing inconsistent validation dataloa…_should_reload_dl_epoch causing inconsistent validation dataloader reloading
      
              
                    carmocca
  
              
              approved these changes
              
                  
                    Dec 13, 2021 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
              
                    awaelchli
  
              
              reviewed
              
                  
                    Dec 14, 2021 
                  
              
              
            
            
for more information, see https://pre-commit.ci
0300720    to
    1df1282      
    Compare
  
    
              
                    awaelchli
  
              
              reviewed
              
                  
                    Dec 21, 2021 
                  
              
              
            
            
              
                    tchaton
  
              
              approved these changes
              
                  
                    Dec 21, 2021 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice contribution!
Co-authored-by: thomas chaton <[email protected]>
              
                    Borda
  
              
              approved these changes
              
                  
                    Dec 21, 2021 
                  
              
              
            
            
              
                    awaelchli
  
              
              approved these changes
              
                  
                    Dec 28, 2021 
                  
              
              
            
            
    
  awaelchli 
      added a commit
      that referenced
      this pull request
    
      Jan 4, 2022 
    
    
      
  
    
      
    
  
…der reloading (#11036) Co-authored-by: Adam Viola <@adamviola> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: thomas chaton <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
    
  awaelchli 
      added a commit
      that referenced
      this pull request
    
      Jan 4, 2022 
    
    
      
  
    
      
    
  
…der reloading (#11036) Co-authored-by: Adam Viola <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: thomas chaton <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
    
  awaelchli 
      added a commit
      that referenced
      this pull request
    
      Jan 5, 2022 
    
    
      
  
    
      
    
  
…der reloading (#11036) Co-authored-by: Adam Viola <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: thomas chaton <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
    
  awaelchli 
      added a commit
      that referenced
      this pull request
    
      Jan 5, 2022 
    
    
      
  
    
      
    
  
…der reloading (#11036) Co-authored-by: Adam Viola <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: thomas chaton <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
    
  awaelchli 
      added a commit
      that referenced
      this pull request
    
      Jan 5, 2022 
    
    
      
  
    
      
    
  
…der reloading (#11036) Co-authored-by: Adam Viola <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: thomas chaton <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
    
  lexierule 
      pushed a commit
      that referenced
      this pull request
    
      Jan 5, 2022 
    
    
      
  
    
      
    
  
…der reloading (#11036) Co-authored-by: Adam Viola <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: thomas chaton <[email protected]> Co-authored-by: Adrian Wälchli <[email protected]>
      
        
      
      
  
    12 tasks
  
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
What does this PR do?
Fixes #10948
When the flag
reload_dataloaders_every_n_epochsis set, PyTorch Lightning reloads dataloaders on epochs that are multiples ofreload_dataloaders_every_n_epochs. This causes inconsistent validation dataloader reloading when the flagscheck_val_every_n_epochorval_check_intervalare set.This PR now has the trainer store the epoch of the last reload of the train and validation dataloaders. Each dataloader is now eligible to reload when
current_epoch-dl_last_reload_epoch>=reload_dataloaders_every_n_epochs.Does your PR introduce any breaking changes? If yes, please list them.
No
Before submitting
PR review
Anyone in the community is welcome to review the PR.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Actually yes