qiskit-optimization
qiskit-optimization copied to clipboard
Parallel Optimization / Fitness evaluation
What is the expected enhancement?
The following enhancements regarding optimization are proposed:
- Parallel optimization restart.
- Implementing an optimizer performing parallel fitness evaluation.
Alternatively an existing solution could be wrapped.
Modern many core CPUs scale very differently dependent on how parallelization is applied. For VQEs BLAS based parallelization can scale quite poorly. If you want to optimize the parameters of a VQE using simulation it may be better to execute the circuit simulation single threaded and call the whole fitness computation in parallel. Or even the whole optimization (parallel restart). In optimizing a VQE I did some comparisons using a 16 core CPU and {'qiskit-terra': '0.21.2', 'qiskit-aer': '0.10.4', 'qiskit-ignis': '0.7.1', 'qiskit-ibmq-provider': '0.19.2', 'qiskit': '0.37.2', 'qiskit-nature': '0.4.4', 'qiskit-optimization': '0.4.0'} based on maxcut applied to a 16 node graph. The results indicate that:
- Parallel fitness evaluation can significantly speed up VQE optimization (> factor 10 for a 16 core CPU on linux compared to serial fitness evaluation).
- Parallel restarts helps testing and comparing optimization algorithms/parameters (> factor 16 for a 16 core CPU on linux compared to serial restart, works with existing algos like SPSA).
Both require that a single simulation is performed single threaded - "backend.set_options(max_parallel_threads=1)". Execute maxcut.py to reproduce.