Skip to content

Fix device=Thrust was very slow for small number of qubits#1497

Closed
doichanj wants to merge 1 commit into
Qiskit:mainfrom
doichanj:fix-thrust-cpu-thread
Closed

Fix device=Thrust was very slow for small number of qubits#1497
doichanj wants to merge 1 commit into
Qiskit:mainfrom
doichanj:fix-thrust-cpu-thread

Conversation

@doichanj
Copy link
Copy Markdown
Collaborator

@doichanj doichanj commented Apr 4, 2022

Summary

This is a fix for device=Thrust, Thrust running on CPU was very slow for small number of qubits.

Details and comments

This was because Thrust CPU always applied OpenMP for threading kernel programs without referring to the number of qubits.
This fix applies OpenMP referring to statevector_parallel_threshold parameter as same as device=CPU.

@doichanj doichanj requested a review from hhorii April 4, 2022 10:17
@hhorii hhorii added the stable-backport-potential The issue or PR might be minimal and/or import enough to backport to stable label Apr 5, 2022
@hhorii hhorii added this to the Aer 0.10.4 milestone Apr 5, 2022
@hhorii
Copy link
Copy Markdown
Collaborator

hhorii commented Apr 5, 2022

on hold until CI is fixed with #1498 or #1500.

hhorii pushed a commit that referenced this pull request Apr 6, 2022
Starting with the recently released qiskit-terra 0.20.0 qiskit only
builds packages on manylinux2014 now. This commit update the wheel jobs
for Aer to install the rust compiler and build terra from source when CI uses 
manylinux2010 for i686 builds.
In manylinux2014 for i686, binary of OpenBLAS is not available and its installation
from source codes is necessary. Installation of rust compiler and terra is a
lot less effort than compiling OpenBLAS.
See the details in #1498.

* Thread control for Thrust CPU is now same as device=CPU

This commit also includes #1497, which fix performance issue in device=Thrust.
A cause of this issue is that Thrust CPU always applied OpenMP for threading
kernel programs without referring to the number of qubits.
This fix applies OpenMP referring to statevector_parallel_threshold parameter
as same as device=CPU.
See the details in #1497.

Co-authored-by: Jun Doi <doichan@jp.ibm.com>
@hhorii
Copy link
Copy Markdown
Collaborator

hhorii commented Apr 6, 2022

This PR was included in #1498.

@hhorii hhorii closed this Apr 6, 2022
hhorii pushed a commit to hhorii/qiskit-aer that referenced this pull request Apr 6, 2022
Starting with the recently released qiskit-terra 0.20.0 qiskit only
builds packages on manylinux2014 now. This commit update the wheel jobs
for Aer to install the rust compiler and build terra from source when CI uses
manylinux2010 for i686 builds.
In manylinux2014 for i686, binary of OpenBLAS is not available and its installation
from source codes is necessary. Installation of rust compiler and terra is a
lot less effort than compiling OpenBLAS.
See the details in Qiskit#1498.

* Thread control for Thrust CPU is now same as device=CPU

This commit also includes Qiskit#1497, which fix performance issue in device=Thrust.
A cause of this issue is that Thrust CPU always applied OpenMP for threading
kernel programs without referring to the number of qubits.
This fix applies OpenMP referring to statevector_parallel_threshold parameter
as same as device=CPU.
See the details in Qiskit#1497.

Co-authored-by: Jun Doi <doichan@jp.ibm.com>
@hhorii hhorii mentioned this pull request Apr 6, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stable-backport-potential The issue or PR might be minimal and/or import enough to backport to stable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants