Introduction
Optimization is a computationally intensive task, and therefore the hardware that is used to perform the optimization has an impact on the performance of the optimization. However, finding the best hardware for a particular setup is challenging and depends on a lot of factors. Therefore please contact our Experts team for any additional questions.
General rules of thumb
- Parallelization effects are model-dependent: Gurobi consists of various algorithms that are combined to return an optimal solution to the optimization problem. Some of these algorithms parallelize well, while others do not parallelize at all. Even when an algorithm parallelizes well, the distribution of work on different threads may be uneven, and therefore, additional threads may not lead to a speedup.
- The faster the CPU, the better: CPUs with high clock speeds generally provide better performance than equivalent CPUs with lower clock speeds.
- RAM requirements are model-dependent: Some models, even if modest in size, require a tremendous amount of memory to be solved, while other, much larger models, do not. It is impossible to predict beforehand how much memory is needed.
- More RAM does not improve performance: The solver's decisions do not depend on the amount of available memory, so more memory does not improve performance. The only situations where this statement does not hold are when there is insufficient memory for the solution process, and the operating system uses disk storage to extend the memory (swapping). Such situations should be avoided by all means.
- Larger CPU caches are better: Since the solution process is very memory-intensive, continuously copying model data from main memory to the CPU and back, larger Level-1/2/3 CPU caches usually help to improve performance.
- Higher memory bandwidth is better: Similar to the previous argument, higher memory bandwidth between main memory and CPU reduces waiting times at the CPU, especially for large-scale models.
- GPUs may help: With recent developments in first-order methods, Gurobi is actively investigating the use of this hardware. Our current assessment can be found in:
Hardware sizing guidelines
When selecting hardware for optimization, there are two main considerations:
- How many cores and how much RAM should be available for each optimization run?
- How many optimization runs will occur in parallel on the same machine?
While the answer to the second question is often relatively easy, answering the first one requires testing, as the impact is model-dependent (see above). When performing these tests, it is crucial to utilize a wide range of instances to ensure that the obtained results are robust and represent an accurate picture of the expected load on the system. Please refer to the dedicated article about this topic.
In addition, it is crucial to account for any other potential processes that may be requiring computational resources when an optimization job is ongoing. As a result, we generally recommend allocating dedicated hardware for solving optimization problems.
Further information
- How does Gurobi perform on different computer hardware?
- Why does Gurobi perform differently on different machines?
- How do I avoid an out-of-memory condition?
- Is there a way to predict how long it will take Gurobi to solve a MIP?
- What are cores and threads?
- How many cores does my model need?