Skip to content

Implement the HyKKT Cholesky module#350

Merged
shakedregev merged 28 commits intohykkt-devfrom
adham/hykkt-cholesky
Sep 2, 2025
Merged

Implement the HyKKT Cholesky module#350
shakedregev merged 28 commits intohykkt-devfrom
adham/hykkt-cholesky

Conversation

@adhamsi
Copy link
Collaborator

@adhamsi adhamsi commented Jul 29, 2025

Description

This implements the Cholesky factorization module, one of the five HyKKT modules. The module supports computing the symbolic and numeric factorization of a sparse positive definite matrix (the H_gamma matrix from the HyKKT paper), and updating the nonzeros of the matrix and reusing the symbolic factorization. The module then provides a solve(vector::Vector* x, vector::Vector* b) function.

Closes #311

Proposed changes

  • The CUDA implementation is largely copied over from the original HyKKT repo and uses cusolver.
  • The CPU implementation uses the suitesparse CHOLMOD module. This involves converting from the ReSolve CSR sparse type to the CHOLMOD-native cholmod_sparse type, which is an inideal solution, but acceptable given that the CPU implementation is primarily for correctness and comparison to GPU implementations.
  • The HIP implementation uses the rocsolver library refactorization and triangular solve functions.

Checklist

  • All tests pass. Code tested on
    • CPU backend
    • CUDA backend
    • HIP backend
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows Re::Solve style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.

@adhamsi adhamsi force-pushed the adham/hykkt-cholesky branch from 339fb5c to b5f357d Compare August 11, 2025 14:13
@shakedregev shakedregev force-pushed the adham/hykkt-cholesky branch from dcceadf to 9c471ea Compare August 12, 2025 16:24
@adhamsi adhamsi marked this pull request as ready for review August 25, 2025 14:54
@adhamsi adhamsi requested a review from shakedregev August 25, 2025 14:54
@adhamsi adhamsi self-assigned this Aug 25, 2025
if(RESOLVE_USE_KLU)
add_subdirectory(hykkt)
endif()
#list(APPEND ReSolve_Targets_List resolve_hykkt)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are we removing this from the list of targets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

resolve_hykkt is the target for only the Permutation class. This is a holdover from your original commit of the Permutation class. The name hasn't been changed and needs to be. The other hykkt modules are named resolve_hykkt_ruiz, etc. But it appears adding it to the list of targets is redundant if the subdirectory is added.

adhamsi and others added 4 commits August 27, 2025 12:25
Copy link
Collaborator

@shakedregev shakedregev left a comment

Choose a reason for hiding this comment

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

CUDA and CPU tests pass. Approved, pending documentation change requests.
HIP is not working because as far as we can tell their Cholesky solver does not work (verified with @kswirydo from AMD). We will need to add a separate test for HIP once we figure out what is going on with their Cholesky solver.

@kswirydo
Copy link
Collaborator

We are investigating the issue on AMD GPUs. I got the same failure for identity matrix too ...

@shakedregev shakedregev merged commit 825882c into hykkt-dev Sep 2, 2025
@shakedregev shakedregev deleted the adham/hykkt-cholesky branch September 2, 2025 13:16
shakedregev added a commit that referenced this pull request Nov 13, 2025
* initial solver and cuda header

* cuda implementation

* minimal test on cuda passes

* cpu implementation

* tell cmake to find cholmod

* add template hip implementation

* dependencies

* cpu: memory freeing and unused fields

* Apply pre-commmit fixes

* error handling and correct memory in cuda

* randomized testing: different sparsity patterns

* Apply pre-commmit fixes

* fix for cuda: resetting workspace

* Apply pre-commmit fixes

* test reusing sparsity pattern

* Apply pre-commmit fixes

* Apply pre-commmit fixes

* draft: rocsolver

* Apply pre-commmit fixes

* fix build issue

* documentation

* Apply pre-commmit fixes

* error message when no gpu support

Co-authored-by: Shaked Regev <35384901+shakedregev@users.noreply.github.com>

* address minor review comments

* Apply pre-commmit fixes

* remove commented code

* more detail on documentation

* Apply pre-commmit fixes

---------

Co-authored-by: adhamsi <adhamsi@users.noreply.github.com>
Co-authored-by: Shaked Regev <35384901+shakedregev@users.noreply.github.com>
pelesh added a commit that referenced this pull request Nov 20, 2025
* Added the permutation class from hykkt, along with tests.

* Implement HyKKT Ruiz Scaling (#317)

* Implement the HyKKT Cholesky module (#350)

* SpGEMM for HyKKT (#366)

---------

Co-authored-by: superwhiskers <whiskerdev@protonmail.com>
Co-authored-by: Nicholson Koukpaizan <72402802+nkoukpaizan@users.noreply.github.com>
Co-authored-by: Adham Ibrahim <adham.ibrahim@princeton.edu>
Co-authored-by: kswirydo <kasia.swirydowicz@gmail.com>
Co-authored-by: shakedregev <shakedregev@users.noreply.github.com>
Co-authored-by: Slaven Peles <peless@ornl.gov>
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.

3 participants