Repository navigation
Expose DataLoader kwargs (TrainSettingsConfig.dataloader_kwargs) + add validation helper reject_reserved_keys - #3554
Closed
deruyter92 wants to merge 6 commits into
Closed
deruyter92 wants to merge 6 commits into
deruyter92 wants to merge 6 commits into
Conversation
…tings Training on small datasets over hundreds of epochs respawns DataLoader workers every epoch (persistent_workers=False) with a fixed prefetch depth of 2, leaving GPU utilization on the table for CPU-heavy pipelines. These knobs existed in PyTorch but were not reachable through TrainSettingsConfig, pytorch_config.yaml, or pytorch_cfg_updates (strict schema rejects them). - TrainSettingsConfig: add dataloader_persistent_workers (default False) and dataloader_prefetch_factor (default None = PyTorch default 2, validated >= 1). - train(): forward both to the training DataLoader when dataloader_workers > 0; warn and ignore them for single-process loading (PyTorch requires workers for both options). .get() with defaults keeps old persisted configs without the keys working. - base.yaml / base_detector.yaml defaults + pytorch_config.md docs. Adds config roundtrip/validation tests and train() DataLoader-kwarg tests. Addresses #3547
Ayskin
reviewed
Oct 16, 2026
Ayskin
left a comment
Collaborator
There was a problem hiding this comment.
Nice generic design for additional DataLoader arguments! And to jump ahead to #3555 that suggests validating dataloader_kwargs against dataloader_workers, I would keep the design argument-agnostic for dataloader_kwargs with the cost of failure at training time. What do you think ?
Collaborator
Author
|
merged in #3550 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up PR on #3550 with alternative solution. Can be closed after merging into that PR.
Changes:
TrainSettingsConfig.dataloader_kwargsto pass-through non-exposed fields to torchDataloaderreject_reserved_keysvalidation helper for mappings that may not contain some specific keys.See also #3469 for a related case. The
wandb_kwargssolution could also be simplified using the helper from this PR.