Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ repos:
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v1.2.1
hooks:
- id: verify-alpha-spec
args:
- --fix
- --mode
- release
- id: verify-copyright
args: [--fix, --spdx]
files: |
Expand Down Expand Up @@ -83,7 +88,5 @@ repos:
entry: python ci/utils/update_doc_versions.py
language: system
files: docs/cuopt/source/versions1.json


default_language_version:
python: python3
python: python3
14 changes: 7 additions & 7 deletions conda/environments/all_cuda-129_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- cuda-python>=12.9.2,<13.0a0
- cuda-sanitizer-api
- cuda-version=12.9
- cudf==25.12.*,>=0.0.0a0
- cudf==25.12.*
- cupy>=13.6.0
- cxx-compiler
- cython>=3.0.3
Expand All @@ -35,8 +35,8 @@ dependencies:
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
- libraft-headers==25.12.*,>=0.0.0a0
- librmm==25.12.*,>=0.0.0a0
- libraft-headers==25.12.*
- librmm==25.12.*
- make
- msgpack-numpy==0.4.8
- msgpack-python==1.1.0
Expand All @@ -53,16 +53,16 @@ dependencies:
- pip
- pre-commit
- psutil>=6.0.0
- pylibraft==25.12.*,>=0.0.0a0
- pylibraft==25.12.*
- pyrsistent
- pytest-cov
- pytest<8
- python>=3.10,<3.14
- rapids-build-backend>=0.4.0,<0.5.0.dev0
- rapids-dask-dependency==25.12.*,>=0.0.0a0
- rapids-logger==0.2.*,>=0.0.0a0
- rapids-dask-dependency==25.12.*
- rapids-logger==0.2.*
- requests
- rmm==25.12.*,>=0.0.0a0
- rmm==25.12.*
- scikit-build-core>=0.10.0
- sphinx
- sphinx-copybutton
Expand Down
14 changes: 7 additions & 7 deletions conda/environments/all_cuda-129_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- cuda-python>=12.9.2,<13.0a0
- cuda-sanitizer-api
- cuda-version=12.9
- cudf==25.12.*,>=0.0.0a0
- cudf==25.12.*
- cupy>=13.6.0
- cxx-compiler
- cython>=3.0.3
Expand All @@ -35,8 +35,8 @@ dependencies:
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
- libraft-headers==25.12.*,>=0.0.0a0
- librmm==25.12.*,>=0.0.0a0
- libraft-headers==25.12.*
- librmm==25.12.*
- make
- msgpack-numpy==0.4.8
- msgpack-python==1.1.0
Expand All @@ -53,16 +53,16 @@ dependencies:
- pip
- pre-commit
- psutil>=6.0.0
- pylibraft==25.12.*,>=0.0.0a0
- pylibraft==25.12.*
- pyrsistent
- pytest-cov
- pytest<8
- python>=3.10,<3.14
- rapids-build-backend>=0.4.0,<0.5.0.dev0
- rapids-dask-dependency==25.12.*,>=0.0.0a0
- rapids-logger==0.2.*,>=0.0.0a0
- rapids-dask-dependency==25.12.*
- rapids-logger==0.2.*
- requests
- rmm==25.12.*,>=0.0.0a0
- rmm==25.12.*
- scikit-build-core>=0.10.0
- sphinx
- sphinx-copybutton
Expand Down
14 changes: 7 additions & 7 deletions conda/environments/all_cuda-130_arch-aarch64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- cuda-python>=13.0.1,<14.0a0
- cuda-sanitizer-api
- cuda-version=13.0
- cudf==25.12.*,>=0.0.0a0
- cudf==25.12.*
- cupy>=13.6.0
- cxx-compiler
- cython>=3.0.3
Expand All @@ -35,8 +35,8 @@ dependencies:
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
- libraft-headers==25.12.*,>=0.0.0a0
- librmm==25.12.*,>=0.0.0a0
- libraft-headers==25.12.*
- librmm==25.12.*
- make
- msgpack-numpy==0.4.8
- msgpack-python==1.1.0
Expand All @@ -53,16 +53,16 @@ dependencies:
- pip
- pre-commit
- psutil>=6.0.0
- pylibraft==25.12.*,>=0.0.0a0
- pylibraft==25.12.*
- pyrsistent
- pytest-cov
- pytest<8
- python>=3.10,<3.14
- rapids-build-backend>=0.4.0,<0.5.0.dev0
- rapids-dask-dependency==25.12.*,>=0.0.0a0
- rapids-logger==0.2.*,>=0.0.0a0
- rapids-dask-dependency==25.12.*
- rapids-logger==0.2.*
- requests
- rmm==25.12.*,>=0.0.0a0
- rmm==25.12.*
- scikit-build-core>=0.10.0
- sphinx
- sphinx-copybutton
Expand Down
14 changes: 7 additions & 7 deletions conda/environments/all_cuda-130_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- cuda-python>=13.0.1,<14.0a0
- cuda-sanitizer-api
- cuda-version=13.0
- cudf==25.12.*,>=0.0.0a0
- cudf==25.12.*
- cupy>=13.6.0
- cxx-compiler
- cython>=3.0.3
Expand All @@ -35,8 +35,8 @@ dependencies:
- libcurand-dev
- libcusolver-dev
- libcusparse-dev
- libraft-headers==25.12.*,>=0.0.0a0
- librmm==25.12.*,>=0.0.0a0
- libraft-headers==25.12.*
- librmm==25.12.*
- make
- msgpack-numpy==0.4.8
- msgpack-python==1.1.0
Expand All @@ -53,16 +53,16 @@ dependencies:
- pip
- pre-commit
- psutil>=6.0.0
- pylibraft==25.12.*,>=0.0.0a0
- pylibraft==25.12.*
- pyrsistent
- pytest-cov
- pytest<8
- python>=3.10,<3.14
- rapids-build-backend>=0.4.0,<0.5.0.dev0
- rapids-dask-dependency==25.12.*,>=0.0.0a0
- rapids-logger==0.2.*,>=0.0.0a0
- rapids-dask-dependency==25.12.*
- rapids-logger==0.2.*
- requests
- rmm==25.12.*,>=0.0.0a0
- rmm==25.12.*
- scikit-build-core>=0.10.0
- sphinx
- sphinx-copybutton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class pdlp_solver_settings_t {
method_t method{method_t::Concurrent};
bool inside_mip{false};
// For concurrent termination
volatile int* concurrent_halt{nullptr};
std::atomic<int>* concurrent_halt{nullptr};
static constexpr f_t minimal_absolute_tolerance = 1.0e-12;

private:
Expand Down
14 changes: 13 additions & 1 deletion cpp/src/dual_simplex/basis_solves.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,8 @@ i_t factorize_basis(const csc_matrix_t<i_t, f_t>& A,
template <typename i_t, typename f_t>
i_t basis_repair(const csc_matrix_t<i_t, f_t>& A,
const simplex_solver_settings_t<i_t, f_t>& settings,
const std::vector<f_t>& lower,
const std::vector<f_t>& upper,
const std::vector<i_t>& deficient,
const std::vector<i_t>& slacks_needed,
std::vector<i_t>& basis_list,
Expand Down Expand Up @@ -658,7 +660,15 @@ i_t basis_repair(const csc_matrix_t<i_t, f_t>& A,
nonbasic_list[nonbasic_map[replace_j]] = bad_j;
vstatus[replace_j] = variable_status_t::BASIC;
// This is the main issue. What value should bad_j take on.
vstatus[bad_j] = variable_status_t::NONBASIC_FREE;
if (lower[bad_j] == -inf && upper[bad_j] == inf) {
vstatus[bad_j] = variable_status_t::NONBASIC_FREE;
} else if (lower[bad_j] > -inf) {
vstatus[bad_j] = variable_status_t::NONBASIC_LOWER;
} else if (upper[bad_j] < inf) {
vstatus[bad_j] = variable_status_t::NONBASIC_UPPER;
} else {
assert(1 == 0);
}
}

return 0;
Expand Down Expand Up @@ -849,6 +859,8 @@ template int factorize_basis<int>(const csc_matrix_t<int, double>& A,

template int basis_repair<int, double>(const csc_matrix_t<int, double>& A,
const simplex_solver_settings_t<int, double>& settings,
const std::vector<double>& lower,
const std::vector<double>& upper,
const std::vector<int>& deficient,
const std::vector<int>& slacks_needed,
std::vector<int>& basis_list,
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/dual_simplex/basis_solves.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ i_t factorize_basis(const csc_matrix_t<i_t, f_t>& A,
template <typename i_t, typename f_t>
i_t basis_repair(const csc_matrix_t<i_t, f_t>& A,
const simplex_solver_settings_t<i_t, f_t>& settings,
const std::vector<f_t>& lower,
const std::vector<f_t>& upper,
const std::vector<i_t>& deficient,
const std::vector<i_t>& slacks_needed,
std::vector<i_t>& basis_list,
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/dual_simplex/basis_updates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2046,6 +2046,8 @@ template <typename i_t, typename f_t>
int basis_update_mpf_t<i_t, f_t>::refactor_basis(
const csc_matrix_t<i_t, f_t>& A,
const simplex_solver_settings_t<i_t, f_t>& settings,
const std::vector<f_t>& lower,
const std::vector<f_t>& upper,
std::vector<i_t>& basic_list,
std::vector<i_t>& nonbasic_list,
std::vector<variable_status_t>& vstatus)
Expand All @@ -2066,7 +2068,7 @@ int basis_update_mpf_t<i_t, f_t>::refactor_basis(
deficient,
slacks_needed) == -1) {
settings.log.debug("Initial factorization failed\n");
basis_repair(A, settings, deficient, slacks_needed, basic_list, nonbasic_list, vstatus);
basis_repair(A, settings, lower, upper, deficient, slacks_needed, basic_list, nonbasic_list, vstatus);

#ifdef CHECK_BASIS_REPAIR
const i_t m = A.m;
Expand Down
2 changes: 2 additions & 0 deletions cpp/src/dual_simplex/basis_updates.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ class basis_update_mpf_t {
// Compute L*U = A(p, basic_list)
int refactor_basis(const csc_matrix_t<i_t, f_t>& A,
const simplex_solver_settings_t<i_t, f_t>& settings,
const std::vector<f_t>& lower,
const std::vector<f_t>& upper,
std::vector<i_t>& basic_list,
std::vector<i_t>& nonbasic_list,
std::vector<variable_status_t>& vstatus);
Expand Down
5 changes: 5 additions & 0 deletions cpp/src/dual_simplex/branch_and_bound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ void branch_and_bound_t<i_t, f_t>::diving_thread(const csr_matrix_t<i_t, f_t>& A
if (get_upper_bound() < start_node->node.lower_bound) { continue; }

bool recompute_bounds_and_basis = true;
i_t nodes_explored = 0;
search_tree_t<i_t, f_t> subtree(std::move(start_node->node));
std::deque<mip_node_t<i_t, f_t>*> stack;
stack.push_front(&subtree.root);
Expand All @@ -1152,6 +1153,8 @@ void branch_and_bound_t<i_t, f_t>::diving_thread(const csr_matrix_t<i_t, f_t>& A

if (toc(exploration_stats_.start_time) > settings_.time_limit) { return; }

if (nodes_explored >= 1000) { break; }

node_solve_info_t status = solve_node(node_ptr,
subtree,
leaf_problem,
Expand All @@ -1165,6 +1168,8 @@ void branch_and_bound_t<i_t, f_t>::diving_thread(const csr_matrix_t<i_t, f_t>& A
start_node->upper,
log);

nodes_explored++;

recompute_bounds_and_basis = !has_children(status);

if (status == node_solve_info_t::TIME_LIMIT) {
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/dual_simplex/branch_and_bound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class branch_and_bound_t {
f_t get_lower_bound();
i_t get_heap_size();
bool enable_concurrent_lp_root_solve() const { return enable_concurrent_lp_root_solve_; }
volatile int* get_root_concurrent_halt() { return &root_concurrent_halt_; }
std::atomic<int>* get_root_concurrent_halt() { return &root_concurrent_halt_; }
void set_root_concurrent_halt(int value) { root_concurrent_halt_ = value; }
lp_status_t solve_root_relaxation(simplex_solver_settings_t<i_t, f_t> const& lp_settings);

Expand Down Expand Up @@ -170,7 +170,7 @@ class branch_and_bound_t {
std::vector<f_t> edge_norms_;
std::atomic<bool> root_crossover_solution_set_{false};
bool enable_concurrent_lp_root_solve_{false};
volatile int root_concurrent_halt_{0};
std::atomic<int> root_concurrent_halt_{0};

// Pseudocosts
pseudo_costs_t<i_t, f_t> pc_;
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/dual_simplex/crossover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ i_t primal_push(const lp_problem_t<i_t, f_t>& lp,
if (rank != m) {
settings.log.debug("Failed to factorize basis. rank %d m %d\n", rank, m);
basis_repair(
lp.A, settings, deficient, slacks_needed, basic_list, nonbasic_list, vstatus);
lp.A, settings, lp.lower, lp.upper, deficient, slacks_needed, basic_list, nonbasic_list, vstatus);
if (factorize_basis(
lp.A, settings, basic_list, L, U, p, pinv, q, deficient, slacks_needed) == -1) {
settings.log.printf("Failed to factorize basis after repair. rank %d m %d\n", rank, m);
Expand Down Expand Up @@ -1132,7 +1132,7 @@ crossover_status_t crossover(const lp_problem_t<i_t, f_t>& lp,
rank = factorize_basis(lp.A, settings, basic_list, L, U, p, pinv, q, deficient, slacks_needed);
if (rank != m) {
settings.log.debug("Failed to factorize basis. rank %d m %d\n", rank, m);
basis_repair(lp.A, settings, deficient, slacks_needed, basic_list, nonbasic_list, vstatus);
basis_repair(lp.A, settings, lp.lower, lp.upper, deficient, slacks_needed, basic_list, nonbasic_list, vstatus);
if (factorize_basis(lp.A, settings, basic_list, L, U, p, pinv, q, deficient, slacks_needed) ==
-1) {
settings.log.printf("Failed to factorize basis after repair. rank %d m %d\n", rank, m);
Expand Down Expand Up @@ -1323,7 +1323,7 @@ crossover_status_t crossover(const lp_problem_t<i_t, f_t>& lp,
factorize_basis(lp.A, settings, basic_list, L, U, p, pinv, q, deficient, slacks_needed);
if (rank != m) {
settings.log.debug("Failed to factorize basis. rank %d m %d\n", rank, m);
basis_repair(lp.A, settings, deficient, slacks_needed, basic_list, nonbasic_list, vstatus);
basis_repair(lp.A, settings, lp.lower, lp.upper, deficient, slacks_needed, basic_list, nonbasic_list, vstatus);
if (factorize_basis(
lp.A, settings, basic_list, L, U, p, pinv, q, deficient, slacks_needed) == -1) {
settings.log.printf("Failed to factorize basis after repair. rank %d m %d\n", rank, m);
Expand Down
Loading
Loading