Skip to content

Commit ac62225

Browse files
Merge branch 'main' into remove-alpha-specs
2 parents 604a72f + 062aed4 commit ac62225

File tree

8 files changed

+24
-52
lines changed

8 files changed

+24
-52
lines changed

cpp/include/cuopt/linear_programming/pdlp/pdlp_warm_start_data.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ struct pdlp_warm_start_data_t {
6767
rmm::cuda_stream_view stream_view);
6868

6969
// Copy constructor for when copying the solver_settings object in the PDLP object
70-
pdlp_warm_start_data_t(const pdlp_warm_start_data_t<i_t, f_t>& other,
71-
rmm::cuda_stream_view stream_view);
70+
pdlp_warm_start_data_t(const pdlp_warm_start_data_t<i_t, f_t>& other);
71+
pdlp_warm_start_data_t& operator=(pdlp_warm_start_data_t<i_t, f_t>&& other) = default;
7272

7373
private:
7474
// Check sizes through assertion

cpp/include/cuopt/linear_programming/pdlp/solver_settings.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ class pdlp_solver_settings_t {
6565
public:
6666
pdlp_solver_settings_t() = default;
6767

68-
// Copy constructor for when copying in the PDLP object
69-
pdlp_solver_settings_t(const pdlp_solver_settings_t& other, rmm::cuda_stream_view stream_view);
7068
/**
7169
* @brief Set both absolute and relative tolerance on the primal feasibility,
7270
dual feasibility and gap.

cpp/src/dual_simplex/diving_queue.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ struct diving_root_t {
3131
};
3232

3333
// A min-heap for storing the starting nodes for the dives.
34-
// This has a maximum size of INT16_MAX, such that the container
34+
// This has a maximum size of 1024, such that the container
3535
// will discard the least promising node if the queue is full.
3636
template <typename i_t, typename f_t>
3737
class diving_queue_t {
3838
private:
3939
std::vector<diving_root_t<i_t, f_t>> buffer;
40-
static constexpr i_t max_size_ = INT16_MAX;
40+
static constexpr i_t max_size_ = 1024;
4141

4242
public:
4343
diving_queue_t() { buffer.reserve(max_size_); }

cpp/src/linear_programming/pdlp.cu

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pdlp_solver_t<i_t, f_t>::pdlp_solver_t(problem_t<i_t, f_t>& op_problem,
6565
step_size_{(f_t)pdlp_hyper_params::initial_step_size_scaling, stream_view_},
6666
step_size_strategy_{handle_ptr_, &primal_weight_, &step_size_, is_batch_mode},
6767
pdhg_solver_{handle_ptr_, op_problem_scaled_, is_batch_mode},
68-
settings_(settings, stream_view_),
68+
settings_(settings),
6969
initial_scaling_strategy_{handle_ptr_,
7070
op_problem_scaled_,
7171
pdlp_hyper_params::default_l_inf_ruiz_iterations,
@@ -313,7 +313,8 @@ std::optional<optimization_problem_solution_t<i_t, f_t>> pdlp_solver_t<i_t, f_t>
313313
}
314314

315315
// Check for concurrent limit
316-
if (settings_.concurrent_halt != nullptr && *settings_.concurrent_halt == 1) {
316+
if (settings_.method == method_t::Concurrent && settings_.concurrent_halt != nullptr &&
317+
*settings_.concurrent_halt == 1) {
317318
#ifdef PDLP_VERBOSE_MODE
318319
RAFT_CUDA_TRY(cudaDeviceSynchronize());
319320
std::cout << "Concurrent Limit reached, returning current solution" << std::endl;

cpp/src/linear_programming/pdlp_warm_start_data.cu

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,20 @@ pdlp_warm_start_data_t<i_t, f_t>::pdlp_warm_start_data_t(
138138
}
139139

140140
template <typename i_t, typename f_t>
141-
pdlp_warm_start_data_t<i_t, f_t>::pdlp_warm_start_data_t(const pdlp_warm_start_data_t& other,
142-
rmm::cuda_stream_view stream_view)
143-
: current_primal_solution_(other.current_primal_solution_, stream_view),
144-
current_dual_solution_(other.current_dual_solution_, stream_view),
145-
initial_primal_average_(other.initial_primal_average_, stream_view),
146-
initial_dual_average_(other.initial_dual_average_, stream_view),
147-
current_ATY_(other.current_ATY_, stream_view),
148-
sum_primal_solutions_(other.sum_primal_solutions_, stream_view),
149-
sum_dual_solutions_(other.sum_dual_solutions_, stream_view),
150-
last_restart_duality_gap_primal_solution_(other.last_restart_duality_gap_primal_solution_,
151-
stream_view),
141+
pdlp_warm_start_data_t<i_t, f_t>::pdlp_warm_start_data_t(const pdlp_warm_start_data_t& other)
142+
: current_primal_solution_(other.current_primal_solution_,
143+
other.current_primal_solution_.stream()),
144+
current_dual_solution_(other.current_dual_solution_, other.current_dual_solution_.stream()),
145+
initial_primal_average_(other.initial_primal_average_, other.initial_primal_average_.stream()),
146+
initial_dual_average_(other.initial_dual_average_, other.initial_dual_average_.stream()),
147+
current_ATY_(other.current_ATY_, other.current_ATY_.stream()),
148+
sum_primal_solutions_(other.sum_primal_solutions_, other.sum_primal_solutions_.stream()),
149+
sum_dual_solutions_(other.sum_dual_solutions_, other.sum_dual_solutions_.stream()),
150+
last_restart_duality_gap_primal_solution_(
151+
other.last_restart_duality_gap_primal_solution_,
152+
other.last_restart_duality_gap_primal_solution_.stream()),
152153
last_restart_duality_gap_dual_solution_(other.last_restart_duality_gap_dual_solution_,
153-
stream_view),
154+
other.last_restart_duality_gap_dual_solution_.stream()),
154155
initial_primal_weight_(other.initial_primal_weight_),
155156
initial_step_size_(other.initial_step_size_),
156157
total_pdlp_iterations_(other.total_pdlp_iterations_),

cpp/src/linear_programming/solve.cu

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,8 +621,8 @@ optimization_problem_solution_t<i_t, f_t> run_pdlp(detail::problem_t<i_t, f_t>&
621621
sol.copy_from(problem.handle_ptr, sol_crossover);
622622
CUOPT_LOG_INFO("Crossover status %s", sol.get_termination_status_string().c_str());
623623
}
624-
if (settings.concurrent_halt != nullptr && crossover_info == 0 &&
625-
sol.get_termination_status() == pdlp_termination_status_t::Optimal) {
624+
if (settings.method == method_t::Concurrent && settings.concurrent_halt != nullptr &&
625+
crossover_info == 0 && sol.get_termination_status() == pdlp_termination_status_t::Optimal) {
626626
// We finished. Tell dual simplex to stop if it is still running.
627627
CUOPT_LOG_INFO("PDLP finished. Telling others to stop");
628628
*settings.concurrent_halt = 1;
@@ -657,8 +657,7 @@ optimization_problem_solution_t<i_t, f_t> run_concurrent(
657657
timer_t timer_concurrent(timer.remaining_time());
658658

659659
// Copy the settings so that we can set the concurrent halt pointer
660-
pdlp_solver_settings_t<i_t, f_t> settings_pdlp(settings,
661-
op_problem.get_handle_ptr()->get_stream());
660+
pdlp_solver_settings_t<i_t, f_t> settings_pdlp(settings);
662661

663662
// Set the concurrent halt pointer
664663
global_concurrent_halt = 0;

cpp/src/linear_programming/solver_settings.cu

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,6 @@
2222

2323
namespace cuopt::linear_programming {
2424

25-
template <typename i_t, typename f_t>
26-
pdlp_solver_settings_t<i_t, f_t>::pdlp_solver_settings_t(const pdlp_solver_settings_t& other,
27-
rmm::cuda_stream_view stream_view)
28-
: tolerances(other.tolerances),
29-
detect_infeasibility(other.detect_infeasibility),
30-
strict_infeasibility(other.strict_infeasibility),
31-
iteration_limit(other.iteration_limit),
32-
time_limit(other.time_limit),
33-
pdlp_solver_mode(other.pdlp_solver_mode),
34-
log_file(other.log_file),
35-
sol_file(other.sol_file),
36-
per_constraint_residual(other.per_constraint_residual),
37-
crossover(other.crossover),
38-
folding(other.folding),
39-
augmented(other.augmented),
40-
dualize(other.dualize),
41-
ordering(other.ordering),
42-
barrier_dual_initial_point(other.barrier_dual_initial_point),
43-
cudss_deterministic(other.cudss_deterministic),
44-
eliminate_dense_columns(other.eliminate_dense_columns),
45-
save_best_primal_so_far(other.save_best_primal_so_far),
46-
first_primal_feasible(other.first_primal_feasible),
47-
pdlp_warm_start_data_(other.pdlp_warm_start_data_, stream_view),
48-
concurrent_halt(other.concurrent_halt),
49-
num_gpus(other.num_gpus)
50-
{
51-
}
52-
5325
template <typename i_t, typename f_t>
5426
void pdlp_solver_settings_t<i_t, f_t>::set_optimality_tolerance(f_t eps_optimal)
5527
{

dependencies.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ files:
4646
test_python:
4747
output: none
4848
includes:
49+
- cuda_version
4950
- py_version
5051
- depends_on_libcuopt
5152
- depends_on_cuopt

0 commit comments

Comments
 (0)