-
Notifications
You must be signed in to change notification settings - Fork 163
Expose GPU heuristics tuning parameters via config files #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
51b7e81
7c8b69c
12122a3
cc1b185
5b2da41
04e047b
390be0c
c08115b
21bbd51
42f977d
077fd13
064684c
c1ca3f9
7788f3b
2b29cf6
41a32f3
c189005
102f3af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /* clang-format off */ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| /* clang-format on */ | ||
|
|
||
| #pragma once | ||
|
|
||
| namespace cuopt::linear_programming { | ||
|
|
||
| /** | ||
| * @brief Tuning knobs for MIP GPU heuristics. | ||
| * | ||
| * All fields carry their actual defaults. A config file only needs to list | ||
| * the knobs being changed; omitted keys keep the values shown here. | ||
| * These are registered in the unified parameter framework via solver_settings_t | ||
| * and can be loaded from a config file with load_parameters_from_file(). | ||
| */ | ||
| struct mip_heuristics_hyper_params_t { | ||
| int population_size = 32; // max solutions in pool | ||
| int num_cpufj_threads = 8; // parallel CPU FJ climbers | ||
| double presolve_time_ratio = 0.1; // fraction of total time for presolve | ||
| double presolve_max_time = 60.0; // hard cap on presolve seconds | ||
| double root_lp_time_ratio = 0.1; // fraction of total time for root LP | ||
| double root_lp_max_time = 15.0; // hard cap on root LP seconds | ||
| double rins_time_limit = 3.0; // per-call RINS sub-MIP time | ||
| double rins_max_time_limit = 20.0; // ceiling for RINS adaptive time budget | ||
| double rins_fix_rate = 0.5; // RINS variable fix rate | ||
| int stagnation_trigger = 3; // FP loops w/o improvement before recombination | ||
| int max_iterations_without_improvement = 8; // diversity step depth after stagnation | ||
| double initial_infeasibility_weight = 1000.0; // constraint violation penalty seed | ||
| int n_of_minimums_for_exit = 7000; // FJ baseline local-minima exit threshold | ||
| int enabled_recombiners = 15; // bitmask: 1=BP 2=FP 4=LS 8=SubMIP | ||
| int cycle_detection_length = 30; // FP assignment cycle ring buffer | ||
| double relaxed_lp_time_limit = 1.0; // base relaxed LP time cap in heuristics | ||
| double related_vars_time_limit = 30.0; // time for related-variable structure build | ||
| }; | ||
|
|
||
| } // namespace cuopt::linear_programming |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,37 +79,71 @@ class base_solution_t { | |
|
|
||
| template <typename T> | ||
| struct parameter_info_t { | ||
| parameter_info_t(std::string_view param_name, T* value, T min, T max, T def) | ||
| : param_name(param_name), value_ptr(value), min_value(min), max_value(max), default_value(def) | ||
| parameter_info_t(std::string_view param_name, | ||
| T* value, | ||
| T min, | ||
| T max, | ||
| T def, | ||
| bool is_hyperparameter = false, | ||
|
aliceb-nv marked this conversation as resolved.
Outdated
|
||
| const char* description = "") | ||
| : param_name(param_name), | ||
| value_ptr(value), | ||
| min_value(min), | ||
| max_value(max), | ||
| default_value(def), | ||
| is_hyperparameter(is_hyperparameter), | ||
| description(description) | ||
| { | ||
| } | ||
| std::string param_name; | ||
| T* value_ptr; | ||
| T min_value; | ||
| T max_value; | ||
| T default_value; | ||
| bool is_hyperparameter; | ||
| const char* description; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about adding the description for the purpose of cuopt_cli --help, however, I decided against it in favor of making the names themselves self explanatory. Further more the the macros are defined as strings, we can probably use them as descriptions. Wdyt?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see your point :) I was however a bit worried about the UX - some of these hyperparameters are named after internal implementation details which aren't immediately obvious or clear; this is why I thought a description field could be relevant to help guide tuning efforts (e.g. what results to expect from this "knob") |
||
| }; | ||
|
|
||
| template <> | ||
| struct parameter_info_t<bool> { | ||
| parameter_info_t(std::string_view name, bool* value, bool def) | ||
| : param_name(name), value_ptr(value), default_value(def) | ||
| parameter_info_t(std::string_view name, | ||
| bool* value, | ||
| bool def, | ||
| bool is_hyperparameter = false, | ||
| const char* description = "") | ||
| : param_name(name), | ||
| value_ptr(value), | ||
| default_value(def), | ||
| is_hyperparameter(is_hyperparameter), | ||
| description(description) | ||
| { | ||
| } | ||
| std::string param_name; | ||
| bool* value_ptr; | ||
| bool default_value; | ||
| bool is_hyperparameter; | ||
| const char* description; | ||
| }; | ||
|
|
||
| template <> | ||
| struct parameter_info_t<std::string> { | ||
| parameter_info_t(std::string_view name, std::string* value, std::string def) | ||
| : param_name(name), value_ptr(value), default_value(def) | ||
| parameter_info_t(std::string_view name, | ||
| std::string* value, | ||
| std::string def, | ||
| bool is_hyperparameter = false, | ||
| const char* description = "") | ||
| : param_name(name), | ||
| value_ptr(value), | ||
| default_value(def), | ||
| is_hyperparameter(is_hyperparameter), | ||
| description(description) | ||
| { | ||
| } | ||
| std::string param_name; | ||
| std::string* value_ptr; | ||
| std::string default_value; | ||
| bool is_hyperparameter; | ||
| const char* description; | ||
| }; | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.