Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Megatron-LM
Commits
5cb0c807
Commit
5cb0c807
authored
May 05, 2020
by
Raul Puri
Browse files
more documentation for batch sampler
parent
26d6aff4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
megatron/data/samplers.py
megatron/data/samplers.py
+4
-1
No files found.
megatron/data/samplers.py
View file @
5cb0c807
...
@@ -82,7 +82,10 @@ class DistributedBatchSampler(data.sampler.BatchSampler):
...
@@ -82,7 +82,10 @@ class DistributedBatchSampler(data.sampler.BatchSampler):
(sequential, random, WeightedRandomSampler, etc.) with this batch
(sequential, random, WeightedRandomSampler, etc.) with this batch
sampler.
sampler.
The `interleave` argument specifies how to distribute a batch.
The `interleave` argument specifies how to distribute a batch. A value
of True combined with the above random sampler is equivalent to pytorch's
torch.utils.data.distributed.DistributedSampler.
For the following batch [0,1,2,3,4,5,6,7] and data parallelism of 2
For the following batch [0,1,2,3,4,5,6,7] and data parallelism of 2
specifying True will result in the following samples for each gpu:
specifying True will result in the following samples for each gpu:
GPU0: [0,2,4,6] GPU1: [1,3,5,7]
GPU0: [0,2,4,6] GPU1: [1,3,5,7]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment