Refactor: math_optimization namespace#1446
Draft
mlubin wants to merge 8 commits into
Draft
Conversation
Mechanical rename of the umbrella namespace and public include path (include/cuopt/linear_programming -> include/cuopt/math_optimization). No structural or behavioral change. Python package cuopt.linear_programming intentionally unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Out of the overloaded ::detail namespace; folds pdlp_hyper_params in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Out of dual_simplex; barrier now owns its own cusparse_view_t cleanly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
'1' and 'best_results.txt' are solver/benchmark stdout captures that a broad 'git add -A' swept into the umbrella-rename commit. Not source. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Branch-and-bound, cuts, and heuristics were split across ::dual_simplex and ::detail; unify them in one ::mip namespace. The shared problem_t representation (used by pdlp/barrier too) moves to ::mip as well. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Generic GPU helpers moved to the cuopt namespace; module-specific helpers into their module namespace; file-local helpers into anonymous namespaces. detail no longer used for organization (routing's cuopt::detail and the third-party cxxopts detail are unrelated and untouched). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
The C API is unchanged (same symbols, C linkage); only its header path moved to <cuopt/math_optimization/cuopt_c.h>. Add a forwarding shim at the legacy path (with a deprecation #pragma message) so existing C/C++ consumers keep compiling. Installs via the existing include/cuopt/ directory rule. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Miles Lubin <mlubin@nvidia.com>
Contributor
Author
|
/ok to test 57a51ee |
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.
Claude-assisted refactor.
Renames the
cuopt::linear_programmingumbrella namespace tocuopt::math_optimizationand reorganizes its internals to match the actual architecture. The old name had outgrown its scope (it houses MILP, QP, and conic/barrier solving, not just LP).The public C++ include path moves accordingly:
include/cuopt/linear_programming/→include/cuopt/math_optimization/.New internal structure — one namespace per clash domain, no more
detail:Note
The old
cuopt::linear_programmingnamespace is gone, so C++ consumers mustupdate qualifiers and
#includes. The C API is unchanged (same symbols), and aforwarding shim at
<cuopt/linear_programming/cuopt_c.h>keeps the legacyinclude path working (with a deprecation warning) — C consumers need no changes.
cuopt.linear_programmingPython package keeps its name — only the C++ side is renamed. This leaves a deliberate, temporary cross-language mismatch (C++math_optimizationvs Pythonlinear_programming); renaming the Python package is a separate follow-up and requires more care given it's a public API.problem_t→mip. The core problem representation is used by both PDLP and MIP but defined undermip_heuristics/, so it landed in::mip— meaningpdlpnow referencesmip::problem_t. Accepted for now; a shared-infra home could be revisited later.detailfully eliminated under the umbrella: generic GPU helpers (hashing, launch-dims, double-buffer, segmented-sum) moved to the top-levelcuoptnamespace; module-specific helpers to their module's namespace; file-local helpers to anonymous namespaces.cuopt::detail(different namespace, out of scope), the global-scope::detailin a gRPC serialization header, the vendoredcxxoptslibrary's owndetail, thecpp/tests/linear_programming/directory, and the Cython bridge typecuopt::cython::linear_programming_ret_t.dual_simplexblock /using namespace dual_simplexwhere they instantiate or call genuine simplex templates (explicit template instantiations must live in the template's own namespace).