Skip to content

GPU Support and Minimal Working Example of Gaussian Compression with Kaczmarz Solver - #170

Open
vp314 wants to merge 14 commits into
mainfrom
vp/gpu-minimal
Open

GPU Support and Minimal Working Example of Gaussian Compression with Kaczmarz Solver#170
vp314 wants to merge 14 commits into
mainfrom
vp/gpu-minimal

Conversation

@vp314

@vp314 vp314 commented Apr 2, 2026

Copy link
Copy Markdown
Member

Makes minimal changes to types and tests to enable GPU support in Julia and creates a minimal working
example using the Gaussian compressor and Kaczmarz solver.

Description

  • Added Adapt.jl dependency to enable simple type extensions for GPU compatability
  • Added parameter to GaussianRecipe to ensure op field can make use of GPU array types
  • Changed Kacmarz and Logger types to be abstract (this matches existing docstrings better as well)
  • Replaced explicit type allocations with "similar" (e.g., zeros --> fill!(similar...))
  • In power iterations and IHS, replaced qr! with qr to nable GPU support; could not extend this to lq and qr solvers so a comment is there
  • Adjusted tests to match the changes and added tests to verify the array-agnostic approach implemented for GPU support

Motivation and Context

Enabling GPU support is an important feature that may improve efficiency and usability of the library.
This PR adds type-agnostic arrays to ensure that GPU arrays can be used in place of CPU arrays that are the default in Julia.

How has this been tested

New test files have been added including a helper file that creates MockArray type for verifying the type-agnostic approach.

Types of changes

  • CI
  • Docs
  • Feature
  • Fix
  • Performance
  • Refactor
  • Style
  • Test
  • Other (use sparingly):

Checklists:

Code and Comments
If this PR includes modification to the code base, please select all that apply.

  • My code follows the code style of this project.
  • I have updated all package dependencies (if any).
  • I have included all relevant files to realize the functionality of the PR.
  • I have exported relevant functionality (if any).

API Documentation

  • [] For every exported function (if any), I have included a detailed docstring.
  • I have checked the spelling and grammar of all docstring updates through an external tool.
  • I have checked that the docstring's function signature is correctly formatted and has all arguments.
  • I have checked that the docstring's list of arguments, fields, or return values match the function.
  • I have compiled the docs locally and read through all docstring updates to check for errors.

Manual Documentation

  • I have checked the spelling and grammar of all manual updates through an external tool.
  • Any code included in the docstring is tested using doc tests to ensure consistency.
  • I have compiled the docs locally and read through all manual updates to check for errors.

Testing

  • I have added unit tests to cover my changes. (For Macros, be sure to check
    @code_lowered and
    @code_typed)
  • All new and existing tests passed.
  • [] I have achieved sufficient code coverage.

@nathanielpritchard nathanielpritchard left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good my only concern is making these changes for the gaussian and identity compressors and forgetting to make the same changes for the remaining compressors.

Comment thread src/Solvers/kaczmarz.jl
mat_view::MV
vec_view::VV
end
Adapt.@adapt_structure KaczmarzRecipe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment indicating what this does?

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