Skip to content

Commit

Permalink
Expose DistributedSampler RNG seed argument (#3724)
Browse files Browse the repository at this point in the history
  • Loading branch information
janEbert authored Nov 28, 2024
1 parent 62017d2 commit 23e6a2e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions composer/utils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ def get_sampler(
shuffle: bool = False,
num_replicas: Optional[int] = None,
rank: Optional[int] = None,
seed: int = 0,
):
"""Constructs a :class:`~torch.utils.data.distributed.DistributedSampler` for a dataset.
Expand Down Expand Up @@ -620,6 +621,7 @@ def get_sampler(
shuffle=shuffle,
num_replicas=get_world_size() if num_replicas is None else num_replicas,
rank=get_global_rank() if rank is None else rank,
seed=seed,
)


Expand Down

0 comments on commit 23e6a2e

Please sign in to comment.