Skip to content

Conversation

@IliasAarab
Copy link
Contributor

By default, the transformers library sets the num_workers argument of the PyTorch DataLoader to 0, ensuring out-of-the-box compatibility across different platforms.

Issue #, if available:

Description of changes:

Set the DataLoader num_workers argument to 0 to improve cross-platform compatibility, particularly on Windows systems where multiprocessing requires guarded execution.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ult (0)

By default, the `transformers` library sets the `num_workers` argument of the PyTorch DataLoader to `0`, ensuring out-of-the-box compatibility across different platforms.
@abdulfatir
Copy link
Contributor

@IliasAarab did you run into any issues with windows?

@abdulfatir abdulfatir requested a review from Copilot November 5, 2025 22:12
@abdulfatir abdulfatir added the run-eval Run evaluation CI workflow label Nov 5, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modifies the DataLoader configuration in the predict method to use single-threaded data loading by setting num_workers=0 instead of num_workers=1.

Key Changes

  • Changed the num_workers parameter from 1 to 0 in the DataLoader initialization within the predict method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@abdulfatir abdulfatir changed the title fix: align DL num_workers argument with transformers default (0) Set num_workers=0 in Chronos-2 test data loader Nov 5, 2025
@abdulfatir abdulfatir merged commit 78bd1c9 into amazon-science:main Nov 5, 2025
6 checks passed
@IliasAarab
Copy link
Contributor Author

@IliasAarab did you run into any issues with windows?

@abdulfatir thanks for the quick merge. Yes, I ran into a few issues on Windows, especially during quick prototyping, like when running snippets in a notebook or VS Code interactive window without guarded execution (i.e., without a if __name__ == "__main__": block).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-eval Run evaluation CI workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants