-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
data_loader #3239
Merged
Merged
data_loader #3239
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
210fbfd
data_loader
irasit 9eb489b
limit data queue size
irasit ba915f5
remove __del__
irasit dac81ef
add log
irasit 50fa3f5
increase_default
irasit 3b3a198
increase_default
irasit 52ae2bb
increase_default
irasit c49fd30
clean up
irasit e3c810d
increase_default
irasit 1e18fdb
verbose
irasit File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,9 @@ def train_dataloader(self): | |
else: | ||
dataloader_class = PytorchInfiniteAsyncDataLoader | ||
kwargs['shuffling_queue_capacity'] = self.shuffle_size | ||
# To avoid loading too much data in memory, need to limit the queue size so it will | ||
# only load 1/4 of the data or less than the 10000 rows. (batch_size * queue_size) | ||
kwargs['async_loader_queue_size'] = max(1, min(10000 // kwargs['batch_size'], kwargs['limit_step_per_epoch'] // 4)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in which case we see OOM issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am suspecting the hanging issue in deepETA all data. |
||
|
||
self.train_dl = dataloader_class(**kwargs) | ||
return self.train_dl | ||
|
@@ -115,6 +118,9 @@ def val_dataloader(self): | |
else: | ||
dataloader_class = PytorchInfiniteAsyncDataLoader | ||
kwargs['shuffling_queue_capacity'] = 0 | ||
# To avoid loading too much data in memory, need to limit the queue size so it will | ||
# only load 1/4 of the data or less than the 10000 rows. (batch_size * queue_size) | ||
kwargs['async_loader_queue_size'] = max(1, min(10000 // kwargs['batch_size'], kwargs['limit_step_per_epoch'] // 4)) | ||
|
||
self.val_dl = dataloader_class(**kwargs) | ||
return self.val_dl |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a place
del datalaoder
is called?And in python garbage collection is delayed, it is preferred to call
close_async_loader()
explicitly instead of putting in garbage collection.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What else do you think we can put this close_async_loader() if it is not in del? Is there a close/ending function in lightning module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already called in tear_down hook: https://github.com/horovod/horovod/blob/master/horovod/spark/lightning/datamodule.py#L69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, removed it.