Skip to content

Conversation

@rg20
Copy link
Contributor

@rg20 rg20 commented Jun 26, 2025

Description

While testing the JuMP interface, there were several corner cases showed up. Especially for tiny problems and problems without constraints. This PR has several such fixes.

In addition, following things are added:

  • Implement cuOptGetVersion() in C-API
  • Change the max allowed absolute gap tolerance to INFINITY

Issue

closes #148
closes #147
closes #166

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

@rg20 rg20 requested review from a team as code owners June 26, 2025 13:27
@copy-pr-bot
Copy link

copy-pr-bot bot commented Jun 26, 2025

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.

@rg20 rg20 added bug Something isn't working non-breaking Introduces a non-breaking change labels Jun 26, 2025
@rg20 rg20 added this to the 25.08 milestone Jun 26, 2025
@rg20
Copy link
Contributor Author

rg20 commented Jun 26, 2025

/ok to test 19dba1e

@chris-maes
Copy link
Contributor

How are you handling problems with zero constraints.

@rg20
Copy link
Contributor Author

rg20 commented Jun 27, 2025

How are you handling problems with zero constraints.

For MIP, Alice wrote a special code that assigns lower or upper bound based on the sign of the objective coefficient. I guess we can do the same for LP?

Copy link
Contributor

@Kh4ster Kh4ster left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@chris-maes chris-maes left a comment

Choose a reason for hiding this comment

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

Please create a new function to get the dual objective in the C API before merging. I also think we should verify the changes around the objective are correct. As this undos past bug fixes.

@rg20
Copy link
Contributor Author

rg20 commented Jul 2, 2025

/ok to test 7c4d589

@rg20 rg20 requested a review from chris-maes July 2, 2025 14:25
@rg20
Copy link
Contributor Author

rg20 commented Jul 2, 2025

/ok to test a754b1c

@rg20
Copy link
Contributor Author

rg20 commented Jul 7, 2025

/ok to test d18c8b2

f_t compute_user_objective(const lp_problem_t<i_t, f_t>& lp, f_t obj)
{
const f_t user_obj = obj * lp.obj_scale + lp.obj_constant;
const f_t user_obj = lp.obj_scale * (obj + lp.obj_constant);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you are changing the convention for how the scaling is done here. I'm not sure why the current convention was chosen. Can you check with @aliceb-nv or @akifcorduk before changing this convention?

Copy link
Contributor

Choose a reason for hiding this comment

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

The reason we chose the current convention was to handle obj_scale values other than 1 or -1. The new way is equivalent only if obj_scale is 1 or -1.

Copy link
Contributor

@chris-maes chris-maes left a comment

Choose a reason for hiding this comment

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

Removing request changes so you can merge while I am out of office. But I left some comments that would be great if you could address.

Also, it wasn't clear to me if the code handled the case where no constraints are present. If so, could you point me to where this is handled?

Copy link
Contributor

@akifcorduk akifcorduk left a comment

Choose a reason for hiding this comment

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

Looks good but one note: the objective offset needs to be correctly handled in case the scaling factor is neither 1 nor -1.

@rg20
Copy link
Contributor Author

rg20 commented Jul 8, 2025

Removing request changes so you can merge while I am out of office. But I left some comments that would be great if you could address.

Also, it wasn't clear to me if the code handled the case where no constraints are present. If so, could you point me to where this is handled?

in MIP empty problem is handled here:

in LP, dual simplex is solving the problem. I guess initial assignment solves the problem?

@rg20
Copy link
Contributor Author

rg20 commented Jul 8, 2025

/ok to test d77cb4d

@rg20
Copy link
Contributor Author

rg20 commented Jul 8, 2025

/merge

@rapids-bot rapids-bot bot merged commit 4824781 into NVIDIA:branch-25.08 Jul 8, 2025
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

5 participants