Giter VIP home page Giter VIP logo

Comments (6)

jramapuram avatar jramapuram commented on May 30, 2024 1

Heya @JanuszL -- hope you are well!

Also in many cases, the pipeline definition determines the output shape - it is a common pattern to use resize/crop operation to have a fixed shape at the data processing output.

Good point. This might be the smarter option actually. Will be there any issues with memory if the pipeline is re-init?

Can you also describe in more detail your use case and why you need to run the processing to determine the shape?

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.

from dali.

JanuszL avatar JanuszL commented on May 30, 2024

Hi @jramapuram,

Thank you for reaching out.
In your case, you can either recreate the pipeline to fully reset it, or keep the output of the first iteration and reuse it in further training.
Also in many cases, the pipeline definition determines the output shape - it is a common pattern to use resize/crop operation to have a fixed shape at the data processing output.
Can you also describe in more detail your use case and why you need to run the processing to determine the shape?

from dali.

jramapuram avatar jramapuram commented on May 30, 2024

@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 😬

GPU Memory (%) del dataloader; gc.collect()
68.76% N/A (baseline single pipeline creation)
77.1% yes
76.9% yes

These are on an A100 80G x8 instance.

from dali.

JanuszL avatar JanuszL commented on May 30, 2024

Hi @jramapuram,

If you want to release DALI memory that is kept in the pool, please check this API.

from dali.

jramapuram avatar jramapuram commented on May 30, 2024

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()

from dali.

JanuszL avatar JanuszL commented on May 30, 2024

@jramapuram,

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.

from dali.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.