When confronted with the task of choosing parameter values that might lead to better performance on a model, the long list of Gurobi parameters may seem intimidating. To simplify the process, we include a simple automated parameter tuning tool. For eaxmple, in our Python API, the command to start the parameter tuning tool is model.tune():
import gurobipy as gp
m = gp.read("/opt/gurobi1102/linux64/examples/data/misc07")
m.setParam("TuneCriterion", 0)
m.tune()
The tuning can be controlled with different parameters, for example TuneCriterion=0 focuses on minimizing the time to find a proven optimal solution. Check Parameter Descriptions for further tuning parameters.
Tuning is also available as a standalone program. From a command prompt, you can type:
$ grbtune TuneCriterion=0 /opt/gurobi1102/linux64/examples/data/misc07
The tool tries a number of different parameter settings, and eventually outputs the best ones that it finds. For example:
Tested 14 parameter sets in 26.71s Baseline parameter set: mean runtime 0.93s Default parameters # Name 0 1 2 Avg Max Std Dev 0 MISC07 0.90s 0.92s 0.98s 0.93s 0.98s 0.03 Improved parameter set 1 (mean runtime 0.74s): CoverCuts 1 Presolve 2 # Name 0 1 2 Avg Max Std Dev 0 MISC07 0.71s 0.75s 0.78s 0.74s 0.78s 0.03 Improved parameter set 2 (mean runtime 0.80s): Presolve 2 # Name 0 1 2 Avg Max Std Dev 0 MISC07 0.74s 0.80s 0.86s 0.80s 0.86s 0.05
In this case, it found that setting the Presolve parameter to 2 and the CoverCuts parameter to 1 for model misc07 reduced the average runtime from 0.93 to 0.74.
Note that tuning is meant to give general suggestions for parameters that might help performance. You should make sure that the results it gives on one model are helpful on the full range of models you plan to solve. You may sometimes find that performance problems can't be fixed with parameter changes alone, particularly if your model has severe numerical issues.
Further information
Comments
0 comments
Article is closed for comments.