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

Provide GPU support in released qsimcirq wheel #430

Open
95-martin-orion opened this issue Sep 20, 2021 · 3 comments · May be fixed by #479
Open

Provide GPU support in released qsimcirq wheel #430

95-martin-orion opened this issue Sep 20, 2021 · 3 comments · May be fixed by #479

Comments

@95-martin-orion
Copy link
Collaborator

Currently, qsimcirq users who want to run on GPU must compile the code locally, as the wheels are built on Github Actions runners which do not have the CUDA SDK. Compared to the CPU workflow of pip install qsimcirq, this is incovenient; it would be preferable if GPU support was built into the released wheels.

In order to provide this support, we need to investigate the following options (listed from most to least preferable):

  1. Create an image with the CUDA SDK and use it in the release.
    • Minimizes the impact to our release speed
    • Still need to determine if this is possible in Github Actions
  2. Install the CUDA SDK on the Github Actions runner during each release.
    • Definitely possible in Github Actions (an action exists for installing the SDK)
    • May increase release (not CI) runtime by 10+ minutes
  3. Establish a secondary workflow for releasing the GPU wheels.
    • Allows us to use our own devices with the CUDA SDK pre-installed
    • Increases maintenance costs, and a single wheel would be preferable
@as3232cornell
Copy link

Hello, I was wondering if there is a tutorial on how to use GPU acceleration with qsim circuit simulations in Python (I have a parameterized circuit written in Cirq which is optimized in a python script, and I would like to carry out the circuit evaluations on an NVIDIA GPU). I was also wondering if there is any benchmarking data for what kind of speedup one could expect compared to regular CPU computation.

@95-martin-orion
Copy link
Collaborator Author

We have a tutorial for using GPU acceleration on GCP here: GPU-based quantum simulation on Google Cloud. If you have your own GPU-enabled device that you'd like to use instead, you can follow the instructions in steps 5 and 6 to locally build and verify the GPU version of qsim.

The goal of this issue (which is currently incomplete) is to remove step 5 from the process, so that any GPU-enabled device could simply run pip install qsimcirq and have the GPU version ready to go.

As for benchmarking data: #449 will add detailed info to the site, but on larger circuits (25+ qubits) we've observed GPU simulations completing ~5x faster than CPU simulations of the same circuit.

@95-martin-orion
Copy link
Collaborator Author

Complicating factors identified for implementing option (2) described in the first comment:

  • CUDA must be installed on the runner and be exposed to the cibuildwheel Docker container. Since the image we currently use is required for cross-compatibility, we cannot exchange it for an image with CUDA pre-installed. (CUDA docs also suggest that the host machine must have a GPU to use the CUDA image, further prohibiting this approach)
  • GCP scripts for installing CUDA are not applicable here, as Github Actions runners cannot be rebooted (and are likely different in several other ways).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants