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

Multiplying two views #676

Closed
Rabab53 opened this issue Sep 23, 2024 · 1 comment · Fixed by #677
Closed

Multiplying two views #676

Rabab53 opened this issue Sep 23, 2024 · 1 comment · Fixed by #677

Comments

@Rabab53
Copy link

Rabab53 commented Sep 23, 2024

Hello,

I'm encountering an issue when trying to multiply two matrix views using AMDGPU; this operation fails, whereas it executes correctly with CUDA. It appears that AMDGPU is not correctly forwarding the matrix multiplication operation to the built-in matmul function in GPUArrays.

for example:

julia> A = ROCArray(rand(10, 10));
julia> v1=@view A[:, 1:5];
julia> v2=@view A[1:5, :];
julia> v1*v2
ERROR: MethodError: no method matching gemm!(::Char, ::Char, ::Float64, ::ROCArray{…}, ::SubArray{…}, ::Float64, ::ROCArray{…})

Closest candidates are:
  gemm!(::Char, ::Char, ::Float64, ::ROCVecOrMat{Float64}, ::ROCVecOrMat{Float64}, ::Float64, ::ROCVecOrMat{Float64})
   @ AMDGPU ~/.julia/packages/AMDGPU/gtxsf/src/blas/wrappers.jl:546
  gemm!(::Char, ::Char, ::ComplexF32, ::ROCVecOrMat{ComplexF32}, ::ROCVecOrMat{ComplexF32}, ::ComplexF32, ::ROCVecOrMat{ComplexF32})
   @ AMDGPU ~/.julia/packages/AMDGPU/gtxsf/src/blas/wrappers.jl:546
  gemm!(::Char, ::Char, ::ComplexF64, ::ROCVecOrMat{ComplexF64}, ::ROCVecOrMat{ComplexF64}, ::ComplexF64, ::ROCVecOrMat{ComplexF64})
   @ AMDGPU ~/.julia/packages/AMDGPU/gtxsf/src/blas/wrappers.jl:546
  ...

Stacktrace:
 [1] generic_matmatmul!(C::ROCArray{…}, tA::Char, tB::Char, A::ROCArray{…}, B::SubArray{…}, _add::LinearAlgebra.MulAddMul{…})
   @ AMDGPU.rocBLAS ~/.julia/packages/AMDGPU/gtxsf/src/blas/highlevel.jl:222
 [2] mul!
   @ ~/.julia/juliaup/julia-1.10.4+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:263 [inlined]
 [3] mul!
   @ ~/.julia/juliaup/julia-1.10.4+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:237 [inlined]
 [4] *(A::ROCArray{Float64, 2, AMDGPU.Runtime.Mem.HIPBuffer}, B::SubArray{Float64, 2, ROCArray{Float64, 2, AMDGPU.Runtime.Mem.HIPBuffer}, Tuple{UnitRange{…}, Base.Slice{…}}, false})
   @ LinearAlgebra ~/.julia/juliaup/julia-1.10.4+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/matmul.jl:113
 [5] top-level scope
   @ REPL[11]:1
 [6] top-level scope
   @ ~/.julia/packages/AMDGPU/gtxsf/src/tls.jl:200
Some type information was truncated. Use `show(err)` to see complete types.

Could you help with this?

Thanks,
Rabab

@pxl-th
Copy link
Member

pxl-th commented Sep 24, 2024

Should be fixed by #677. Thanks for reporting the issue.

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

Successfully merging a pull request may close this issue.

2 participants