Skip to content

Allow zero workers in training data loaders - #30

Merged
MWesselkamp merged 1 commit into
developfrom
rz/allow-zero-dataloader-workers
Dec 3, 2026
Merged

MWesselkamp merged 1 commit into
developfrom
rz/allow-zero-dataloader-workers

Conversation

@Raminyazdani

Copy link
Copy Markdown
Collaborator

Closes #23.

Training, validation and test now use PyTorch's single-process defaults for worker-only options when num_workers=0. The loader options for positive worker counts stay the same.

I checked all three loaders with zero and one worker on a small in-memory dataset. All eight DataModule tests passed locally.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the change enabling zero-worker data loaders.

No open issues 🎉

What changed in this PR

Addresses #23 by allowing LitDataModule training, validation, and test loaders to run with zero workers while preserving positive-worker behavior.

Changes:

  • Uses single-process defaults for worker-only options when num_workers=0.
  • Adds parameterized tests covering loader options and returned batches with zero and one worker.
File Description
tests/​test_data_module.py Tests all three loaders with zero and one worker.
deep_lst/​dataset/​data_module.py Makes worker-only options conditional on worker count.

Review effort: Balanced

@MWesselkamp MWesselkamp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@MWesselkamp
MWesselkamp merged commit 2b4997a into develop Dec 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants