qiskit-aer icon indicating copy to clipboard operation
qiskit-aer copied to clipboard

Automatically set and save optimal OpenMP and fusion thresholds

Open hhorii opened this issue 3 years ago • 2 comments

Summary

Adds basic profiling code to find suitable threshold values for OpenMP and gate fusion for backend options. This is a revised version of #956.

Details and comments

This PR will add following into to #956.

  • [x] Save optimized parameters into settings.conf
  • [x] Optimize fusion_cost.N

hhorii avatar Mar 17 '21 21:03 hhorii

Once https://github.com/Qiskit/qiskit-terra/pull/5943 is merged, optimized parameters will be able to be store in user config around here: https://github.com/Qiskit/qiskit-aer/blob/9f7b832abf8c74ed6d04d62072ff000deae882ab/qiskit/providers/aer/profile.py#L68-L69 https://github.com/Qiskit/qiskit-aer/blob/9f7b832abf8c74ed6d04d62072ff000deae882ab/qiskit/providers/aer/profile.py#L82-L84

hhorii avatar Mar 22 '21 09:03 hhorii

Here are performance graphs (time_taken includes only transpilation + simulation and excludes interface overheads) with default and tuned configurations.

Configurations:

  • Left: MacBook (2.6 GHz 6-Core Intel Core i7)
    • statevector_parallel_threshold=11
    • fusion_threshold=19
  • Right: Xeon (Intel Xeon Gold 6140 CPU )
    • statevector_parallel_threshold=16
    • fusion_threshold=11

QuantumVolume: image image

IntegerComparator: image image

WeightedAdder: image image

QuadraticForm: image image

QFT: image image

RealAmplitudes with full entanglements image image

RealAmplitudes with linear entanglements image image

Red lines are expected the lowest. Because this profiling function uses QuantumVolume, tuned options do not work for others. However, I believe, these side-effects are acceptables.

hhorii avatar Apr 09 '21 22:04 hhorii