Skip to content

Add ReSolve HyKKT integration - #12

Closed
tamar-dewilde wants to merge 18 commits into
tamar/resolve-integration-cleanupfrom
tamar/hykkt-resolve-integration
Closed

tamar-dewilde wants to merge 18 commits into
tamar/resolve-integration-cleanupfrom
tamar/hykkt-resolve-integration

Conversation

@tamar-dewilde

Copy link
Copy Markdown
Collaborator

Description

This PR adds support for using ReSolve's HyKKT solver from HiOp.

HyKKT operates directly on the sparse KKT matrix blocks instead of using the existing ReSolve sparse linear solver interface. The integration builds the ReSolve matrix and vector blocks, updates their numerical values between HiOp iterations, and transfers the right-hand side and solution between HiOp and ReSolve.

The integration supports CPU, hybrid, and GPU execution using HiOp's existing memory and compute modes.

@pelesh

Proposed changes

  • Add hiopKKTLinSysCompressedSparseXDYcYdHyKKT as the HiOp interface to ReSolve HyKKT.
  • Build and maintain the ReSolve Hessian, slack diagonal, equality Jacobian, and inequality Jacobian matrix blocks.
  • Reuse the matrix structure and update numerical values between solves on the host or device.
  • Support CPU, hybrid, and GPU execution, with CUDA and HIP device backends, based on HiOp's mem_space and compute_mode settings.
  • Copy the RHS and solution between HiOp and ReSolve using the appropriate host or device memory space.
  • Add linear_solver_sparse=hykkt, hykkt_gamma, and hykkt_residual_tol options.
  • Require the xdycyd KKT formulation for HyKKT, selecting it when KKTLinsys=auto and falling back to linear_solver_sparse=auto when an incompatible KKT formulation is explicitly requested.
  • Use the inertia-free factorization path when HyKKT is selected.
  • Check the residual returned by ReSolve and report unsuccessful HyKKT solves back to HiOp.
  • Add -hykkt support to the sparse and RAJA example drivers.
  • Disable HiOp outer iterative refinement in the HyKKT example paths since HyKKT performs factorization as part of solve().
  • Add HyKKT regression tests for the sparse driver and the CUDA and HIP RAJA paths.
  • Propagate build_kkt_matrix() failures through hiopKKTLinSysCurvCheck::factorize() and factorize_inertia_free() so HyKKT setup failures are returned to the optimization algorithm.

Checklist

  • All tests pass. Code tested on:
    • CPU backend
    • CUDA backend
    • HIP backend
  • I have manually run the relevant HyKKT tests and their registered self checks pass. Code tested on:
    • CPU backend: NlpSparse2_HyKKT
    • CUDA backend: NlpSparse2_HyKKT (hybrid) and NlpSparseRaja2_HyKKT_CUDA
    • HIP backend: NlpSparse2_HyKKT and NlpSparseRaja2_HyKKT_HIP
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
    • Warning builds from this commit were compared with the target branch baseline, and no new warnings were introduced.
  • Regression tests were run.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.

Further comments

This draft is based on tamar/resolve-integration-cleanup and depends on those ReSolve integration changes. It will remain a draft while the prerequisite changes are under review. Once they are merged, the base can be updated or the branch rebased before marking this ready for review.

There are several current limitations to the HyKKT integration:

  • HyKKT currently does not support the dual-regularization blocks used by HiOp. KKT matrix construction reports failure if nonzero dual regularization is requested.
  • ReSolve performs the HyKKT factorization as part of HyKKTSolver::solve(). As a result, factorization failure cannot currently participate in HiOp's regularization retry path in the same way as the existing direct sparse solvers.
  • Cases with no equality constraints or no inequality constraints have not yet been generalized and tested through this interface.
  • The example-driver HyKKT paths set ir_outer_maxit=0 because HyKKT performs a complete factorization and solve for each call. This is currently set by the example drivers rather than enforced for all uses of linear_solver_sparse=hykkt.

This also changes the shared hiopKKTLinSysCurvCheck factorization path so that failures returned by build_kkt_matrix() are propagated instead of being discarded. Among the existing implementations, this can affect hiopKKTLinSysCondensedSparse and hiopKKTLinSysSparseNormalEqn, which have matrix-build failure paths, in addition to HyKKT.

@tamar-dewilde tamar-dewilde self-assigned this Aug 15, 2026
@tamar-dewilde tamar-dewilde added the enhancement New feature or request label Aug 15, 2026
@tamar-dewilde

tamar-dewilde commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator Author

Validated the ReSolve HyKKT integration against HiOp b8f8cd and ReSolve develop at 4d13cf1.

CPU

  • Ubuntu 24.04.4, GCC 13.3.0
  • HiOp full test suite: 27/27 passed
  • NlpSparse2_HyKKT passed its registered self check

CUDA

  • Ubuntu 24.04.4, GCC 13.3.0, CUDA 12.8
  • NVIDIA GeForce RTX 5090 Laptop GPU, compute capability 9.0
  • HiOp full test suite: 36/36 passed
  • NlpSparse2_HyKKT hybrid path passed its registered self check
  • NlpSparseRaja2_HyKKT_CUDA passed its registered self check

HIP

  • Frontier, PrgEnv-cray 8.6.0, ROCm 6.4.2
  • AMD MI250X, gfx90a
  • HiOp full test suite: 42/42 passed
  • NlpSparse2_HyKKT passed its registered self check
  • NlpSparseRaja2_HyKKT_HIP passed its registered self check

The targeted HyKKT tests completed successfully on CPU, hybrid CUDA, CUDA/RAJA, and HIP/RAJA paths.

Full validation logs:

@pelesh

pelesh commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

Closing in favor of #14.

@pelesh pelesh closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants