We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e48acd2 commit f13516dCopy full SHA for f13516d
src/lightning/fabric/utilities/seed.py
@@ -91,8 +91,9 @@ def pl_worker_init_function(worker_id: int, rank: Optional[int] = None) -> None:
91
92
"""
93
# implementation notes: https://github.com/pytorch/pytorch/issues/5059#issuecomment-817392562
94
+ assert "PL_GLOBAL_SEED" in os.environ, "`seed_everything(seed, workers=True)` must be called before training to use this function."
95
global_rank = rank if rank is not None else rank_zero_only.rank
- process_seed = torch.initial_seed()
96
+ process_seed = int(os.environ["PL_GLOBAL_SEED"])
97
# back out the base seed so we can use all the bits
98
base_seed = process_seed - worker_id
99
log.debug(
0 commit comments