Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New GPU binaries with cuQuantum support #1854

Merged
merged 15 commits into from
Jul 11, 2023
Merged

Conversation

doichanj
Copy link
Collaborator

@doichanj doichanj commented Jun 26, 2023

Summary

Change supported CUDA version from 10 to 11.2 or higher and support cuQuantum SDK.

Details and comments

Now there are separate binaries for CUDA 11 and CUDA 12:

qiskit-aer-gpu for CUDA 12 and
qiskit-aer-gpu-cu11 for CUDA 11 for backward compatibility

required libraries are automatically installed via pip for each CUDA version.
Thanks to the demo https://github.com/NVIDIA/cuQuantum/tree/main/extra/demo_build_with_wheels

@doichanj doichanj requested a review from hhorii June 27, 2023 02:24
@hhorii
Copy link
Collaborator

hhorii commented Jul 4, 2023

Now there are separate binaries for CUDA 11 and CUDA 12:

qiskit-aer-gpu-cu11 for CUDA 11, and
qiskit-aer-gpu-cu12 for CUDA 12

required libraries are automatically installed via pip for each CUDA version.

Will we deprecate qiskit-aer-gpu?

@hhorii hhorii added the stable-backport-potential The issue or PR might be minimal and/or import enough to backport to stable label Jul 5, 2023
@hhorii hhorii added this to the Aer 0.12.2 milestone Jul 5, 2023
Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with that as a general approach, but I think the most important thing here is what the upgrade path is for existing users of qiskit-aer-gpu. I think we need a release note and more documentation on how an existing qiskit-aer-gpu user will upgrade after this change. I think the answer is as easy as pip uninstall qiskit-aer-gpu && pip install -U qiskit-aer-gpu-cu11, but we need to test this and make it very clear what manual steps are needed.

README.md Outdated Show resolved Hide resolved
Changed supported CUDA version for GPU simulator to 11.2 or higher.
Now GPU binaries are including cuQuantum support. There are separate
binaries for CUDA 11 and 12. qiskit-aer-gpu-cu11 for CUDA 11 and
qiskit-aer-gpu-cu12 for CUDA 12.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's critical we document the upgrade path for existing users of qiskit-aer-gpu here. Users already have enough difficulty navigating the gpu support in aer for whatever reason, so I think we need to explicitly document in this release note how you go from qiskit-aer-gpu to qiskit-aer-gpu-cu11 or qiskit-aer-gpu-cu12 and also put this in the README too.

runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we running out of space with the newer cuda builds?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I observed out of space error without this setting. I tested with some parameters here and I set the safety reserved space

CIBW_SKIP: "*-manylinux_i686 cp310* pp* cp36* *musllinux*"
CIBW_TEST_SKIP: "cp*"
CIBW_ENVIRONMENT: QISKIT_AER_PACKAGE_NAME=qiskit-aer-gpu AER_THRUST_BACKEND=CUDA CUDACXX=/usr/local/cuda/bin/nvcc
CIBW_BEFORE_ALL: "yum install -y yum-utils wget && wget -q https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && rpm -i cuda-repo-rhel7-11-8-local-11.8.0_520.61.05-1.x86_64.rpm && yum clean all && yum -y install cuda && yum -y install openblas-devel && yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo && yum clean all"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you done a test to validate this works in the buildwheel env? We've had a lot of issues in the past with the nvidia packages not actually setting up the compilers correctly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is repository I used for tests. https://github.com/doichanj/qiskit-aer/tree/lite_GPU_package
And I tested installing and running qiskit-aer-gpu from testpypi uploaded by this one

Comment on lines +44 to +48
"nvidia-cuda-runtime-cu11>=11.8.89",
"nvidia-cublas-cu11>=11.11.3.6",
"nvidia-cusolver-cu11>=11.4.1.48",
"nvidia-cusparse-cu11>=11.7.5.86",
"cuquantum-cu11>=23.3.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So these nvidia packages include the dynamic library files for all the cuda symbols we need which is why you exclude them from the repair wheel command?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is the trick to decrease the binary size

doichanj and others added 2 commits July 7, 2023 10:23
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
@hhorii hhorii mentioned this pull request Jul 7, 2023
Comment on lines 3 to 7
- |
Changed supported CUDA version for GPU simulator to 11.2 or higher.
Now GPU binaries are including cuQuantum support. There are separate
binaries for CUDA 11 and 12. qiskit-aer-gpu-cu11 for CUDA 11 and
qiskit-aer-gpu-cu12 for CUDA 12.
Copy link
Member

@mtreinish mtreinish Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- |
Changed supported CUDA version for GPU simulator to 11.2 or higher.
Now GPU binaries are including cuQuantum support. There are separate
binaries for CUDA 11 and 12. qiskit-aer-gpu-cu11 for CUDA 11 and
qiskit-aer-gpu-cu12 for CUDA 12.
- |
Qiskit Aer now requires CUDA version for GPU simulator to 11.2 or
higher. Previously, CUDA 10.1 was the minimum supported version.
This change was necessary because of changes in the upstream CUDA
ecosystem, including cuQuantum support. To support users running
with different versions of CUDA there is now a separate package available
for running with CUDA 11: ``qiskit-aer-gpu-cu11`` and using the
``qiskit-aer-gpu`` package now requires CUDA 12. If you're an existing
user of the ``qiskit-aer-gpu`` package and want to use CUDA 11 you will need to run::
pip uninstall qiskit-aer-gpu && pip install -U qiskit-aer-gpu-cu11
to go from the previously CUDA 10.x compatible ``qiskit-aer-gpu``
package's releases to upgrade to the new CUDA 11 compatible
package. If you're running CUDA 12 locally already you can upgrade
the ``qiskit-aer-gpu`` package as normal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated release note

@hhorii hhorii merged commit 3024b24 into Qiskit:main Jul 11, 2023
34 checks passed
hhorii added a commit to hhorii/qiskit-aer that referenced this pull request Jul 12, 2023
* New GPU binaries with cuQuantum support

* format setup.py

* remove testpipy settings

* Update setup.py to use numpy with version lower than 1.25

* changed package names, qiskit-aer-gpu for CUDA12, and qiskit-aer-gpu-cu11 for 11

* format setup.py

* Update README.md

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Update releasenotes/notes/renew_gpu_binaries-2cf3eba0853b8407.yaml

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* update release note

---------

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
hhorii added a commit that referenced this pull request Jul 12, 2023
* bump version strings and prepare for release

* Remove `AerCircuit` from result of `backend.run()` (#1845)

* take AerCircuit from _metadata in experiment result

* add reno

* Fix rST formatting

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>

* pin numpy version lower than 1.25 (#1859)

* Fix param positions for circuits with conditionals (#1851)

* fix parameter indexing issues.

* fix issues in parameterization of global phase

* add reno

* fix lint

* fix release note

* fix a bug to call _convert_circuit_binds

* add test

* Support save_statevector for QuantumCircuit from QASM3 string (#1846)

* Support save_statevector for QuantumCircuit from QASM3 string

* add qiskit_qasm3_import to requirements-dev.txt

* simplify default_qubits()

* fix lint error

* skip qasm3 circuit test in 3.7

* New GPU binaries with cuQuantum support (#1854)

* New GPU binaries with cuQuantum support

* format setup.py

* remove testpipy settings

* Update setup.py to use numpy with version lower than 1.25

* changed package names, qiskit-aer-gpu for CUDA12, and qiskit-aer-gpu-cu11 for 11

* format setup.py

* Update README.md

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Update releasenotes/notes/renew_gpu_binaries-2cf3eba0853b8407.yaml

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* update release note

---------

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* bump up python version from 3.7 to 3.8 to run cibuildwheel (#1867)

* bump up python version from 3.7 to 3.8 to run cibuildwheel

* bump up all python version in deploy workflow

* add reno

* set numpy version constraint only in dev (#1871)

* add numpy version constraint only in dev

* set numpy version constraint in contraints.txt

* bump up version in docs

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Jun Doi <doichan@jp.ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
hhorii added a commit to hhorii/qiskit-aer that referenced this pull request Aug 9, 2023
* New GPU binaries with cuQuantum support

* format setup.py

* remove testpipy settings

* Update setup.py to use numpy with version lower than 1.25

* changed package names, qiskit-aer-gpu for CUDA12, and qiskit-aer-gpu-cu11 for 11

* format setup.py

* Update README.md

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* Update releasenotes/notes/renew_gpu_binaries-2cf3eba0853b8407.yaml

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>

* update release note

---------

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
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.

3 participants