Skip to content

Correct dual-value scope to LP/QP in numerical-optimization API skills#1408

Draft
cafzal wants to merge 1 commit into
NVIDIA:mainfrom
cafzal:claude/stupefied-brahmagupta-00e7f3
Draft

Correct dual-value scope to LP/QP in numerical-optimization API skills#1408
cafzal wants to merge 1 commit into
NVIDIA:mainfrom
cafzal:claude/stupefied-brahmagupta-00e7f3

Conversation

@cafzal

@cafzal cafzal commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

cuOpt's barrier solver is primal-dual (SOCP barrier #1290, general convex quadratic constraints #1361), so a QP with a quadratic objective and linear constraints returns dual values and reduced costs — not LP only. Two numerical-optimization API skills still described duals as LP-only, wording that predates the QP/barrier work (#1183). This corrects the scope. Follow-on to #1393.

Changes

  • Pythonskills/cuopt-numerical-optimization-api-python/SKILL.md: retitle Getting Dual Values (LP only)(LP / QP) and rewrite the prose. Add a Reading Duals from a QP example to references/qp_examples.md.
  • Cskills/cuopt-numerical-optimization-api-c/SKILL.md: add a Dual values (LP / QP) section. Add a duals note to assets/README.md.

Boundary documented in all four edits: cuOpt returns no dual variables for problems with quadratic constraints — the dual/reduced-cost arrays come back filled with NaN — so the constraints whose duals you read must be linear. This matches docs/cuopt/source/cuopt-c/convex/convex-examples.rst ("dual variables are not currently returned for problems with quadratic constraints") and the QCQP path in cpp/src/pdlp/solve.cu (NaN-fill when the problem has quadratic constraints; barrier returns duals otherwise). A quadratic objective still yields duals; only quadratic constraints suppress them.

Existing lp_duals assets are unchanged (valid LP examples). ./ci/utils/validate_skills.sh passes. Generated skill artifacts (BENCHMARK.md / skill-card.md / skill.oms.sig) are intentionally not hand-edited — they regenerate via NVSkills-Eval.

Optional follow-up (separate, solver-test scope): add a regression test asserting QP dual values on a QP with linear constraints in python/cuopt/cuopt/tests/quadratic_programming/test_qp.py (currently primal-only).

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

Companion PRs — coordinated follow-ons to #1393, catching the numerical-optimization skills up to cuOpt's 26.06 QP / quadratic-constraint additions:

Shared verified boundary across all three: a QP with linear constraints returns duals (the barrier solver is primal-dual); any quadratic constraint suppresses duals for the whole solve (cpp/src/pdlp/solve.cu NaN-fills the dual/reduced-cost arrays). MILP has no duals.

cuOpt's barrier solver is primal-dual (SOCP barrier NVIDIA#1290, general convex
quadratic constraints NVIDIA#1361), so a QP with a quadratic objective and linear
constraints returns dual values and reduced costs — not LP only. The Python
and C API skills still described duals as LP-only, wording that predates the
QP/barrier work (NVIDIA#1183).

- Python SKILL.md: retitle "Getting Dual Values (LP only)" -> "(LP / QP)" and
  rewrite the prose; add a "Reading Duals from a QP" example to
  references/qp_examples.md.
- C SKILL.md: add a "Dual values (LP / QP)" section; add a duals note to
  assets/README.md.

Boundary documented in all four edits: cuOpt returns no dual variables for
problems with quadratic constraints (the dual/reduced-cost arrays come back
filled with NaN), so the constraints whose duals you read must be linear. This
matches docs/cuopt/source/cuopt-c/convex/convex-examples.rst and the QCQP path
in cpp/src/pdlp/solve.cu. Existing lp_duals assets are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: cafzal <cameron.afzal@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

cafzal added a commit to cafzal/cuopt that referenced this pull request Jun 8, 2026
…vior

cpp/src/pdlp/solve.cu (has_quadratic_constraints -> thrust::fill the entire
dual_solution + reduced_cost with quiet_NaN) shows a single quadratic
constraint suppresses duals for the *whole* solve, not just that constraint's
row. Reword "no dual for a quadratic constraint" -> "any quadratic constraint
makes cuOpt return no duals for the whole solve" in Step 3 and the QP eval, for
consistency with PRs NVIDIA#1407 (formulation) and NVIDIA#1408 (api skills, "NaN-filled").

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: cafzal <cameron.afzal@gmail.com>
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.

1 participant