-
Notifications
You must be signed in to change notification settings - Fork 364
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
Universal CPU Build Support for Qiskit Aer with CUDA and ROCm #2029
base: main
Are you sure you want to change the base?
Conversation
|
39cb134
to
f91e901
Compare
f91e901
to
4590c10
Compare
…ild can still run on CPU
4590c10
to
cc18d6f
Compare
IMPORTED_BACKEND = None | ||
BACKENDS = ["cuda", "rocm", "cpu"] | ||
|
||
for backend_suffix in BACKENDS: |
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.
One could also add an environment variable to for example force the CPU implementation.
But that can be done in a followup PR.
@doichanj, thanks a lot for looking at this PR! This problem is still very annoying for us because we're maintaining 2 locked environments for CUDA and non-CUDA now. It would be awesome to be able to use one installation that works both on CPU and CUDA. |
I could not build with this PR when setting |
This PR introduces an update to the
qiskit_aer
build process, ensuring that the CPU variant ofcontroller_wrappers
is always built, alongside CUDA and ROCm variants. This ensures that builds targeting CUDA or ROCm can still operate on systems that only have CPU capabilities.Key Changes:
CPU Build as a Default: The CPU backend (
controller_wrappers_cpu
) is now always built. This is independent of whether CUDA (controller_wrappers_cuda
) or ROCm (controller_wrappers_rocm
) backends are being built.Conditional CUDA and ROCm Builds: Compilation of CUDA and ROCm backends remains conditional based on the
AER_THRUST_BACKEND
setting. This ensures that these backends are built only when specified, without affecting the CPU build.Organized Build Process: The build process in
CMakeLists.txt
is organized to handle CPU, CUDA, and ROCm backends separately. Each backend has its specific compiler flags, definitions, and dependencies, ensuring a clean and manageable build process.This update significantly improves the flexibility and applicability of Qiskit Aer, enabling it to run on a broader range of systems, from specialized CUDA and ROCm environments to general-purpose CPU-only machines.
I my case this is useful because we distribute a single environment / container that run both on CPU and GPU machines. ATM
qiskit-aer
is our only dependency that doesn't allow this mode of operation.