Repository navigation
Use native Cholesky for Dense QPs and make equality projection optional - #2921
Merged
Merged
Conversation
Retain well-conditioned positive-definite native Hessians for both formulations, with square-root fallbacks and unchanged original-QP checks. Refresh the MPC report and profiles with paired before/after measurements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to get GTSAM's Dense QP solver closer to DAQP, whose performance on small MPC problems was particularly impressive. After adding dual active-set solving in #2918, I investigated why Dense still lagged and found avoidable work in curvature setup. This PR adds cached native-Hessian Cholesky and makes permanent equality projection configurable for both Primal and Dual solves.
On the small MPC problems in this benchmark, GTSAM Dense/Dual is now the dominant solver after DAQP. Across the 60 WALK/BAL problems with 16 or 50 variables, it is the fastest passing non-DAQP method in 187/240 problem/accuracy combinations, including 42/60 at Default and 51/60 at the highest accuracy. Sparse/Dual accounts for most of the remaining wins.
Stacked on #2918; base branch:
codex/qp-dual-formulation.Behavior and numerical safeguards
projectDenseQpEqualities, defaulting totrue, through the shared C++/Python/MATLAB interface. Setting it tofalsekeeps original coordinates and enforces permanent equalities with exact hard pivots and cached rank/multiplier recovery.Sparse behavior and the Sparse/Automatic defaults are unchanged.
Benchmark evidence
Higher curves toward the left are better; curves ending below 100% include failures. These profiles cover all 64 MPC cases: 60 small WALK/BAL problems and four larger QUAD problems. Dense/Dual's small-problem result is summarized above; Sparse/Dual remains the stronger GTSAM choice on larger structured problems.
The paired 12,800-call campaign covers both backends, both formulations, all 64 MPC problems and four accuracy settings, plus 512 Automatic checks. Complete native-factor timing includes solver construction, Dense packing, equality preparation, factorization, optimization and multiplier recovery. Matrix-to-factor input assembly is excluded.
Default-setting family medians in milliseconds, with paired speedups computed from per-case medians of five additional fresh calls:
Both versions retain 256/256 passing Dual cases and 253/256 passing Primal cases per backend; the same three low-accuracy Primal initialization failures remain. All 512 Automatic checks pass. QUAD is ineligible for native-Hessian Cholesky, and Sparse is a control; timing differences there are not attributed to this optimization. Equality projection remains enabled by default because disabling it can increase the dimension and setup cost of Dense solves.
The benchmark report includes timing boundaries, failures, numerical settings and before/after provenance. G1 and external-solver measurements retain their earlier provenance. Benchmark scripts, raw measurements and private inputs remain untracked.
Validation
git diff --checkpass.