Skip to content

Releases

v0.4.0

Choose a tag to compare

@Lhongpei Lhongpei released this 07 Oct 03:43
88c4e88

PDHCG v0.4.0

This release introduces a device-independent solver architecture. The core algorithm is separated from device-specific operations, with independent CPU and CUDA implementations. This also provides a foundation for adding other hardware backends.

The main changes are:

  • Multiple backends in one build. CPU and CUDA can be compiled into the same library and executable. Python, C, and the CLI share the same native device selection.
  • CPU support. Problems can now be solved without a GPU, using OpenMP and BLAS/LAPACK. The thread count is configurable, with automatic BLAS thread management for supported OpenBLAS and MKL builds.
  • Automatic backend detection. By default, CMake builds the backends whose dependencies are available and prints the compiled devices and default.
  • Improved infeasibility detection. LP, QP, and conic problems use certificate checks that account for variable bounds, cone constraints, fixed cone coordinates, and quadratic objectives.
  • CPU testing in CI. Automated checks now cover native and Python interfaces, CLI behavior, and representative optimization problems.
  • Reorganized documentation. Device selection, build options, threading, and distributed execution are documented together. Examples and API references have also been reviewed and corrected.

For example, build both CPU and CUDA:

cmake -S . -B build -DPDHCG_DEVICES="CPU;CUDA"
cmake --build build

Choose the backend for each Python solve:

model.setParam("Threads", 8)
model.optimize(device="cpu")

model.optimize(device="cuda")

The equivalent options are params.device = "cpu" in C and --device cpu in the CLI. Use pdhcg.print_devices() or pdhcg --list-devices to see the compiled backends.

When no device is specified, the build default is used, normally preferring CUDA over CPU. CUDA initialization failures are reported as errors rather than automatically switching to CPU.

C applications need to be recompiled against the updated API. The eps_infeas_detect parameter has been removed; use eps_infeasible in C or InfeasibleTol in Python.

v0.3.1

Choose a tag to compare

@Lhongpei Lhongpei released this 20 Sep 21:56

PDHCG v0.3.1

PDHCG 0.3.1 adds an optional linearized update for non-diagonal quadratic objectives, improves parser and API reliability, and extends CUDA compatibility.

What's Changed

  • Added inner and linearized modes for non-diagonal quadratic objectives. For $H=Q+R^\top D R$, the new optional mode uses
    $x^{k+1}=\Pi_{\mathcal X}\left(x^k-\frac{Hx^k+c-A^\top y^k}{L+\tau_k^{-1}}\right).$

    This also adds quadratic-aware scaling and unified spectral and nonconvexity checks for sparse, low-rank, and combined objectives. #12

  • Improved MPS parsing, centralized C and Python parameter validation, and made Python problem/result ownership exception-safe. #11

  • Added CUDA 13.3 cuSPARSE SpMVOp compatibility while preserving CUDA 13.2 and older fallback paths. Thanks to @evawyy for this contribution. #10

Downstream C/C++ applications should rebuild against v0.3.1 because pdhg_parameters_t contains the new non_diagonal_quadratic_mode field.

Full Changelog: v0.3.0.post1...v0.3.1

v0.3.0.post1

Choose a tag to compare

@Lhongpei Lhongpei released this 12 Aug 17:12
167c8b7

PDHCG v0.3.0.post1

Adds initial PSD cone support for variable and affine cones in the C, Python, CVXPY, and distributed interfaces.

PSD projection uses GPU eigendecomposition. Large PSD cones are not recommended; each distributed PSD block remains on one GPU.

v0.3.0

Choose a tag to compare

@Lhongpei Lhongpei released this 12 Aug 17:09
443fbf4

PDHCG v0.3.0

PDHCG 0.3.0 expands the solver from quadratic programming to GPU-accelerated conic quadratic programming (CQP), including distributed multi-GPU execution.

Highlights

Conic quadratic programming

PDHCG now solves convex models of the form

$$\begin{aligned} \min_x \quad & \frac{1}{2}x^\top(Q + R^\top D R)x + c^\top x \\\ \text{s.t.} \quad & \ell_c \le Ax \le u_c, \\\ & Fx + g \in \mathcal K_a, \\\ & \ell_v \le x \le u_v, \\\ & x_J \in \mathcal K_v. \end{aligned}$$

The following cones are supported for both variable blocks and native affine constraints:

  • second-order cones (SOC);
  • rotated second-order cones (RSOC);
  • exponential cones;
  • three-dimensional power cones.

Multi-GPU conic solver

The MPI/NCCL backend now supports conic quadratic models. This release adds:

  • cone-aware row and column partitioning and permutation;
  • distributed projection and KKT residual evaluation;
  • cooperative projection of large SOC and RSOC blocks spanning GPUs;
  • support for both variable and affine cones in distributed solves.

Build with -DPDHCG_COMPILE_DISTRIBUTED=ON and launch the executable with mpirun to use multiple GPUs.

Python and CVXPY interfaces

  • Added the columnar ConeSpec and ConeType APIs.
  • Added variable cones and native affine-cone constraints to pdhcg.Model.
  • Added Model.read_file() for MPS/QPS/CBF inputs, including gzip-compressed files.
  • Added an optional CVXPY backend with quadratic objectives and Zero, NonNeg, SOC, ExpCone, and PowCone3D constraints.

Install CVXPY integration with:

pip install "pdhcg[cvxpy]==0.3.0"

Then register the backend once before solving:

import cvxpy as cp
import pdhcg.cvxpy_backend

problem.solve(solver="PDHCG")

Cone projection, scaling, and termination

  • Added specialized warp/block CUDA projection paths for cone blocks.
  • Completed fixed-section projection support for variable SOC, RSOC, exponential, and power cones.
  • Added cone-aware primal feasibility, stationarity, dual membership, and complementarity residuals.
  • Added cone-preserving Ruiz and Pock-Chambolle scaling.
  • Added optional Curtis-Reid scaling through --curtis_reid_iter.
  • Improved exponential-, power-, SOC-, and RSOC-cone projection correctness.

File and command-line support

  • Added CBF and compressed CBF parsing.
  • Improved MPS/QPS parsing, including QCMATRIX input.
  • Added supported QCQP-to-SOCP transformations, selectable with --soc_form rotated or --soc_form standard.
  • Added command-line controls for scaling, restart behavior, and inner solves.
  • Changed the default infeasibility-detection tolerance to 1e-12.

Breaking Changes

Version 0.3 changes the public model-construction APIs.

  • The C function create_qp_problem() has six new trailing arguments for variable and affine cones. Existing QP callers should append 0, NULL, NULL, NULL, 0, NULL.
  • qp_problem_t and pdhg_parameters_t have new fields. Recompile downstream code and initialize parameters with set_default_parameters().
  • C dual warm starts and returned dual solutions are ordered as [dual_A, dual_F] and have rows(A) + rows(F) entries.
  • pdhcg_postsolve() now returns nonzero only after complete primal-dual recovery.
  • Python cone metadata must use ConeSpec; the legacy list[dict] format is no longer accepted.

See the 0.3 migration guide for source-level examples.

Installation

Python package:

pip install --upgrade pdhcg==0.3.0

Source build:

git clone https://github.com/Lhongpei/PDHCG.git
cd PDHCG
cmake -S . -B build
cmake --build build -j

PDHCG requires an NVIDIA GPU and CUDA 12.4 or newer. Distributed builds also require MPI and NCCL.

References

This release accompanies GPU-Accelerated Conic Quadratic Programming with Local Linear Convergence under Strict Complementarity.
给我加上PSD并说明这个是initial支持,且大cone不建议使用

v0.2.1

Choose a tag to compare

@Lhongpei Lhongpei released this 25 May 10:12

v0.2.1

What's New in v0.2.1

Generalized low-rank quadratic term. The objective now supports the form

$$\tfrac{1}{2}\, x^\top (Q + R^\top D R)\, x + c^\top x$$

where D is an optional rank × rank middle matrix. When omitted, D defaults to the identity and the previous version. D may be diagonal, sparse, dense, or indefinite — no PSD requirement.

Testing

test/test_lowrank_middle_D.py exercises six cases, each cross-checked against an equivalent formulation:

Case Reference
D = I matches no-D baseline
1-D diag D (PSD) matches folded R' = sqrt(D) R
2-D dense D (PSD) matches folded R' = L^T R (Cholesky D = L L^T)
Indefinite dense D matches explicit Q_eff = R^T D R
Sparse CSR D matches dense D with same values
Sparse CSR diagonal-only D detected as DIAG, matches 1-D path

Compatibility

  • Public ABI break: create_qp_problem signature changed (one extra parameter). C callers must update.
  • Python API: additive; existing code continues to work unchanged.

v0.2.0

Choose a tag to compare

@Lhongpei Lhongpei released this 22 May 09:49

PDHCG-II v0.2.0

Major release introducing multi-GPU distributed solving, cuSPARSE SpMVOp backend, and a Jacobi diagonal preconditioner for the inner subproblem.

What's New in v0.2.0

Multi-GPU Distributed Solving

Solve large-scale QPs across multiple GPUs via MPI + NCCL. Build with -DPDHCG_COMPILE_DISTRIBUTED=ON and launch with mpirun. New CLI options: --grid_size, --partition_method, --permute_method, --permute_block_size. Single- and multi-GPU code paths share the same binary, dispatched automatically by MPI world size.

Strong-scaling on large LASSO problems (solving time in seconds, tolerance 1e-6):

Problem 1 GPU 2 GPUs 4 GPUs 8 GPUs
SLS 1.96 1.10 0.56 0.50
rcv1_test 2.37 1.48 1.06 0.81
avazu-site.tr 1337.05 953.02 547.28 376.90
avazu-app 217.70 116.92 65.86 46.30
avazu-site 1642.69 993.62 765.46 503.99
kddb2010_test 11.59 11.18 8.79 7.07
kdda2010_test 9.90 8.50 6.77 5.61
kddb2010_train 703.36 466.28 317.69 233.44
kdda2010_train 341.16 237.19 167.62 124.89

cuSPARSE SpMVOp Backend

On CUDA ≥ 13.0, sparse matrix-vector multiplications switch to cusparseSpMVOp for higher throughput, with transparent fallback to the standard SpMV API on CUDA 12.x — no manual configuration needed.

Measured on the Mittelmann QP Benchmark, the new SpMVOp backend delivers an average ~1.23× speedup over the previous SpMV-based path (new : old ≈ 1 : 1.23).

Jacobi Diagonal Preconditioner

Enabled by default for the inner solver, improving convergence of subproblems on ill-conditioned QPs. Disable via CLI flag --no_diag_precond or Python parameter DiagJacobiPrecond=False.

Maros–Mészáros non-diagonal QP set (tolerance 1e-6, time limit 1000s):

Metric w/o Jacobi w/ Jacobi
Solved 78 / 79 79 / 79
Arithmetic mean wall (s) 26.006 10.217
SGM10 wall (s) 6.150 4.495
SGM10 outer iterations 6495 5640

Other Improvements

  • Box-only convex QPs are supported via a dummy-variable reformulation.
  • Fixed result construction when the problem reduces to an LP.
  • Documentation: Python parameters table, distributed CLI examples, expanded C type reference.

Limitations

The Python wheel (pip install pdhcg) supports single-GPU solving only. For multi-GPU, build the C++ executable with -DPDHCG_COMPILE_DISTRIBUTED=ON and launch with mpirun.

v0.1.5

Choose a tag to compare

@Lhongpei Lhongpei released this 25 Mar 03:01

What's New in v0.1.5

Ecosystem Integration

  • qpsolvers Support: PDHCG is now supported as a backend in the qpsolvers ecosystem (v4.11.0+). You can now call it seamlessly using their standard Python API via solve_qp(..., solver="pdhcg").

New Features & UX

  • Graceful Interruption (Ctrl+C): Safely catch Ctrl+C (SIGINT) during solving. The solver now returns the current sub-optimal solution with a USER_INTERRUPT status instead of ignoring SIGINT or crashing the Python process.
  • Lazy CUDA Initialization: The GPU context is now initialized before the main optimization process.

Bug Fixes

  • Fixed: Corrected a scaling bug causing segment error.

v0.1.4.post1

Choose a tag to compare

@Lhongpei Lhongpei released this 16 Mar 12:04
  • GitHub Pages documentation site with MkDocs
    • API documentation for Python (Model class)
    • API documentation for C interface
    • Installation and quick start guides
    • Examples and citation info
  • GitHub Actions workflow for automated documentation deployment
  • Pre-commit hooks configuration (.pre-commit-config.yaml)
    • Ruff for Python formatting/linting
    • Clang-format for C/C++/CUDA formatting
    • Codespell for spell checking
  • Development dependencies group ([dev])
    • Ruff, pre-commit, mkdocs-material, mkdocstrings

v0.1.4

Choose a tag to compare

@Lhongpei Lhongpei released this 15 Mar 08:17

What's New in v0.1.4

New Features

  • Inner Solver Control: Added parameters to control QP subproblem solving:

    • InnerIterLimit: Max iterations for inner solver.
    • InnerInitTol: Initial tolerance.
    • InnerMinTol: Minimum tolerance floor.
  • IDE Support: Added .pyi stubs for better auto-completion and type checking in Python.

Improvements

  • Robustness: Added C++ backend validation to automatically correct invalid parameter settings.
  • Logging:
    • Added inner column to iteration logs.
    • Improved terminal banner centering.
    • Fixed non-convexity (min eigenvalue) logging logic.
    • Example:
---------------------------------------------------------------------------------------------------
                                            PDHCG-II
                      A GPU-Accelerated First-Order Solver for Convex QPs
                                      (c) Hongpei Li, 2026
                                 Contact: ishongpeili@gmail.com

---------------------------------------------------------------------------------------------------
problem: 400 rows, 688 columns, 2409 nonzeros
settings:
  iter_limit         : 2147483647
  time_limit         : 3600.00 sec
  eps_opt            : 1.0e-04
  eps_feas           : 1.0e-04
  eps_infeas_detect  : 1.0e-10
---------------------------------------------------------------------------------------------------
Problem Type: CONVEX_QP
Quadratic Objective Matrix Type: Sparse Q
L2 Norm of Quadratic Objective Matrix: 6.344e+00
Minimum Eigenvalue of Q: 2.389e-03
---------------------------------------------------------------------------------------------------
        runtime        |     objective      |   absolute residuals    |   relative residuals    
  iter   inner   time  |  pr obj    du obj  |  pr res  du res   gap   |  pr res  du res   gap   
---------------------------------------------------------------------------------------------------
     0       0 1.9e-03 |  0.0e+00   0.0e+00 | 0.0e+00 9.6e+01 0.0e+00 | 0.0e+00 1.2e-01 0.0e+00 
    10      10 2.7e-03 |  1.3e+05   5.9e+04 | 5.7e+03 4.9e+02 7.5e+04 | 5.7e-01 2.5e-01 3.9e-01 
    20      20 3.4e-03 |  1.6e+12   7.2e+11 | 1.9e+07 3.0e+06 9.0e+11 | 1.9e+03 1.3e-01 3.8e-01 
    30      30 4.2e-03 |  2.7e+19   1.2e+19 | 8.3e+10 8.3e+10 1.5e+19 | 8.3e+06 1.3e-01 3.8e-01 
  • CLI: Updated command-line interface to support new parameters.

v0.1.3

Choose a tag to compare

@Lhongpei Lhongpei released this 05 Mar 15:00

What's New in v0.1.3

This release introduces a more granular logging system for both the C and Python interfaces—greatly improving integration and usability—and resolves a critical compilation issue in CMake.

Features & Enhancements

  • Multi-level Logging: The boolean logging flag has been upgraded to an integer-based LogLevel (or Verbosity). You can now control the output granularity:
    • 0: Silent (No output)
    • 1: Summary (Final solver statistics)
    • 2: Detailed (Iteration-by-iteration progress)
  • CLI Update: The C executable now accepts an integer argument for verbosity (e.g., ./pdhcg -v 1 problem.mps output/).
  • Python API Aliases: Added LogLevel and Verbosity as the preferred parameters in the Python Model. Legacy parameters like OutputFlag and LogToConsole (True/False) are still fully supported for backward compatibility (automatically mapped to 1 and 0 respectively).

Documentation

  • Custom CUDA Paths: Added comprehensive instructions in the README.md on how to build the Python package using explicit environment variables (CUDACXX and SKBUILD_CMAKE_ARGS) when multiple CUDA versions exist on the host machine.

Fixed Bugs

  • Flexible CUDA Toolchains: Removed the hardcoded nvcc compiler path from the build configuration. This resolves CMake build issues and allows the build system to correctly detect and use the active CUDA toolkit in diverse computing environments.