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

Add cuQuantum-based TFQ native ops and layers #773

Closed
wants to merge 123 commits into from
Closed

Add cuQuantum-based TFQ native ops and layers #773

wants to merge 123 commits into from

Conversation

QuantumJaeYoo
Copy link
Collaborator

This has large changes and requires some deps error, rewrite documentations, and fixed internal bugs inside random ops, and so forth.

Please look at the PR descriptions in my repo to understand the procedures : https://github.com/jaeyoo/quantum/pulls?q=is%3Apr+is%3Aclosed

Breaking Changes

Major Features and Improvements

  • Significant performance improvements by introducing cuQuantum support for circuit execution on Nvidia GPUs:
    • TensorFlow Quantum Keras layers can now be executed on GPU by setting the optional arguement use_cuquantum=True at layer instantiation. Examples:
      • tfq.layers.Expectation(use_cuquantum=True)
      • tfq.layers.SampledExpectation(use_cuquantum=True) (note that cuQuantum runtime is unsupported for any noisy circuit operations
      • tfq.layers.State(use_cuquantum=True)
      • tfq.layers.Sample(use_cuquantum=True)
      • tfq.layers.PQC(model_circuit, operators, use_cuquantum=True)
      • tfq.layers.ControlledPQC(model_circuit, operators, use_cuquantum=True)
    • Important notes:
      • CuQuantum execution is currently only supported for source distributions meaning that the user must build TensorFlow Quantum & tensorFlow-cpu from source following the instructions in install.md.
        • Ensure that the first entry is "N" in the configure.sh script at this step of building. This ensures that you build upon tensorflow-cpu as tensorflow-gpu is unnecessary for CuQuantum support in TensorFlow Quantum.
      • The cuQuantum SDK must be installed locally. See installation instructions for details. As part of the installation process, ensure that the CUQUANTUM_ROOT environment variable is set (referred to in the installation instructions). If not set, bazel will attempt to automatically locate the folder containing the cuQuantum installation upon running configure.sh at this step.
      • Quantum concurrency (global context option) should be turned off when use_cuquantum=True. This can be done by running: tfq.python.quantum_context.set_quantum_concurrent_op_mode(False)

Source: https://github.com/Sinestro38/quantum/blob/master/tensorflow_quantum/release.md
cc: @MichaelBroughton @QuantumJaeYoo

Sinestro38 and others added 30 commits March 29, 2023 06:18
Upgrade bazel version 5.3.0 and fix some typo in tf version (#755)
Sinestro38 and others added 27 commits May 3, 2023 14:21
Fix ./scripts/test_all.sh for CPU mode to be testable and passed
Fix BulkSetAmpl bug, Add more diff cuquantum unit tests
Benchmark tests for cuquantum ops
Disable use_cuquantum with cirq backend
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@google-cla
Copy link

google-cla bot commented May 21, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@QuantumJaeYoo QuantumJaeYoo closed this by deleting the head repository May 21, 2023
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 this pull request may close these issues.

3 participants