Skip to content

Bug fix of dual init point computation in barrier#1577

Open
yuwenchen95 wants to merge 2 commits into
NVIDIA:mainfrom
yuwenchen95:qcqp-init-point
Open

Bug fix of dual init point computation in barrier#1577
yuwenchen95 wants to merge 2 commits into
NVIDIA:mainfrom
yuwenchen95:qcqp-init-point

Conversation

@yuwenchen95

Copy link
Copy Markdown
Contributor

Description

Extend barrier initial-point handling for SOCP and fix augmented-path KKT assembly at initialization.

  • Add ensure_initial_point_interior to push linear variables into the nonnegative orthant and SOC blocks into strict Lorentz cone interior; apply to x and z at the end of initial_point.
  • Fix augmented init sign: remove erroneous diag.multiply_scalar(-1.0) so the first-call augmented build produces -(Q+D) on the primal block, matching augmented_multiply and the refactor path.
  • Size augmented primal/dual RHS and solution vectors to max(n+m, device_augmented.n) for sparse SOC expansion, zero-padding extra entries.
  • Enable initial-point iterative refinement for LP/QP augmented solves by seeding d_diag_ from host diag; skip IR for cone problems and direct-free linear variables where operator/factorization would disagree.
  • Move primal, bound, and dual residual checks to after interior enforcement so diagnostics reflect the final starting point.
  • Remove unused inv_sqrt_diag member and initialization.

Issue

Checklist

  • I am familiar with the Contributing Guidelines.
  • Testing
    • New or existing tests cover these changes
    • Added tests
    • Created an issue to follow-up
    • NA
  • Documentation
    • The documentation is up to date with these changes
    • Added new documentation
    • NA

Signed-off-by: yuwenchen95 <yuwchen@nvidia.com>
@yuwenchen95 yuwenchen95 added this to the 26.08 milestone Jul 15, 2026
@yuwenchen95 yuwenchen95 requested a review from rg20 July 15, 2026 17:18
@yuwenchen95 yuwenchen95 self-assigned this Jul 15, 2026
@yuwenchen95 yuwenchen95 added the improvement Improves an existing functionality label Jul 15, 2026
@yuwenchen95 yuwenchen95 requested a review from a team as a code owner July 15, 2026 17:18
@yuwenchen95 yuwenchen95 requested a review from a team as a code owner July 15, 2026 17:18
@yuwenchen95 yuwenchen95 requested review from aliceb-nv, chris-maes and ramakrishnap-nv and removed request for aliceb-nv July 15, 2026 17:18
@yuwenchen95 yuwenchen95 added non-breaking Introduces a non-breaking change bug Something isn't working and removed improvement Improves an existing functionality labels Jul 15, 2026
@yuwenchen95 yuwenchen95 changed the title Extend dual init point computation for QCQP Bug fix of dual init point computation Jul 15, 2026
@yuwenchen95 yuwenchen95 changed the title Bug fix of dual init point computation Bug fix of dual init point computation in barrier Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 3aa6ff1d-b76b-40a4-9c95-50073a54a273

📥 Commits

Reviewing files that changed from the base of the PR and between 130b9a4 and 8e29f92.

📒 Files selected for processing (1)
  • cpp/src/barrier/barrier.cu
🚧 Files skipped from review as they are similar to previous changes (1)
  • cpp/src/barrier/barrier.cu

📝 Walkthrough

Walkthrough

Changes

The barrier solver adds SOC-aware interior initialization and the Sturm/SeDuMi mu-based strategy. Diagonal preprocessing stores inv_diag directly, augmented vectors use computed dimensions, iterative refinement is restricted, and parameter documentation accepts option 2.

Barrier initialization

Layer / File(s) Summary
Mu-based initial-point option
cpp/src/math_optimization/solver_settings.cu, cpp/src/dual_simplex/simplex_solver_settings.hpp, python/cuopt_server/...
Allows barrier_dual_initial_point=2 and documents the Sturm/SeDuMi mu-based primal+dual initialization across C++ and Python interfaces.
Inverse diagonal preprocessing
cpp/src/barrier/barrier.cu
Replaces inverse-square-root diagonal state and calculations with direct inverse-diagonal storage and device copying.
SOC-aware initial-point construction
cpp/src/barrier/barrier.cu
Builds mu-based SOC initial points, sizes augmented vectors from the augmented system, restricts iterative refinement, enforces interiors, and recomputes residuals after shifts.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested labels: improvement

Suggested reviewers: rg20, ramakrishnap-nv, chris-maes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: fixing barrier dual initial-point computation.
Description check ✅ Passed The description is directly about the same barrier initial-point and SOC/KKT changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
cpp/src/barrier/barrier.cu (1)

2187-2236: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

SOC initial-point branches are unreachable for cone problems

data.has_cones() forces init_strategy to 2, and that branch returns immediately, so the later has_cones()/has_soc path in initial_point() never runs for SOCPs. That makes the new SOC interior-enforcement helper and the sparse-SOC aug_size path dead code here, and it also silently ignores any explicit barrier_dual_initial_point = 0/1 setting on cone problems.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cpp/src/barrier/barrier.cu` around lines 2187 - 2236, Update initial_point’s
init_strategy selection and early-return flow so cone problems do not
unconditionally force strategy 2. Preserve explicit barrier_dual_initial_point
values 0/1 for cone problems, and route those cases through the existing SOC
initialization/interior-enforcement and sparse-SOC aug_size logic; retain the
mu-based strategy 2 behavior when selected.

Source: Path instructions

python/cuopt_server/cuopt_server/tests/test_lp.py (1)

163-172: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add dual_initial_point=2 to the test matrix. The current @pytest.mark.parametrize list covers -1, 0, and 1, but not the new 2 value, so the mu-based path still isn’t exercised.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cuopt_server/cuopt_server/tests/test_lp.py` around lines 163 - 172,
Update the pytest parameterization for test_barrier_solver_options to include
dual_initial_point=2 alongside the existing -1, 0, and 1 values, ensuring the
mu-based path is exercised.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@cpp/src/barrier/barrier.cu`:
- Around line 2187-2236: Update initial_point’s init_strategy selection and
early-return flow so cone problems do not unconditionally force strategy 2.
Preserve explicit barrier_dual_initial_point values 0/1 for cone problems, and
route those cases through the existing SOC initialization/interior-enforcement
and sparse-SOC aug_size logic; retain the mu-based strategy 2 behavior when
selected.

In `@python/cuopt_server/cuopt_server/tests/test_lp.py`:
- Around line 163-172: Update the pytest parameterization for
test_barrier_solver_options to include dual_initial_point=2 alongside the
existing -1, 0, and 1 values, ensuring the mu-based path is exercised.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7b1686c5-e726-4b2a-8619-e97d44323b58

📥 Commits

Reviewing files that changed from the base of the PR and between 5658d72 and 130b9a4.

📒 Files selected for processing (5)
  • cpp/src/barrier/barrier.cu
  • cpp/src/dual_simplex/simplex_solver_settings.hpp
  • cpp/src/math_optimization/solver_settings.cu
  • python/cuopt_server/cuopt_server/tests/test_lp.py
  • python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py

Signed-off-by: yuwenchen95 <yuwchen@nvidia.com>
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

CI Test Summary

1 failed · 30 passed · 0 skipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

barrier bug Something isn't working non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant