-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add utils.set_determinism for reproducibility (#576)
This PR: 1 - adds a set_determinism function to set seed for Python, PyTorch, CUDA and deterministic settings for cudnn. 2 - if seed is None, then no deterministic settings are used. This may be important as turning off cuDnn benchmarking to ensure determinism, can also negatively impact perf. 3 - note that for the None case, we revert / ensure cudnn is set back to non-deterministic and benchmarking/tuning in case people are toggling. This lack of determinism negatively impacted work with AWS where we ended up with variations in loss curves while running fp8 for our joint blog that appeared to be from fp8 but are instead likely due to not having determinism in titan. Testing - I ran multiple small runs with 7B while rotating between three seeds and saw consistent ending loss points matching to the respective seeds. This PR does not set per worker aspects for the dataloader since we do not shuffle atm...but that could become a future source of randomness that will need to be set if we shuffle in the future.
- Loading branch information
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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