-
Notifications
You must be signed in to change notification settings - Fork 584
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 #774
Conversation
Upgrade bazel version 5.3.0 and fix some typo in tf version (tensorflow#755)
Custatevec support v5
Fix format
Fix format
Version up to 0.8.0
@MichaelBroughton Hi Michael, @Sinestro38 and I could reduce the number of files in this PR for you to review this PR easily. PTAL. |
Just a note, could it make sense to squash-merge instead of merge? Noticed commit history getting cluttered on main |
56a6d59
to
b4c7ea1
Compare
@zaqqwerty Thank you for the idea. I squashed all commits. Could you please also review this PR? |
@zaqqwerty @MichaelBroughton After fixing the merge conflict, the squashed commits reverted... I hope we could use "Squash and merge" button before merging this PR. |
I will split this PR into multiple easier and shorter PRs. |
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
_GLIBCXX_USE_CXX11_ABI=1
. Downstream projects that encounterstd::__cxx11
or[abi:cxx11]
linker errors will need to adopt this compiler option. See the GNU C++ Library docs on Dual ABI.-std=c++17
, see install.md for build instructions.0.13.1
to~=1.0
cirq_google.XMON
was deprecated : [cirq-google] Proposal: Remove XmonDevice, Bristlecone, Foxtail and rename optimize_for_xmon. quantumlib/Cirq#4856QuantumEngineSampler
was deprecated : Deprecate QuantumEngineSampler quantumlib/Cirq#5371cirq.CNOT
interface was changed.cirq.SingleQubitGate
was deprecated.cirq.testing.SingleQubitGate
: https://github.com/quantumlib/Cirq/pull/5272/filescirq.Gate
.Major Features and Improvements
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 operationstfq.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)
tensorFlow-cpu
from source following the instructions in install.md.configure.sh
script at this step of building. This ensures that you build upontensorflow-cpu
astensorflow-gpu
is unnecessary for CuQuantum support in TensorFlow Quantum.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 runningconfigure.sh
at this step.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