Fixes bug preventing early stopping from exiting the training loop when not running in distributed mode (issue 1384)#1502
Open
richardtomsett wants to merge 2 commits into
Conversation
…g loop when not running in distributed mode (issue 1384), and adds a regression test
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue 1384 describes a bug where early stopping fails to stop the training loop when distributed training is not enabled. The bug appears to have been introduced in this PR, which updated
mace/tools/train.pyso that all ranks exit from the training loop correctly ifpatienceis exceeded. In addressing this issue, the PR introduced a bug that meant the training loop never checks correctly forpatiencebeing exceeded when not running in distributed mode.This is a minimal fix that ensures patience being exceeded exits the loop in serial mode, and adds a test.
I've tested this locally on my laptop with a small training run with
--max_num_epochs=10000and--patience=1, and the training loop correctly exits due to patience being exceeded:NB I have not tested this in distributed training mode on a machine with a GPU.