Repository navigation
Make solver_settings_t buildable without the GPU library: plain parameter bases, shared registry, opaque device warm start - #2196
Closed
ramakrishnap-nv wants to merge 3 commits into
Conversation
pdlp_solver_settings_t and mip_solver_settings_t mixed user-facing parameters with GPU-backed data (rmm buffers, warm start, callbacks), so anything that needed only the parameters had to link the GPU stack, and the parameter table lived next to the GPU code. - Add pdlp_parameters_t and mip_parameters_t (new headers, no CUDA/rmm/raft includes). The settings classes now derive from them, so every member keeps its name and meaning. - Move the name/default/range table and the set/get/file functions into solver_parameter_registry_t, built into the CPU-only cuopt_client library. solver_settings_t forwards to it. - Add cpu_solver_settings_t, the counterpart of cpu_optimization_problem_t, on the same registry. A test checks it lists the same parameters and defaults as solver_settings_t. Source compatible; the layout of the two settings classes changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
…build CPU-only pdlp_solver_settings_t held a pdlp_warm_start_data_t by value. Its default constructor is in a CUDA translation unit and its destructor needs rmm, so constructing a solver_settings_t forced every caller to link the GPU library, and its constructor could not live in the CPU-only client. - Add opaque_ptr_t: an owning pointer with value semantics whose clone and destroy functions are recorded where the GPU library creates the object. Copying clones, like a by-value member. - Hold the device warm start through it, created on first use by the GPU library. - Define solver_settings_t's constructor inline, so a CPU-only caller needs no GPU symbol to construct, copy or destroy one. No public API change. Tests cover opaque_ptr_t and that a copied settings object owns its own device warm start. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
…type With the device warm start behind an opaque pointer, solver_settings_t builds, copies and destroys without any GPU symbol, so a separate CPU-only settings type is redundant and would be a second type to keep in sync. Replace its tests with equivalent ones on solver_settings_t: every parameter name accepts its own default, and setting by name reaches the members. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Ramakrishna Prabhu <ramakrishnap@nvidia.com>
Collaborator
Author
|
Closing this proof of concept. The direction (plain settings, data objects separate, one unified settings object) is being written up as a design for the team to agree first; the spike branch stays available as a reference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
pdlp_solver_settings_tandmip_solver_settings_tmix plain parameters with GPU-backed data. Constructing asolver_settings_tneeded the CUDA translation unit (the device warm start was held by value) and its destructor needed rmm, so anything that only needs the parameters, such as a CPU-only remote client, had to link the GPU stack. The table of parameter names, defaults and ranges also lived in a CUDA translation unit.This makes
solver_settings_tusable without the GPU library, with no change to the public API.pdlp_parameters_tandmip_parameters_t(no CUDA, rmm or raft includes) hold the enums,tolerances_tand every plain user-facing member. The settings classes derive from them, sosettings.tolerances.x,settings.time_limit,pdlp_solver_settings_t<>::tolerances_tand the rest keep working unchanged.set/get_parameter*,load/dump_parameters_*move intosolver_parameter_registry_t, built into the CPU-onlycuopt_clientlibrary.solver_settings_tkeeps its API and forwards to it.opaque_ptr_t: an owning pointer with value semantics whose clone and destroy functions are recorded where the GPU library creates the object.pdlp_solver_settings_tholds the device warm start through it, created on first use. Copying clones the data, as a by-value member did.solver_settings_t()is now inline, so a CPU-only caller needs no GPU symbol to construct, copy or destroy one.solver_settings_tstays the only settings type. This is groundwork for running the remote gRPC client and the Java client without CUDA or rmm at run time. That follow-up is not in this PR.Longer term, the warm start and initial solutions are inputs to a solve rather than settings, and are better as their own objects with settings as a plain key/value store. That is an API change and is intentionally not part of this PR. When it lands,
opaque_ptr_tis removed with no user-visible change.Review notes
pdlp_solver_settings_t/mip_solver_settings_tchanges, so this is not binary compatible. Please flag anything that depends on that.get_tolerances()andset_optimality_tolerance()moved inline into the bases; the deadpdlp_solver_settings_t::get_tolerances()declaration is now defined.opaque_ptr_tcopies clone the pointee. Tests cover that a copied settings object owns its own device warm start.Testing
Built every target (
ninja -k 0) with 0 errors. Passing locally:LP_UNIT_TEST44 (new tests foropaque_ptr_t, copy ownership of the device warm start, every parameter name accepting its own default, and set-by-name reaching the members),GRPC_CLIENT_TEST120,HEURISTICS_HYPER_PARAMS_TEST19,QP_UNIT_TEST22,SEMI_CONTINUOUS_TEST3,MPS_FAST_PARSER_TEST26,GRPC_PIPE_SERIALIZATION_TEST21, andNUMOPT_INTERNAL_TEST438 tests (run per suite).libcuopt_client.sohas 0 rmm/CUDA/raft undefined symbols, and a JVM loads the Java gRPC client's native library with no rmm and no preload. A solver_settings_t-based C wrapper and the Java client's 7 live-server integration tests pass against the rebuilt server.Not clean on my machine, and not compared against an unmodified baseline: the remaining failures in
NUMOPT_INTERNAL_TEST,C_API_TEST,INCUMBENT_CALLBACK_TESTandCLI_TESTwere each either a missing local dataset or an abort incusparseSpMVOp_bufferSize(CUDA 13.3 toolkit with the conda cuSPARSE 12.8.2 runtime). The cuSPARSE abort also blocks the PDLP suites that would exercise warm start through this path end to end.DOC_EXAMPLE_TESTleaves a stale/tmp/user_problem.mpsthat fails its next run; that is existing behavior. I tested on a base a few commits behind main; the patch applies cleanly on main, but I did not rebuild there. The Python/Cython package was not built.Checklist
🤖 Generated with Claude Code