Comments (5)
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.
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.
Thanks for looking into it. Should I use the do syntax or put some unsafe_free
s in the code, or is it expected that the code snippet above should be faster as is?
from cuda.jl.
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.
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)
- Improve cross-device usage HOT 5
- CUDA 12.4 Update 1: CUPTI does not trace kernels anymore
- Bitonic sort exceeds launch resources HOT 3
- Avoid implementing LAPACK interfaces directly
- v5.3.0: regression in Zygote performance HOT 9
- CUBLASLt wrapper for `cublasLtMatmulDescSetAttribute` can have device buffers as input HOT 1
- Improve error message when assigning real valued arrray with complex numbers HOT 4
- `@device_code_sass` broken HOT 3
- Readme says Cuda 11 is supported but also the last version to support it is v4.4 HOT 1
- `@gcsafe_ccall` breaks inlining of ccall wrappers HOT 5
- Mixed eltype contraction failing with CuTensor HOT 1
- Add helper function to recompile CUDA stack
- Unable to use local CUDA runtime toolkit HOT 1
- Kron Support for CuSparseMatrixCSC HOT 1
- Enzyme prevents testing on 1.11
- Segfault during multiGPU tests
- EnzymeCore is an unconditional dependency. HOT 4
- Adapt + strictly-typed fields can trigger confusing errors
- cuBLASLt wrappers ccall into cuBLAS
- generic_trimatmul! error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cuda.jl.