cuQuantum benchmark and integration
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python, pytorch, tensorflow
- Domain
- backend, performance
Research direction
The proposal identifies benchmarking TensorCircuit against cuQuantum, then exploring cuStateVec and cuTensorNet integration; it does not name implementation files or tests. Start by checking the project’s existing simulation backends and benchmark entry points, then review the proposal’s performance and AD/JIT/VMAP requirements. Done means benchmarks establish a baseline and any integration plan addresses the stated compatibility challenges; the proposal leaves the interface and scope open.
Written by the indexing model from the issue text.
Description
TEP - cuQuantum benchmark and integration
Author
@refraction-ray
Status
Draft
Created
2025-02-04
Abstract
This TEP proposes the benchmark and potential integration of NVIDIA cuQuantum libraries into TensorCircuit. This integration will involve benchmarking TensorCircuit and cuQuantum performance, developing interfaces in TensorCircuit to leverage cuQuantum’s optimized functionalities.
Motivation and Scope
TensorCircuit currently provides a versatile platform for quantum circuit simulation, leveraging tensor network techniques for efficient computation. One key question is whether TC provides similar performance compared to optimized cuQuantum package. A set of systematic and carefully designed benchmarks on GPU is necessary. Also note the cuQuantum may be very fragile to support AD/VMAP/JIT features in TC, which is a huge weakness for cuQuantum package.
This TEP aims to:
- Benchmark current TensorCircuit performance: Establish a baseline for performance comparison on relevant quantum circuit simulation tasks using existing TensorCircuit functionalities.
- Benchmark and integrate cuStateVec for state-vector simulations: Develop an interface within TensorCircuit to utilize cuStateVec for state-vector based circuit simulations.
- Benchmark and integrate cuTensorNet for tensor network contraction: Explore and implement integration strategies for cuTensorNet to accelerate tensor network contraction within TensorCircuit.
- Provide a user-friendly interface: Ensure that utilizing cuQuantum is straightforward for TensorCircuit users.
Usage and Impact
Users will be able to leverage cuQuantum acceleration in TensorCircuit by selecting a cuQuantum backend option when creating or running circuits. The exact interface is subject to implementation details, but the goal is to make it as seamless as possible.
Example Usage (Illustrative - API may change):
import tensorcircuit as tc
import numpy as np
# Create a circuit as usual
n_qubits = 20
c = tc.Circuit(n_qubits)
print(tc.cuquantum.expectation_ps(c, z=[1], modes=..., **kws))
Backward compatibility
Related Work
Some hints on the performance from Nvidia side: https://thequantuminsider.com/2023/12/22/nvidia-cuquantum-23-10-accelerating-quantum-computing-with-enhanced-sdk/
Implementation
Before commencing integration, a comprehensive benchmarking phase is essential to establish a performance baseline and accurately measure the impact of cuQuantum. Only if the performance gain is promising, we start the integration phase, where a key focus will be on addressing potential compatibility issues with TensorCircuit's Automatic Differentiation (AD), Just-In-Time compilation (JIT), and Vectorized Map (VMAP) features. We acknowledge that cuQuantum's current capabilities may pose challenges for seamless AD/JIT/VMAP integration.
Alternatives
References
- Dominant language
- Python
- Stars
- 92
- Forks
- 25
- Avg merge
- 21h 12m
- Merged PRs (30d)
- 57
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tensorcircuit/tensorcircuit-ng
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tensorcircuit/tensorcircuit-ng#259 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
tensorcircuit/tensorcircuit-ng#236 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
tensorcircuit/tensorcircuit-ng#176 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
tensorcircuit/tensorcircuit-ng#175 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tensorcircuit/tensorcircuit-ng#174 · 1 comment ·
Maintainers usually reply within 1 day
All issues in tensorcircuit/tensorcircuit-ng
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
OCA/account-invoicing#2529 ·
Maintainers usually reply within 1 day
-
area/ci
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
ImageGen generate-batch aborts valid JSONL jobs containing a Unicode line separator in poster textOpenbug imagen skills
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Email validation accepts a trailing newlinePossibly taken @marcello-pichini claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day