-
Notifications
You must be signed in to change notification settings - Fork 108
Write out mps file containing user problem. Useful for debugging #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write out mps file containing user problem. Useful for debugging #66
Conversation
|
@chris-maes Lets add this to https://github.com/NVIDIA/cuopt/blob/branch-25.05/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst#parameter-constants and https://github.com/NVIDIA/cuopt/blob/branch-25.05/docs/cuopt/source/lp-milp-settings.rst And is this limited to C API or are you adding changes to python as well ? |
I added docs to the files you suggested above. The parameter should be supported across all the APIs. I made changes to add it as named constant to Python. Hopefully, it should be picked up automatically on the server side (since I send all the parameters over the wire in ThinClientSolverSettings. But maybe other changes need to be made on the server side. (I'm less familiar with how that works.) |
|
/ok to test 89133fc |
|
@chris-maes You would want to add changes here https://github.com/rapidsai/cuopt/blob/6499e52f8d48795b3373c14825d0f9b00cf84313/python/cuopt_self_hosted/cuopt_sh_client/thin_client_solver_settings.py#L167 Please let me know if it's confusing, I will update your PR. |
rgsl888prabhu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add a test for this parameter
No change is required in
In general, I don't think we should need to make changes in Thinking more about Server. I don't know if it is appropriate to add the parameter to the Server API. This parameter will cause the solver to write out a file. If the solver is on a different machine than the client, there would need to be some mechanism to send the file back to the client. Maybe for now, we should just add this to the CLI, C, and Python APIs. And not support the parameter on the Server. |
aliceb-nv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Chris!
My mistake, I missed that all other parameters copied directly under to_dict which are not tolerance. Regarding writing to a file, it can be written to a shared mount and it is up to user to configure it. But may be we can push this support for server to 25.08 since it may not be essential. I will create a issue for us to support this on server, if we deem this is not much of a use in case of server, we can close that. |
… omitted from MPS file
…onnegative integer variables
|
/ok to test a94cbb7 |
|
@aliceb-nv I made a few changes to your
This is strange as variables should default to [0, inf) bounds in MPS files unless specified. But I think there are certain cases where we need to be explicit about the bounds. |
rgsl888prabhu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @chris-maes for the PR, have few questions and requests. Rest looks good.
…constant to Python. Add Python unit test
|
/ok to test 85d07d7 |
This PR adds the string parameter CUOPT_USER_PROBLEM_FILE = "user_problem_file". By default the parameter is the empty string "". If the parameter is set by the user to something other than the empty string, we will write out an MPS file containing the LP or MIP.
This is very useful when trying to debug interfaces like CVXPY where the interface between CVXPY and cuOpt may have performed transformation to the user problem. This allows us to reproduce failures on the engine side directly from the MPS file without needing Python scripts.