Abstract
High-performance classical simulators for quantum circuits, particularly those utilizing the tensor network contraction (TNC) algorithm, have become vital tools for validating noisy quantum computing. To address the inherent memory limitations of these simulations, the "slicing" technique is employed to reduce tensor dimensions. However, slicing often introduces significant computational overhead that can impede performance. This paper proposes novel lifetime-based methods to mitigate this overhead and enhance computing efficiency. Key contributions include an interpretation method for slicing overhead, an in-place slicing strategy to identify the minimal slicing set, and an adaptive tensor network contraction path refiner tailored for the Sunway architecture. Experimental results demonstrate that the proposed in-place slicing strategy generally incurs less overhead than cotengra, the current industry standard for graph path optimization. The resulting simulation for the Sycamore quantum processor RQC was reduced to 96.1 seconds, achieving a sustainable single-precision performance of 308.6 Pflops using over 41 million cores—a five-fold improvement over the 2021 Gordon Bell Prize-winning work.
Introduction: Overcoming the Memory Wall
Classical simulation of quantum circuits is essential for benchmarking and validating quantum hardware. However, it faces a massive "memory wall." The most efficient algorithm, Tensor Network Contraction (TNC), generates intermediate tensors so large they exceed the memory capacity of even the world's most powerful supercomputers.
To navigate this, researchers use slicing: breaking a large tensor into smaller "slices" that fit within memory. While effective for memory management, slicing introduces "slicing overhead"—redundant calculations that can slow simulations by orders of magnitude. Existing tools like cotengra use heuristics to find slicing sets, but they often struggle to minimize this overhead effectively, particularly when dealing with the complex, multi-level memory hierarchies of modern supercomputers.
Methods: The Lifetime-based Approach
The researchers introduced the concept of Edge Lifetime to provide a theoretical framework for optimizing slicing.
- Lifetime Definition: The "lifetime" of a tensor dimension (an edge in the graph) is defined as the set of all contractions in which that dimension is involved.
- In-place Slicing & Refiner: The authors developed a "slice finder" algorithm that utilizes lifetime data to select edges that minimize redundant work. This is complemented by a Slice Refiner based on Simulated Annealing, which iteratively swaps sliced edges to find a near-optimal set that respects memory constraints while minimizing overhead.
Hardware-Specific Optimizations
To fully leverage the Sunway SW26010pro processor, the team implemented Secondary Slicing. While "primary slicing" handles distributed memory across nodes, secondary slicing manages the 256KB Local Data Memory (LDM) within each core. This transforms memory-intensive kernels into computation-intensive ones, allowing the system to operate closer to its peak theoretical performance. Additionally, they utilized Remote Memory Access (RMA) cooperation to overcome low DMA bandwidth, ensuring continuous and efficient data reading across 64-core groups.
Key Results and Performance
The simulation achieved a record-breaking 308.6 Pflops in single-precision, utilizing over 41 million cores. The system generated 1 million correlated samples for the Sycamore circuit in just 96.1 seconds.
Key performance insights include:
- Efficiency: The slicing strategy outperformed cotengra in 98% of tested cases, often maintaining slicing overhead as low as 1.05 (representing only 5% redundant calculation).
- Scalability: The system demonstrated excellent strong and weak scaling, proving that the lifetime-based method handles massive parallelism without significant degradation.
- Bandwidth Management: By using "secondary slicing" as an optimization tool rather than just a memory necessity, the researchers successfully bypassed the memory bandwidth bottleneck by forcing the processor to perform more operations on smaller data chunks.
Conclusion
This work represents a significant leap in classical quantum circuit simulation, narrowing the gap between classical hardware and quantum processors. While the current optimization uses stochastic Simulated Annealing, which does not guarantee a global optimum, the results are "good enough" to set new world records. The authors suggest that the "lifetime" concept could be extended to other fields relying on tensor networks, such as statistical physics, deep learning optimization, and data science.
Summary updated