Code Monkey home page Code Monkey logo

Comments (10)

lukasfolle avatar lukasfolle commented on May 3, 2024 8

I would be really interested in this feature! What is the current status?

from lightning.

levhaikin avatar levhaikin commented on May 3, 2024 4

huggingface has this built-in at this point. I think it's important to have this feature in lightning as well.

from lightning.

TianHongZXY avatar TianHongZXY commented on May 3, 2024 3

any updates? i still can't find how to apply gradient checkpointing with lightning

from lightning.

williamFalcon avatar williamFalcon commented on May 3, 2024 1

@sidhanthholalkere @Borda https://gitter.im/PyTorch-Lightning/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge

from lightning.

wxj630 avatar wxj630 commented on May 3, 2024 1

would be really interested in this Gradient Checkpointing (https://github.com/cybertronai/gradient-checkpointing)
! What is the current status?

from lightning.

Borda avatar Borda commented on May 3, 2024 1

huggingface has this built-in at this point. I think it's important to have this feature in lightning as well.

yeah, would be interested in implementing it? 🐰

from lightning.

moritzschaefer avatar moritzschaefer commented on May 3, 2024 1

@TianHongZXY and future googlers. This is implemented via FSDP https://lightning.ai/docs/pytorch/stable/advanced/model_parallel/fsdp.html#activation-checkpointing

from lightning.

sholalkere avatar sholalkere commented on May 3, 2024

I'm not sure that this is really necessary(maybe just a link to the tutorial instead of implementing it).
For sequential nets, its as simple as

    def forward(self, input_var, chunks=3):
        modules = [module for k, module in self._modules.items()][0]
        input_var = checkpoint_sequential(modules, chunks, input_var)
        input_var = input_var.view(input_var.size(0), -1)
        input_var = self.fc(input_var)
        return input_var

which is basically just adding 3 extra lines to the forward().
For other models(RNNs, LSTMs, etc.) it doesn't seem like there's a nice generalization and can vary between model structure.

from lightning.

levhaikin avatar levhaikin commented on May 3, 2024

it's very tempting, but unfortunately I don't think I will be able to commit to that at this point, due to time constraints. it's a shame that I can't because I use lightning and I think it's a good project. if something changes I will let you know.

from lightning.

jeffwillette avatar jeffwillette commented on May 3, 2024

Is there a reason that the standard Pytorch checkpointing (https://pytorch.org/docs/stable/checkpoint.html) cannot be used with lightning? Why would this need to be reimplemented in lightning?

from lightning.

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.