Add shuffle_after_epoch_seed argument to file-based readers.#6236
Add shuffle_after_epoch_seed argument to file-based readers.#6236JanuszL merged 2 commits intoNVIDIA:mainfrom
Conversation
|
!build |
|
CI MESSAGE: [44956153]: BUILD FAILED |
Greptile SummaryThis PR adds configurable per-epoch shuffle seeding to file-based readers, addressing the limitation where all training runs used identical shuffle patterns. The implementation consistently adds an optional Key changes:
Assessment: Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 4445fea |
c2311b0 to
7c24cd6
Compare
* Adds an optional `shuffle_after_epoch_seed` (int32) argument to all readers that support `shuffle_after_epoch`: readers.file, readers.numpy, readers.fits, readers.coco, and readers.nemo_asr. * Previously the per-epoch shuffle was always seeded with a fixed constant, making the dataset order identical across training runs. The new argument lets users supply a custom base seed so that different training runs produce statistically independent orderings, while still guaranteeing a consistent global permutation across shards. * When omitted, the old fixed seed is used, preserving backward compatibility. * Tests added in test_shuffling.py and test_numpy.py. Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
7c24cd6 to
c616299
Compare
|
!build |
|
CI MESSAGE: [44958231]: BUILD STARTED |
|
CI MESSAGE: [44958231]: BUILD PASSED |
| current_index_(0), | ||
| current_epoch_(0) { | ||
| int32_t seed_arg = kDaliDataloaderSeed; | ||
| spec.TryGetArgument(seed_arg, "shuffle_after_epoch_seed"); |
There was a problem hiding this comment.
Open question: should we raise a warning, if shuffle_after_epoch_seed is set when shuffle_after_epoch=False?
|
|
||
| .. note:: | ||
| When using multiple DALI pipelines (e.g., for multi-GPU training), all pipeline | ||
| instances should use the same ``shuffle_after_epoch_seed`` to ensure a consistent |
There was a problem hiding this comment.
Nitpick: I believe that with the paramlinks you can use single quote and it'll link to the parameter
2f8b0c0 to
5bcb802
Compare
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
5bcb802 to
4445fea
Compare
|
!build |
|
CI MESSAGE: [44966443]: BUILD STARTED |
|
CI MESSAGE: [44966443]: BUILD PASSED |
shuffle_after_epoch_seed(int32) argument to allreaders that support
shuffle_after_epoch: readers.file, readers.numpy,readers.fits, readers.coco, and readers.nemo_asr.
constant, making the dataset order identical across training runs.
The new argument lets users supply a custom base seed so that
different training runs produce statistically independent orderings,
while still guaranteeing a consistent global permutation across shards.
Category:
New feature (non-breaking change which adds functionality)
Relates to #5827
Description:
shuffle_after_epoch_seed(int64) argument to allreaders that support
shuffle_after_epoch: readers.file, readers.numpy,readers.fits, readers.coco, and readers.nemo_asr.
constant, making the dataset order identical across training runs.
The new argument lets users supply a custom base seed so that
different training runs produce statistically independent orderings,
while still guaranteeing a consistent global permutation across shards.
Additional information:
Affected modules and functionalities:
Key points relevant for the review:
Tests:
Checklist
Documentation
DALI team only
Requirements
REQ IDs: N/A
JIRA TASK: N/A