Skip to content

Commit 4c419cc

Browse files
Merge pull request NVIDIA#836 from rgsl888prabhu/main-merge-release/26.02_5
Main merge release/26.02 5
2 parents a24b3c6 + 720b823 commit 4c419cc

File tree

21 files changed

+1318
-728
lines changed

21 files changed

+1318
-728
lines changed

benchmarks/linear_programming/cuopt/run_mip.cpp

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ int run_single_file(std::string file_path,
147147
int num_cpu_threads,
148148
bool write_log_file,
149149
bool log_to_console,
150+
int reliability_branching,
150151
double time_limit)
151152
{
152153
const raft::handle_t handle_{};
@@ -196,14 +197,14 @@ int run_single_file(std::string file_path,
196197
}
197198
}
198199
}
199-
200200
settings.time_limit = time_limit;
201201
settings.heuristics_only = heuristics_only;
202202
settings.num_cpu_threads = num_cpu_threads;
203203
settings.log_to_console = log_to_console;
204204
settings.tolerances.relative_tolerance = 1e-12;
205205
settings.tolerances.absolute_tolerance = 1e-6;
206206
settings.presolve = true;
207+
settings.reliability_branching = reliability_branching;
207208
cuopt::linear_programming::benchmark_info_t benchmark_info;
208209
settings.benchmark_info_ptr = &benchmark_info;
209210
auto start_run_solver = std::chrono::high_resolution_clock::now();
@@ -256,6 +257,7 @@ void run_single_file_mp(std::string file_path,
256257
int num_cpu_threads,
257258
bool write_log_file,
258259
bool log_to_console,
260+
int reliability_branching,
259261
double time_limit)
260262
{
261263
std::cout << "running file " << file_path << " on gpu : " << device << std::endl;
@@ -271,6 +273,7 @@ void run_single_file_mp(std::string file_path,
271273
num_cpu_threads,
272274
write_log_file,
273275
log_to_console,
276+
reliability_branching,
274277
time_limit);
275278
// this is a bad design to communicate the result but better than adding complexity of IPC or
276279
// pipes
@@ -354,6 +357,11 @@ int main(int argc, char* argv[])
354357
.help("track allocations (t/f)")
355358
.default_value(std::string("f"));
356359

360+
program.add_argument("--reliability-branching")
361+
.help("reliability branching: -1 (automatic), 0 (disable) or k > 0 (use k)")
362+
.scan<'i', int>()
363+
.default_value(-1);
364+
357365
// Parse arguments
358366
try {
359367
program.parse_args(argc, argv);
@@ -376,12 +384,13 @@ int main(int argc, char* argv[])
376384
std::string result_file;
377385
int batch_num = -1;
378386

379-
bool heuristics_only = program.get<std::string>("--heuristics-only")[0] == 't';
380-
int num_cpu_threads = program.get<int>("--num-cpu-threads");
381-
bool write_log_file = program.get<std::string>("--write-log-file")[0] == 't';
382-
bool log_to_console = program.get<std::string>("--log-to-console")[0] == 't';
383-
double memory_limit = program.get<double>("--memory-limit");
384-
bool track_allocations = program.get<std::string>("--track-allocations")[0] == 't';
387+
bool heuristics_only = program.get<std::string>("--heuristics-only")[0] == 't';
388+
int num_cpu_threads = program.get<int>("--num-cpu-threads");
389+
bool write_log_file = program.get<std::string>("--write-log-file")[0] == 't';
390+
bool log_to_console = program.get<std::string>("--log-to-console")[0] == 't';
391+
double memory_limit = program.get<double>("--memory-limit");
392+
bool track_allocations = program.get<std::string>("--track-allocations")[0] == 't';
393+
int reliability_branching = program.get<int>("--reliability-branching");
385394

386395
if (num_cpu_threads < 0) { num_cpu_threads = omp_get_max_threads() / n_gpus; }
387396

@@ -469,6 +478,7 @@ int main(int argc, char* argv[])
469478
num_cpu_threads,
470479
write_log_file,
471480
log_to_console,
481+
reliability_branching,
472482
time_limit);
473483
} else if (sys_pid < 0) {
474484
std::cerr << "Fork failed!" << std::endl;
@@ -509,6 +519,7 @@ int main(int argc, char* argv[])
509519
num_cpu_threads,
510520
write_log_file,
511521
log_to_console,
522+
reliability_branching,
512523
time_limit);
513524
}
514525

cpp/include/cuopt/linear_programming/constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#define CUOPT_MIP_HEURISTICS_ONLY "mip_heuristics_only"
5858
#define CUOPT_MIP_SCALING "mip_scaling"
5959
#define CUOPT_MIP_PRESOLVE "mip_presolve"
60+
#define CUOPT_MIP_RELIABILITY_BRANCHING "mip_reliability_branching"
6061
#define CUOPT_MIP_CUT_PASSES "mip_cut_passes"
6162
#define CUOPT_MIP_MIXED_INTEGER_ROUNDING_CUTS "mip_mixed_integer_rounding_cuts"
6263
#define CUOPT_MIP_MIXED_INTEGER_GOMORY_CUTS "mip_mixed_integer_gomory_cuts"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class mip_solver_settings_t {
8686
f_t time_limit = std::numeric_limits<f_t>::infinity();
8787
i_t node_limit = std::numeric_limits<i_t>::max();
8888
bool heuristics_only = false;
89+
i_t reliability_branching = -1;
8990
i_t num_cpu_threads = -1; // -1 means use default number of threads in branch and bound
9091
i_t max_cut_passes = 10; // number of cut passes to make
9192
i_t mir_cuts = -1;

cpp/src/dual_simplex/basis_updates.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ class basis_update_mpf_t {
223223
reset_stats();
224224
}
225225

226+
basis_update_mpf_t(const basis_update_mpf_t& other) = default;
227+
basis_update_mpf_t& operator=(const basis_update_mpf_t& other) = default;
228+
226229
void print_stats() const
227230
{
228231
i_t total_L_transpose_calls = total_sparse_L_transpose_ + total_dense_L_transpose_;
@@ -381,6 +384,8 @@ class basis_update_mpf_t {
381384
std::vector<i_t>& nonbasic_list,
382385
std::vector<variable_status_t>& vstatus);
383386

387+
void set_refactor_frequency(i_t new_frequency) { refactor_frequency_ = new_frequency; }
388+
384389
private:
385390
void clear()
386391
{

0 commit comments

Comments
 (0)