Add TF32 flags + general improvements in DDP backend#2682
Merged
Conversation
…d even with an exception being raised
Adel-Moumen
commented
Sep 13, 2024
Collaborator
Author
|
After some checks, I confirm that DDP works in multinodes and mononode on Compute Canada. (which was the case but this PR doesn't introduce regression on DDP.) |
pplantinga
approved these changes
Sep 13, 2024
13 tasks
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.
What does this PR do?
This PR tries to improve our DDP backend. Most of the changes tries to improve some corner case of SpeechBrain.
List of additions/modifications:
__enter__and__exit__which makes sure thatMAIN_PROC_ONLYis always increased/decreased even when a sub-function is throwing an exception (which in the past could lead to an issue).collect_files(). Indeed, in DDP you expect to see insave/a symlink of your pre-trained model. This indeed, led to an issue where only the main proc could load the LM while the other processes where throwing an error because they couldn't load the collected models. One effective solution was to turninternal_ddp_handlingflag toTruebut it is not necessary asrun_on_maindoes also work on a system that is not distributed.get_loggerfunction as a drop-in replacement tologger.get_logger. The key idea here is to have the possibility to choose if we want to log on all the processes or only the main proc. Generally speaking, we only want the main proc to log informations (e.g. loading of ckpts etc), in some cases likeseed_everythingyou would like to know the seed for each proc but these are corner case which can be solved by just passingmain_process_only=False. This new logger leaves us also the possibility to only emit one warning as wanted in some previous PRs.NCCL.Before submitting
PR review
Reviewer checklist