Giter Club home page Giter Club logo

Comments (5)

Drvi avatar Drvi commented on May 22, 2024

Ok, now I think that the problem might be related to the definition of grad for getindex https://github.com/FluxML/Flux.jl/blob/ca1c73ed352d0557a72e12b663fff20332d9aaff/src/tracker/lib/array.jl#L100

Where you allocate a new zeroed array every time (zero(xs))

It would be nice to be able to create a custom sparse version of this, but sparse cuarrays and views throw errors.

from cuda.jl.

maleadt avatar maleadt commented on May 22, 2024

The output of CuArrays.@time has changed (it contained a bug), and there's been some optimizations to the memory allocator, so it might be worth checking your use case again.

We now also have support for pushing objects into the GC pool again, see JuliaGPU/CuArrays.jl#275, so this could be used in Flux to early-free those zero arrays before returning. Would need some abstraction in order to support different kinds of arrays, but that should be straightforward.

from cuda.jl.

Drvi avatar Drvi commented on May 22, 2024

Thanks for looking into it. Should I use the do syntax or put some unsafe_frees in the code, or is it expected that the code snippet above should be faster as is?

from cuda.jl.

maleadt avatar maleadt commented on May 22, 2024

Both. The GC allocator has improved, so please try the master branch of CuArrays. But it didn't change the last example you posted much, so it might be worth adding some unsafe_free!s/do-block syntaxes.

from cuda.jl.

maleadt avatar maleadt commented on May 22, 2024

Let's close this, see #137 (comment). If the issue persists, please open a new issue with an updated MWE.

from cuda.jl.

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.