Skip to content

Support sparse matrices from rocSPARSE #255

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Support sparse matrices from rocSPARSE #255

wants to merge 2 commits into from

Conversation

amontoison
Copy link
Collaborator

@amontoison amontoison commented Jun 23, 2025

close #254
Very similar to #253.

I requested access to CI with AMD GPUs last week. I should have it but didn't find time to try it yet.
I can do that when I will back in the US.

@amontoison amontoison requested a review from gdalle June 23, 2025 07:00
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 57 lines in your changes missing coverage. Please review.

Project coverage is 92.98%. Comparing base (108c7c1) to head (56fd6af).

Files with missing lines Patch % Lines
ext/SparseMatrixColoringsAMDGPUExt.jl 0.00% 57 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (108c7c1) and HEAD (56fd6af). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (108c7c1) HEAD (56fd6af)
3 2
Additional details and impacted files
@@             Coverage Diff             @@
##              main     #255      +/-   ##
===========================================
- Coverage   100.00%   92.98%   -7.02%     
===========================================
  Files           17       18       +1     
  Lines         1939     1996      +57     
===========================================
- Hits          1939     1856      -83     
- Misses           0      140     +140     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amontoison
Copy link
Collaborator Author

Hum I should copy-paste the "conversion" functions that I added in CUDA.jl. I have the following errors with AMD GPUs:

(n = 100, p = 0.05): Error During Test at /home/amontoison/Argonne/SparseMatrixColorings.jl/test/rocm.jl:51
  Got exception outside of a @test
  Scalar indexing is disallowed.
  Invocation of getindex resulted in scalar indexing of a GPU array.
  This is typically caused by calling an iterating implementation of a method.
  Such implementations *do not* execute on the GPU, but very slowly on the CPU,
  and therefore should be avoided.
  
  If you want to allow scalar iteration, use `allowscalar` or `@allowscalar`
  to enable scalar iteration globally or for the operations in question.
  Stacktrace:
    [1] error(s::String)
      @ Base ./error.jl:35
    [2] errorscalar(op::String)
      @ GPUArraysCore ~/.julia/x86_64/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:151
    [3] _assertscalar(op::String, behavior::GPUArraysCore.ScalarIndexing)
      @ GPUArraysCore ~/.julia/x86_64/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:124
    [4] assertscalar(op::String)
      @ GPUArraysCore ~/.julia/x86_64/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:112
    [5] getindex
      @ ~/.julia/x86_64/packages/GPUArrays/uiVyU/src/host/indexing.jl:50 [inlined]
    [6] getindex(A::ROCSparseMatrixCSR{Float64, Int32}, i0::Int64, i1::Int64)
      @ AMDGPU.rocSPARSE ~/.julia/x86_64/packages/AMDGPU/wH6SV/src/sparse/array.jl:352
    [7] _getindex
      @ ./abstractarray.jl:1358 [inlined]
    [8] getindex
      @ ./abstractarray.jl:1312 [inlined]
    [9] iterate
      @ ./abstractarray.jl:1209 [inlined]
   [10] iterate
      @ ./abstractarray.jl:1207 [inlined]
   [11] SparseMatrixCSC{Float64, Int64}(M::ROCSparseMatrixCSR{Float64, Int32})
      @ SparseArrays ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/SparseArrays/src/sparsematrix.jl:891
   [12] SparseMatrixCSC
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/SparseArrays/src/sparsematrix.jl:885 [inlined]
   [13] convert
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/SparseArrays/src/sparsematrix.jl:980 [inlined]
   [14] sparse
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/SparseArrays/src/sparsematrix.jl:1016 [inlined]
   [15] matrix_versions(A::ROCSparseMatrixCSR{Float64, Int32})
      @ SparseMatrixColorings ~/.julia/x86_64/packages/SparseMatrixColorings/FZwji/src/matrices.jl:15
   [16] macro expansion
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/Test/src/Test.jl:1814 [inlined]
   [17] test_coloring_decompression(A0::ROCSparseMatrixCSR{Float64, Int32}, problem::ColoringProblem{:symmetric, :column}, algo::GreedyColoringAlgorithm{:direct, NaturalOrder}; B0::Nothing, color0::Nothing, test_fast::Bool, gpu::Bool)
      @ Main ~/Argonne/SparseMatrixColorings.jl/test/utils.jl:28
   [18] macro expansion
      @ ~/Argonne/SparseMatrixColorings.jl/test/rocm.jl:53 [inlined]
   [19] macro expansion
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/Test/src/Test.jl:1793 [inlined]
   [20] macro expansion
      @ ~/Argonne/SparseMatrixColorings.jl/test/rocm.jl:51 [inlined]
   [21] macro expansion
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/Test/src/Test.jl:1793 [inlined]
   [22] macro expansion
      @ ~/Argonne/SparseMatrixColorings.jl/test/rocm.jl:50 [inlined]
   [23] macro expansion
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/Test/src/Test.jl:1704 [inlined]
   [24] top-level scope
      @ ~/Argonne/SparseMatrixColorings.jl/test/rocm.jl:48
   [25] include(fname::String)
      @ Main ./sysimg.jl:38
   [26] macro expansion
      @ ~/Argonne/SparseMatrixColorings.jl/test/runtests.jl:24 [inlined]
   [27] macro expansion
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/Test/src/Test.jl:1704 [inlined]
   [28] macro expansion
      @ ~/Argonne/SparseMatrixColorings.jl/test/runtests.jl:22 [inlined]
   [29] macro expansion
      @ ~/Applications/julia/x86_64/julia-1.11.5/share/julia/stdlib/v1.11/Test/src/Test.jl:1704 [inlined]
   [30] top-level scope
      @ ~/Argonne/SparseMatrixColorings.jl/test/runtests.jl:14
   [31] include(fname::String)
      @ Main ./sysimg.jl:38
   [32] top-level scope
      @ none:6
   [33] eval
      @ ./boot.jl:430 [inlined]
   [34] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:296
   [35] _start()
      @ Base ./client.jl:531

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 this pull request may close these issues.

Support rocSPARSE matrices
1 participant