-
Notifications
You must be signed in to change notification settings - Fork 378
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
Avoid accessing GPUs when using CPU only #2012
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hhorii
approved these changes
Dec 8, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting available devices in C++ controller looks reasonable.
Merged
doichanj
added a commit
to doichanj/qiskit-aer
that referenced
this pull request
Jan 16, 2024
* avoid accessing GPUs when using CPU only * remove unused import/parameter
doichanj
added a commit
that referenced
this pull request
Jan 17, 2024
* PR to release 0.13.2 * Remove usage of ``qiskit.extensions`` (#2023) The module has been pending deprecation since Qiskit 0.45. It is deprecated for 0.46 and removed in 1.0. This removal concerns the import location of ``UnitaryGate`` and the usage of the ``ExtensionError``. The first is easily fixed, whereas for the latter I tried using ``ValueError`` or ``TypeError``, which seemed to cover the error meanings. Technically, this is a breaking change and we could introduce an intermediary class that inherits from the deprecated ``ExtensionError`` and the new choice of error. However, since we will soon be changing to 1.0 and we also skipped this in Qiskit Terra (as we thought it highly unlikely that users are actually relying on this error type) it might be fine to just change the error type. * Fix GPU batched execution (#2014) * Fix GPU batched execution * format * Use Apple-specific API to determine system memory on macOS (#2016) The unistd.h API that had been used for both Linux and macOS is not always available in macOS environments, for example when building with upstream clang rather than AppleClang. Closes #1923 * Remove qiskit.test from test/common.py (#1971) * remove qiskit.test from test/common.py * fix format, add releasenote --------- Co-authored-by: Hiroshi Horii <[email protected]> * raise Qiskit dependency to 0.45.0 (#2008) Co-authored-by: Hiroshi Horii <[email protected]> * `deprecate_func(..., since=...)` should be a string, not a float (#2006) * deprecate_func "since" parameter should be a str, not a float * black * Avoid accessing GPUs when using CPU only (#2012) * avoid accessing GPUs when using CPU only * remove unused import/parameter * Reduce warning meesages (#2013) * reduce warning meesages * format * fix Windows * uint -> uint_t * fix Thrust seg fault * format * Add support for running with Python 3.12 (#2022) * Add support for running with Python 3.12 Python 3.12.0 was released on 10-02-2023, this commit marks the start of support for Python 3.12 in qiskit-aer. It adds the supported Python version in the package metadata and updates the CI configuration to run test jobs on Python 3.12 and build Python 3.12 wheels on release. * Remove numpy constraints * Uncap six * Fix i686 build steps * Use python 3.12.0 in tests to work around unittest breakage in 3.12.1 * Use 3.12.0 for all test jobs --------- Co-authored-by: Jun Doi <[email protected]> * enable bit operations for boolean types (#2024) Co-authored-by: Jun Doi <[email protected]> --------- Co-authored-by: Julien Gacon <[email protected]> Co-authored-by: Will Shanks <[email protected]> Co-authored-by: Hiroshi Horii <[email protected]> Co-authored-by: Luciano Bello <[email protected]> Co-authored-by: Matthew Treinish <[email protected]>
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Changelog: Bugfix
Include in the Fixed section of the changelog
stable-backport-potential
The issue or PR might be minimal and/or import enough to backport to stable
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is fix for issue #1686
Details and comments
Aer queried available methods and devices by testing with simple circuit whether it successfully runs or not everytime when AerSimulator is initialized. So in the initialization phase, Aer accesses GPUs even if users only need to run on CPU.
In this PR, devices are queried to C++ binary if it is built for GPU or not.
And methods are listed in Python side.
Aer accessed all the available GPUs at the initialization phase. In this PR, only GPUs set in
target_gpus
options are accessed when usingdevice="GPU"
option.