Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with FillArrays #381

Closed
st-- opened this issue Oct 28, 2021 · 4 comments
Closed

Compatibility with FillArrays #381

st-- opened this issue Oct 28, 2021 · 4 comments
Labels

Comments

@st--
Copy link

st-- commented Oct 28, 2021

We are trying to provide GPU support for AbstractGPs.jl. In AbstractGPs we make use of FillArrays.jl, which unfortunately results in CPU Matrix results when combined with e.g. a CuArray. Would be great if GPUArrays.jl could provide support for the FillArray types!

@maleadt
Copy link
Member

maleadt commented Oct 30, 2021

Could you provide an MWE of what doesn't work, and what you would want to work?

@st--
Copy link
Author

st-- commented Nov 1, 2021

MWE:

using FillArrays, GPUArrays, CUDA, Test
A = CUDA.rand(3, 3)
@test A isa AbstractGPUArray

@test A + Fill(1.2, 3, 3) isa AbstractGPUArray  # works as expected
@test_broken A + Diagonal(Fill(1.2, 3)) isa AbstractGPUArray  # would expect this to work, too

@st--
Copy link
Author

st-- commented Nov 2, 2021

I just became aware of JuliaArrays/FillArrays.jl#165, it might fix this issue? but I haven't checked it yet.

Update: I just tested JuliaArrays/FillArrays.jl#165 but it doesn't affect the MWE above (second test remains broken).

@maleadt
Copy link
Member

maleadt commented Nov 18, 2021

Sorry for the slow response.

@test_broken A + Diagonal(Fill(1.2, 3)) isa AbstractGPUArray # would expect this to work, too

That's because you nest the Fill in a Diagonal; we can't have dispatch for every combination of nested wrappers. See JuliaGPU/Adapt.jl#21, this needs support in Base (e.g. JuliaLang/julia#31563) for better support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants