Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hf dataset hang on small dataset #1370

Merged
merged 5 commits into from
Jul 18, 2024
Merged

Conversation

dakinggg
Copy link
Collaborator

It seems that when processing a small dataset with multiprocessing, hf datasets sometimes hangs. This PR fixes this by just not doing multiprocessing when the dataset is small. Not sure if this covers all cases, but at least fixes the hang we are seeing now.

Before, with a dataset with 3 samples, it would hang after tokenization ~20% of the time. After this PR, 20 runs completed successfully. Also after this PR, a dataset with 512 samples still appropriately uses multiprocessing, and completed successfully 20 times.

@dakinggg dakinggg requested a review from a team as a code owner July 18, 2024 02:59
@dakinggg dakinggg requested a review from irenedea July 18, 2024 02:59
@dakinggg dakinggg enabled auto-merge (squash) July 18, 2024 03:01
@dakinggg dakinggg merged commit 006f251 into mosaicml:main Jul 18, 2024
9 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.

2 participants