New heuristic improvements#178
Conversation
|
/ok to test 1fb206f |
|
/ok to test 1fb206f |
|
/ok to test b61f302 |
|
/ok to test 4a3a0b5 |
|
/ok to test f057b04 |
aliceb-nv
left a comment
There was a problem hiding this comment.
Thanks for the great work Akif!! Incredible improvement numbers
| line_segment_search.settings = {}; | ||
| bool better_cost_than_parents = | ||
| offspring.get_quality(weights) < | ||
| std::min(other_solution.get_quality(weights), guiding_solution.get_quality(weights)); | ||
| bool better_feasibility_than_parents = offspring.get_feasible() && | ||
| !other_solution.get_feasible() && | ||
| !guiding_solution.get_feasible(); | ||
| bool same_as_parents = | ||
| this->check_if_offspring_is_same_as_parents(offspring, guiding_solution, other_solution); | ||
| // adjust the max_n_of_vars_from_other | ||
| if (n_different_vars > (i_t)ls_recombiner_config_t::max_n_of_vars_from_other) { | ||
| if (same_as_parents) { | ||
| ls_recombiner_config_t::increase_max_n_of_vars_from_other(); | ||
| } else { | ||
| ls_recombiner_config_t::decrease_max_n_of_vars_from_other(); | ||
| } | ||
| } | ||
| if (better_cost_than_parents || better_feasibility_than_parents) { | ||
| CUOPT_LOG_DEBUG("Offspring is feasible or better than both parents"); | ||
| return std::make_pair(offspring, true); | ||
| } |
There was a problem hiding this comment.
Nit: there's a fair amount of commonality in the code between the three recombiners - maybe recombine() could be turned into a member of the parent recombiner_t class? To write this common prologue and epilogue once (maybe using CRTP to call ls/fp/bp_recombiner_config_t members from the parent)
There was a problem hiding this comment.
This is some larger change. Let's do it in another PR. I created an issue on that:
#208
| point_2.data() + solution.problem_ptr->n_variables, | ||
| point_1.data(), | ||
| delta_vector.begin(), | ||
| [] __device__(const f_t& a, const f_t& b) { return a - b; }); |
There was a problem hiding this comment.
Minor nit: I really doubt this has any noticeable effect in practice, but basic scalar types (like int/float/double/char/enums/etc) should be passed by value since passing by const ref/pointer just adds overhead
There was a problem hiding this comment.
This must be either Cursor or some copy paste error. Fixed :)
|
|
||
| #include <cuda_profiler_api.h> | ||
|
|
| DEVICE_LOG_DEBUG( | ||
| "For cstr %d, var %d, value %f was not found in the transpose", constraint_id, col, value); |
There was a problem hiding this comment.
Did you run into a cusparse transpose issue?
There was a problem hiding this comment.
Not related to cusparse, but in integer fixed problem. We are computing the integer fixed problem from the original problem and dynamically fill it, instead of recreating the problem every time. This was to make sure everything matches.
|
/ok to test b7aa9da |
|
/merge |
This PR improves the heuristic quality and performance by following improvements: - Multi Armed Bandit algorithm for learning and selecting the more promising crossovers for a given problem. - Caching the integer-fixed problem and filling that problem structure rather than recreating the problem each time. - Improved bounds prop rounding by doing double probing on a bulk. Which means we propagate two sets of variable values which are promising. This is possible with almost no additional performance hit because most of the data are already in memory. It is only a few more vectors and few more access per propagation. - Update multi probe bounds presolve such that it can take - Diversity level adjustments by time progress. - Weight management such that the best solution is unlikely to be infeasible. We already normalize the weights but this is an added measure to prevent infeasible solutions flooding the population. - Improvement on bounds propagation recombiner, such that we do balanced rounding by trying to represent both parents. This is achieved by passing the probing candidates and counting the used candidates of each parent. - Improvement in all recombiner such that we use at least some objective variables in the recombiners. Before there was no guarantee that there was an objective component in the recombiners. - Dynamic selection of number of different variables used in the recombiners depending on if the recombiner brings the offspring back to one of the parents. - Improvement on line segment recombiner by doing a delta vector only on the subspace of different vars between parents. - Initialize the distance variables in FP to the distance of previous projection. - Improve line segment search such that it does a middle-first, binary search rather than a sequential search of the points. - Improve line segment search solution saving mechanism. - Fix a bug in get_two_random function. - Small improvements in feasibility jump. Added functionalities: - Accepting multiple initial solutions instead of one. - Recombiner and diversity configurations files for better control. - FJ rounding of fractional solutions by adding weights on non-integrality. If within the time limit, all are not rounded, second stage only does rounding moves. The improvements resulted in an average gap to optimality after 10mins on H100: Regular run (B&B and heuristics): from 30% to ~23% Heuristics only: from 33% to ~25% On presolved instances: from 26% to ~19% ## Issue partially closes NVIDIA#140 Authors: - Akif ÇÖRDÜK (https://github.com/akifcorduk) Approvers: - Alice Boucher (https://github.com/aliceb-nv) - Ramakrishnap (https://github.com/rgsl888prabhu) URL: NVIDIA#178
Description
This PR improves the heuristic quality and performance by following improvements:
Added functionalities:
The improvements resulted in an average gap to optimality after 10mins on H100:
Regular run (B&B and heuristics): from 30% to ~23%
Heuristics only: from 33% to ~25%
On presolved instances: from 26% to ~19%
Issue
partially closes #140
Checklist