Skip to content

Commit c127458

Browse files
authored
Update seed.py
1 parent e9127f4 commit c127458

File tree

1 file changed

+1
-5
lines changed
  • src/lightning/fabric/utilities

1 file changed

+1
-5
lines changed

src/lightning/fabric/utilities/seed.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@ def pl_worker_init_function(worker_id: int, rank: Optional[int] = None) -> None:
9292
"""
9393
# implementation notes: https://github.com/pytorch/pytorch/issues/5059#issuecomment-817392562
9494
global_rank = rank if rank is not None else rank_zero_only.rank
95-
env_seed = os.environ.get("PL_GLOBAL_SEED", None)
96-
if env_seed is None:
97-
env_seed = "0"
98-
rank_zero_warn(f"No seed found, worker seed set to {env_seed}")
99-
process_seed = int(env_seed)
95+
process_seed = torch.initial_seed()
10096
# back out the base seed so we can use all the bits
10197
base_seed = process_seed - worker_id
10298
log.debug(

0 commit comments

Comments
 (0)