Giter VIP home page Giter VIP logo

Comments (5)

smartbitcoin avatar smartbitcoin commented on June 26, 2024

cudaalloc

from cunn.

soumith avatar soumith commented on June 26, 2024

when memory pressure is high, you should do that explicitly on your own. I don't think it is fair to expect that cutorch do a particular operation on CPU implicitly in the background, as this can have many performance side effects that people generally would not expect.

from cunn.

smartbitcoin avatar smartbitcoin commented on June 26, 2024

soumith, device memory need better management especially when CUDA itself still not that smart there. I put a scenario here. you have 4G device ram, you alloc 1.5G first, later on you want to resize to 2.5G. in this case, the resize() call still possible "out of memory" crash if the first 1.5G alloc not align to memory boundary, then there are leaking memory in middle of whole device ram, which hold CUDA alloc continous 2.5G ram. ( but there still enough available ram there ).

resize() only called few times during whole training process, but it's the main reason cause crashing.
swap out, free, then swap in will be a good algo ( alloc small trunk instead of huge amount will be excellent one, but hard to implements. ) for the case when there do have enough RAM, but resize() still failed. it only have tiny performance impact , but it's a "life save" changes.

I did my testing, now the issue is not the performance impact, it's the alloc and free is controlled by cuda runtime. so even you free the "old" content before resize(), those memory space still not return to cuda runtime immediatly , I'll try to figure out how to do a sucess "swap" lol.

from cunn.

deepakjnath avatar deepakjnath commented on June 26, 2024

@smartbitcoin where you able to find a solution for this problem? I am encountering the same issue. I find it to be a major bottleneck

from cunn.

smartbitcoin avatar smartbitcoin commented on June 26, 2024

Kind of. I switch to Caffe, which Blob structure can let you control GRam flexible, but you need write some c++ code.

from cunn.

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.