JuliaGPU/CUDA.jl

Power of adjoint of `CuSparseMatrix` does not work anymore

Open

#2,255 opened on Jan 29, 2024

View on GitHub
 (3 comments) (0 reactions) (0 assignees)Julia (1,408 stars) (274 forks)batch import
bugcuda librarieshelp wanted

Description

Describe the bug

The power of the adjoint of a CuSparseMatrix does not work anymore. It is only related to Julia v1.10 and not to previous versions.

To reproduce

The Minimal Working Example (MWE) for this bug:

using CUDA
using CUDA.CUSPARSE
CUDA.allowscalar(false)
using LinearAlgebra
using SparseArrays

A = sprand(ComplexF64, 100, 100, 0.1)
A_gpu = cu(A)

julia> A_gpu'^2
ERROR: MethodError: no method matching CuSparseMatrixCSC{ComplexF64, Int32}(::Adjoint{ComplexF64, CuSparseMatrixCSC{ComplexF64, Int32}})

Closest candidates are:
  CuSparseMatrixCSC{Tv, Ti}(::CuArray{<:Integer, 1}, ::CuArray{<:Integer, 1}, ::CuArray{T, 1} where T, ::Tuple{var"#s1271", var"#s1271"} where var"#s1271"<:Integer) where {Tv, Ti<:Integer}
   @ CUDA ~/.julia/packages/CUDA/rXson/lib/cusparse/array.jl:43
  CuSparseMatrixCSC{Tv, Ti}(::Diagonal) where {Tv, Ti}
   @ CUDA ~/.julia/packages/CUDA/rXson/lib/cusparse/conversions.jl:241

Stacktrace:
 [1] convert(T::Type{CuSparseMatrixCSC{ComplexF64, Int32}}, m::Adjoint{ComplexF64, CuSparseMatrixCSC{ComplexF64, Int32}})
   @ CUDA.CUSPARSE ~/.julia/packages/CUDA/rXson/lib/cusparse/array.jl:16
 [2] to_power_type(x::Adjoint{ComplexF64, CuSparseMatrixCSC{ComplexF64, Int32}})
   @ Base ./intfuncs.jl:261
 [3] power_by_squaring(x_::Adjoint{ComplexF64, CuSparseMatrixCSC{ComplexF64, Int32}}, p::Int64)
   @ Base ./intfuncs.jl:276
 [4] ^(A::Adjoint{ComplexF64, CuSparseMatrixCSC{ComplexF64, Int32}}, p::Int64)
   @ LinearAlgebra ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/LinearAlgebra/src/dense.jl:479
 [5] literal_pow(f::typeof(^), x::Adjoint{ComplexF64, CuSparseMatrixCSC{ComplexF64, Int32}}, ::Val{2})
   @ Base ./intfuncs.jl:351
 [6] top-level scope
   @ REPL[8]:1
 [7] top-level scope
   @ ~/.julia/packages/CUDA/rXson/src/initialization.jl:208

Version info

Details on Julia:

Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 32 × 13th Gen Intel(R) Core(TM) i9-13900KF
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, goldmont)
  Threads: 24 on 32 virtual cores
Environment:
  JULIA_NUM_THREADS = 16

Details on CUDA:

CUDA runtime 12.3, artifact installation
CUDA driver 12.3
NVIDIA driver 546.9.0

CUDA libraries:
- CUBLAS: 12.3.4
- CURAND: 10.3.4
- CUFFT: 11.0.12
- CUSOLVER: 11.5.4
- CUSPARSE: 12.2.0
- CUPTI: 21.0.0
- NVML: 12.0.0+545.30

Julia packages:
- CUDA: 5.1.2
- CUDA_Driver_jll: 0.7.0+1
- CUDA_Runtime_jll: 0.10.1+0

Toolchain:
- Julia: 1.10.0
- LLVM: 15.0.7

1 device:
  0: NVIDIA GeForce RTX 4090 (sm_89, 20.981 GiB / 23.988 GiB available)

Contributor guide