Honor --num_workers in the eval dataloader#60
Open
TonyChen06 wants to merge 1 commit into
Open
Conversation
The eval DataLoader ignored --num_workers, so all per-item work (ECG loading, normalization, image rendering for the rgb representation, tokenization) ran on the main process between generate() calls. Pass num_workers and persistent_workers through, matching the train loader. Items are unchanged (verified identical between num_workers=0 and 2); loading 8 rgb eval batches drops from 13.5s to 6.2s with 2 workers. The default (--num_workers 0) behaves exactly as before.
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.
First piece of splitting up #12 into simpler PRs, rebuilt against current main.
What
The eval
DataLoaderignored--num_workers, so all per-item work (ECG loading, normalization, matplotlib rendering for thergbrepresentation, tokenization) ran on the main process betweengenerate()calls. This passesnum_workersandpersistent_workersthrough, exactly like the train loader. Default behavior (--num_workers 0) is unchanged.Verification
num_workers=0andnum_workers=2(tensor-equalelm_input_idsand CLIP pixel tensors over 8 batches, rgb representation).