tensorflow / tensorflow/quantum

[Design] CUDA support

Open
#599 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/gpu help wanted kind/feature-request skill-level/expert
Dominant language
Python
Stars
2.2k
Forks
665
PR merge metrics
No merged PRs in 30d

Description

With early stages of CUDA support starting to make its way into qsim we should investigate registering GPU host devices for our OP kernels so we can give our users GPU accelerated simulation when it makes sense to do so.

Like with our existing ops, we may need to have two different parallelization schemes, one for small circuits where we parallelize over circuits in a batch and one for larger circuits we parallelize across single large wavefunctions. Once the connections have been made we should do an in depth study to determine which scenarios give best performance. This is a large project and will roughly require the following:

  1. Upgrade our qsim dependency to the latest version containing CUDA support (once available)
  2. Add a kokoro CI job that can build on GPUs, since github actions won't let us test / compile on real GPU hardware.
  3. For each of our core ops (expectation, sampled_exctation, sample and state) carry out performance benchmarks under the two parallelization schemes for GPU and provide new OP hardware targets that give the users the best possible performance
  4. Carry out these same tests for the math_ops.
  5. Carry out these tests again for the noise ops.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing qsim PR 366 and the current qsim dependency to determine when CUDA support is available. Then map the expectation, sampled_exctation, sample, state, math_ops, and noise operations, add a Kokoro GPU build job, and benchmark both parallelization schemes; done means GPU hardware targets and documented performance choices are provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
backend, ci-cd, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.