-
Notifications
You must be signed in to change notification settings - Fork 608
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
Grab one sample from pipeline for shaping and reset pipeline #5275
Comments
Hi @jramapuram, Thank you for reaching out. |
Heya @JanuszL -- hope you are well!
Good point. This might be the smarter option actually. Will be there any issues with memory if the pipeline is re-init?
It is mainly to handle pipelines that return augmentation multiplicity > 1 (eg: DINO and other self-supervised algorithms use 2 images of resolution1 and 10x images of resolution2 in a minibatch). But you are right. This should be determinable apriori. |
@JanuszL : I tried deleting the pipeline and re-creating it, however there seems to be a weird oddity with GPU memory over the entire training run 😬
These are on an A100 80G x8 instance. |
Hi @jramapuram, If you want to release DALI memory that is kept in the pool, please check this API. |
Still not working as expected @JanuszL -- memory at 77%. Any thoughts? class DataLoader:
self.train_loader, self.test_loader, self.valid_loader = self._recreate_dataloaders()
# ...
self._delete_loaders()
self.train_loader, self.test_loader, self.valid_loader = self._recreate_dataloaders()
def _delete_loaders(self):
"""Delete loaders if they exist."""
if self.train_loader is not None:
del self.train_loader
if self.test_loader is not None:
del self.test_loader
if self.valid_loader is not None:
del self.valid_loader
# Release memory in pool
ReleaseUnusedMemory()
# Force garbage collection
gc.collect() |
Can you provide a standalone repro for the case you see? Now I can only guess what may be going on, and I can just miss details that differentiate your code from the case I have in mind.. It can even be a toy example using data from https://github.com/NVIDIA/DALI_extra. |
Describe the question.
Is it possible to grab a single sample of
(imgs, labels)
from the pipeline and reset it? This is mainly for shape checking.I see in the docs that:
pipe.reset()
is only usable at the end of iteration?Why?
Check for duplicates
The text was updated successfully, but these errors were encountered: