-
Notifications
You must be signed in to change notification settings - Fork 153
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
Open
aliceb-nv
wants to merge
18
commits into
NVIDIA:release/26.04
Choose a base branch
from
aliceb-nv:heuristics-basic-tuning
base: release/26.04
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
51b7e81
initial commit, loading and storing
aliceb-nv 7c8b69c
Merge branch 'release/26.04' into heuristics-basic-tuning
aliceb-nv 12122a3
output default values, range, and description of heuristic params to …
aliceb-nv cc1b185
typo
aliceb-nv 5b2da41
unify with cli params
aliceb-nv 04e047b
cleanup
aliceb-nv 390be0c
restore comments
aliceb-nv c08115b
rename to hyper_ prefix
aliceb-nv 21bbd51
Merge branch 'release/26.04' into heuristics-basic-tuning
aliceb-nv 42f977d
remove duplicate fields
aliceb-nv 077fd13
restore RINS' time limit
aliceb-nv 064684c
Merge branch 'release/26.04' into heuristics-basic-tuning
aliceb-nv c1ca3f9
Revert "restore RINS' time limit"
aliceb-nv 7788f3b
review comments
aliceb-nv 2b29cf6
AI review comments
aliceb-nv 41a32f3
read params file before cudaSetDevice setup
aliceb-nv c189005
Merge branch 'release/26.04' into heuristics-basic-tuning
aliceb-nv 102f3af
cmdarg to dump all settings, not just hyper params
aliceb-nv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
cpp/include/cuopt/linear_programming/mip/heuristics_hyper_params.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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")