AutoPreallocation.jl icon indicating copy to clipboard operation
AutoPreallocation.jl copied to clipboard

add CuArray support

Open marius311 opened this issue 4 years ago • 4 comments
trafficstars

Fixes #10 #24

With this, e.g.:

julia> using CUDA, AutoPreallocation

julia> _,f = preallocate() do 
           x = CUDA.zeros(10)
           2 * x .+ 3
       end;

julia> CUDA.@allocated f()
0

marius311 avatar Nov 19 '20 11:11 marius311

This works but I want to play around with more CUDA functionality to make sure enough stuff works. Any early feedback you may have is welcome too.

marius311 avatar Nov 19 '20 11:11 marius311

A decent bit of things work (broadcast, matmul, etc...), although we currently have:

_,f = preallocate() do 
    x = CUDA.zeros(10)
    fft(x)
end
CUDA.@allocated f() # ERROR: CUDA error: invalid argument (code 1, ERROR_INVALID_VALUE)

and

_,f = preallocate() do 
    x = CUDA.zeros(10)
    map(sin, x)
end # segfault

Also there might possibly be some regressions given the test failures, although its hard to tell, tests pass locally for my machine. I'll continue to hack on this where I can. If you get tired of waiting for me to do so, feel free to also merge the functionality the currently exists and whatever I add I'll do in a followup.

marius311 avatar Nov 24 '20 10:11 marius311

I'll continue to hack on this where I can. If you get tired of waiting for me to do so, feel free to also merge the functionality the currently exists and whatever I add I'll do in a followup.

I am happy to wait.

Meanwhile: @maleadt how hard would it be to get this repo setup to do testing with JuliaGPU?

oxinabox avatar Nov 29 '20 16:11 oxinabox

@maleadt how hard would it be to get this repo setup to do testing with JuliaGPU?

It's slightly cumbersome nowadays; I documented it here: https://github.com/JuliaGPU/buildkite#adding-a-repository. I'm not entirely sure how it'll work for repositories that are not part of an organization, but we can try.

maleadt avatar Nov 30 '20 07:11 maleadt