-
Notifications
You must be signed in to change notification settings - Fork 38
Custom dataloader #162
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
base: develop
Are you sure you want to change the base?
Custom dataloader #162
Conversation
e.g. resetting the state properly after ending a generator, saving state of sample buffer, skipping state of watchdog, log, gc dataset. Adapt required changes in tests. Add typing to specific saved states (instead of FlexState). Make debug output conditional.
philipp-fischer
left a comment
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.
TODO: Check if we can add a check to detect users utilizing global RNG in taskencoder.
| def _pin_memory(self, sample: TSample) -> TSample: | ||
| return PinMemoryMixin.sample_pin_memory(sample, self._device) | ||
|
|
||
| def __call__(self, sample: Future[TSample]) -> Future[TSample]: |
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 believe this method is never called, because instead _pin_memory is directly being accessed. What's the idea behind the __call__ pattern?
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.
See line 229 of dataloader.py:
self._pin_memory(
CallableFuture(functools.partial(self.restore_sample, sample_key))
)and line 317:
self._prefetching_samples[worker_idx].append(
self._pin_memory(worker.prefetch_next())
)… multiple shutdown/close functionalities, especially worker_init/_close
…custom_dataloader
Implementing a custom dataloader instead of
torch.data.utils.DataLoader: