Skip to content

Conversation

@TendonFFF
Copy link
Collaborator

Checklist

Thank you for contributing to QuantumToolbox.jl! Please make sure you have finished the following tasks before opening the PR.

  • Please read Contributing to Quantum Toolbox in Julia.
  • Any code changes were done in a way that does not break public API.
  • Appropriate tests were added and tested locally by running: make test.
  • Any code changes should be julia formatted by running: make format.
  • All documents (in docs/ folder) related to code changes were updated and able to build locally by running: make docs.
  • (If necessary) the CHANGELOG.md should be updated (regarding to the code changes) and built by running: make changelog.

Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.

Description

AMDGPU now has sparse matrix type support. This PR adds a new extension QuantumToolboxAMDGPUExt following the same pattern as the existing CUDA extension.

New extension provides:

  • ROCArray(A::QuantumObject) / ROCArray{T}(A::QuantumObject) — dense array conversion
  • ROCSparseVector, ROCSparseMatrixCSC, ROCSparseMatrixCSR — sparse type conversions
  • roc(A::QuantumObject; word_size=64) — convenient conversion with 32/64-bit control
  • to_dense methods for AMDGPU sparse arrays
  • _sparse_similar methods for CSC/CSR formats

Usage example:

using QuantumToolbox
using AMDGPU

a = destroy(20)
H = a' * a

# Convert to AMDGPU (64-bit default)
H_gpu = roc(H)

# Or 32-bit precision
H_gpu32 = roc(H, word_size=32)

Related issues or PRs

Implements AMDGPU sparse matrix support as referenced in the issue.

Additional context

The implementation mirrors QuantumToolboxCUDAExt.jl exactly, using AMDGPU's rocSPARSE module for sparse matrix types (ROCSparseVector, ROCSparseMatrixCSC, ROCSparseMatrixCSR).

Copilot AI and others added 5 commits November 30, 2025 07:00
Co-authored-by: TendonFFF <157601901+TendonFFF@users.noreply.github.com>
Co-authored-by: TendonFFF <157601901+TendonFFF@users.noreply.github.com>
…matrix-support

Add AMDGPU sparse matrix support extension
@TendonFFF TendonFFF changed the title Dev/amdgpu Add AMDGPU sparse matrix support extension Nov 30, 2025
Copilot AI and others added 5 commits November 30, 2025 07:36
Co-authored-by: TendonFFF <157601901+TendonFFF@users.noreply.github.com>
Co-authored-by: TendonFFF <157601901+TendonFFF@users.noreply.github.com>
…-tests

Add AMDGPU extension tests and Buildkite pipeline configuration
@TendonFFF TendonFFF marked this pull request as ready for review November 30, 2025 08:15
@ytdHuang
Copy link
Member

Currently waiting for some basic linear algebra methods to be fixed: JuliaGPU/AMDGPU.jl#854

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.

2 participants