Skip to content

Conversation

@rgsl888prabhu
Copy link
Collaborator

@rgsl888prabhu rgsl888prabhu commented Feb 9, 2026

For #838

Summary by CodeRabbit

  • New Features

    • Added PSLP presolver for LP problems (PSLP enabled by default for LP; Papilo for MIP)
    • New presolver selection parameter with modes: disabled, Papilo, or PSLP
    • Configurable PDLP tolerance settings for finer solver control
  • Improvements

    • Enhanced solver robustness with better breakdown detection and error handling
    • Improved iterative refinement convergence checks
  • Documentation

    • Updated documentation clarifying presolve defaults and configuration options

rg20 and others added 2 commits February 8, 2026 01:52
This PR adds support for using [PSLP](https://github.com/dance858/PSLP) presolver for LPs.  The PSLP presolver is enabled by default for LPs.  This can be changed to off (--presolve 0) or switch to papilo (--presolve 1).  

This PR also fixes a bug and improves performance of the folding.   
Bug fix: 
Coloring scheme was resulting in AX != YA because of incorrect optimization step. This is now fixed. 

Performance improvement: 
Replaced std::unordered_map with std::map. The unordered map required computing hash values on floating point numbers which is very slow.  With this improvement dlr1 model can be folded in 6 seconds compared 30 seconds before. dlr2 can be folded now in 30 seconds. 

## Issue

Authors:
  - Rajesh Gandham (https://github.com/rg20)
  - Chris Maes (https://github.com/chris-maes)

Approvers:
  - Ramakrishnap (https://github.com/rgsl888prabhu)
  - Chris Maes (https://github.com/chris-maes)

URL: NVIDIA#816
@rgsl888prabhu rgsl888prabhu requested review from a team as code owners February 9, 2026 15:38
@rgsl888prabhu rgsl888prabhu merged commit 23b6c84 into NVIDIA:main Feb 9, 2026
16 of 18 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR integrates PSLP (Simplex Linear Programming) presolver library into cuOpt and replaces boolean presolve flags with an enum-based presolver selection system. Changes include CMake build integration, public API updates introducing presolver_t enum, solver refactoring across LP/MIP/barrier paths, third-party presolve orchestration, and comprehensive test/documentation updates.

Changes

Cohort / File(s) Summary
Build System & Dependencies
cpp/CMakeLists.txt, cpp/tests/CMakeLists.txt, cpp/tests/linear_programming/CMakeLists.txt
Adds PSLP as FetchContent dependency with static linking to cuopt; extends include paths for PSLP and papilo headers; updates test target includes.
Public API Constants & Types
cpp/include/cuopt/linear_programming/constants.h, cpp/include/cuopt/linear_programming/utilities/internals.hpp
Introduces four presolve configuration constants (DEFAULT, OFF, PAPILO, PSLP) and new public enum presolver_t mapping to these constants.
Solver Settings API
cpp/include/cuopt/linear_programming/mip/solver_settings.hpp, cpp/include/cuopt/linear_programming/pdlp/solver_settings.hpp
Replaces bool presolve member with presolver_t presolver in both MIP and PDLP solver settings structures.
Core LP Solver Implementation
cpp/src/dual_simplex/solve.cpp, cpp/src/dual_simplex/solve.hpp, cpp/src/linear_programming/solve.cu
Adds solver overloads accepting optional start_time parameter; refactors presolve handling to use presolver_t enum; adds fast-path for completely presolved problems; enhances timing and residual logging.
Barrier & Iterative Refinement
cpp/src/dual_simplex/barrier.cu, cpp/src/dual_simplex/iterative_refinement.hpp
Fixes histogram indexing; adds NaN checks and breakdown validation in Givens refinement to prevent invalid result propagation.
Folding Algorithm Refinement
cpp/src/dual_simplex/folding.cpp
Implements Paige-Tarjan optimization in color splitting; changes map types from unordered_map to map; adds extensive DEBUG verification; updates function signatures for error handling (returns int status codes).
Third-Party Presolve Integration
cpp/src/mip/presolve/third_party_presolve.hpp, cpp/src/mip/presolve/third_party_presolve.cpp
Adds PSLP presolver path with builder/adapter functions; extends apply/undo signatures to support presolver selection; deletes copy/move constructors; introduces PSLP-specific postsolve storage and cleanup logic.
MIP Solver Integration
cpp/src/mip/solve.cu, cpp/src/mip/solver.cu, cpp/src/mip/relaxed_lp/relaxed_lp.cu, cpp/src/mip/diversity/diversity_manager.cu
Refactors presolve gating to use presolver_t != None; forces PSLP→Papilo redirection for MIP; propagates presolver parameter through presolve apply calls; disables presolver for relaxed LP subproblems.
Parameter Configuration
cpp/src/math_optimization/solver_settings.cu
Updates int_parameters mapping for CUOPT_PRESOLVE to target presolver fields (via reinterpret_cast) instead of boolean presolve; removes presolve from bool_parameters.
LP/MIP Unit Tests
cpp/tests/linear_programming/pdlp_test.cu, cpp/tests/linear_programming/unit_tests/presolve_test.cu, cpp/tests/mip/cuts_test.cu, cpp/tests/mip/.../*_test.cu
Replaces presolve boolean assignments with presolver_t::None/Papilo/Default values; adds comprehensive PSLP presolve validation tests (postsolve accuracy, dual consistency, reduced costs); updates test helper signatures.
Python Bindings & Documentation
python/cuopt/cuopt/tests/linear_programming/test_lp_solver.py, python/cuopt/cuopt/tests/linear_programming/test_python_API.py, python/cuopt_server/cuopt_server/.../*, docs/cuopt/source/.../*.rst
Exports CUOPT_PRESOLVE constant; changes presolve parameter type from bool to int (0/1/2 modes); updates warm-start examples and FAQ/feature docs to describe PSLP/Papilo selection; clarifies default presolvers per problem type.
Benchmark & License
benchmarks/linear_programming/run_mps_files.sh, thirdparty/THIRD_PARTY_LICENSES
Adds --pdlp-tolerances script option with PDLP tolerance flags; updates license declarations (PSLP Apache-2.0).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • NVIDIA/cuopt#816: Introduces PSLP presolver integration surfaces and presolver enum refactoring affecting the same public API, settings, and third-party presolve orchestration.

Suggested labels

feature request, breaking

Suggested reviewers

  • Iroy30
  • gforsyth
  • akifcorduk
  • chris-maes
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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