Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Multiplication between mixed types doesn't drop leading dimensions #673

Closed
ChrisRackauckas opened this issue Apr 4, 2020 · 2 comments · Fixed by JuliaGPU/GPUArrays.jl#263
Labels

Comments

@ChrisRackauckas
Copy link
Member

ChrisRackauckas commented Apr 4, 2020

MWE:

using CuArrays
A = cu(-rand(3,3))
u0 = CuVector([1.0;0.0;0.0])
size(A*u0) # (3,1)

This seems to be a regression from pre-2.0.

@maleadt
Copy link
Member

maleadt commented Apr 6, 2020

julia> CuArrays.rand(Float32, 3, 3)*CuArrays.rand(Float64, 3)
3×1 CuArray{Float64,2,CuArray{Float64,1,Nothing}}:
 0.5720983409319119
 0.8842426252295259
 1.1483806167554638

julia> CuArrays.rand(Float32, 3, 3)*CuArrays.rand(Float32, 3)
3-element CuArray{Float32,1,Nothing}:
 0.9441768
 0.8232954
 0.62073404

@haampie I take it this is related to the mul!/gemm refactor? It's also weird the first returns an array with a parent (a view, I guess), that shouldn't be needed here?

@haampie
Copy link
Member

haampie commented Apr 6, 2020

It does not dispatch to CUBLAS for mixed Float64s and Float32, so this is an issue in GPUArrays it seems:

https://github.com/JuliaGPU/GPUArrays.jl/blob/master/src/host/linalg.jl#L109-L112

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

Successfully merging a pull request may close this issue.

3 participants