Quantum Circuit Simulation by SGEMM Emulation on Tensor Cores and Automatic Precision Selection

Quantum Circuit Simulation by SGEMM Emulation on Tensor Cores and Automatic Precision Selection
复制标题

DOI:
10.48550/arxiv.2303.08989
复制
发表时间:
2023-03
期刊:
ArXiv
影响因子:
--
通讯作者:
Hiryuki Ootomo;Hidetaka Manabe;K. Harada;Rio Yokota
Hiryuki Ootomo;Hidetaka Manabe;K. Harada;Rio Yokota
中科院分区:
其他
文献类型:
--
作者:
Hiryuki Ootomo;Hidetaka Manabe;K. Harada;Rio Yokota

文献摘要

被引文献

相似文献

量子电路模拟为量子算法的开发和量子霸权的验证提供了基础。在量子电路模拟的各种方法中,张量网络收缩由于其能够模拟大量量子位而越来越受欢迎。在张量收缩期间,输入张量被重塑为矩阵并通过 GEMM 操作进行计算,其中这些 GEMM 操作可能达到总计算时间的 90%。 GEMM 吞吐量可以通过利用 Tensor Core 等混合精度硬件来提高,但简单的实现会导致深度和大型量子电路的保真度不足。先前的工作已经证明,即使在使用 TF32 或 FP16 Tensor Core 时,特别注意舍入模式的补偿求和也可以完全恢复 SGEMM 的 FP32 精度。将此类技术应用于量子电路模拟时,指数范围是一个关键问题。虽然 TF32 支持与 FP32 几乎相同的指数范围,但 FP16 支持小得多的指数范围。在这项工作中,我们使用输入张量元素的指数范围统计来选择用于 GEMM 的张量核心。我们在随机电路采样(RCS)(包括 Sycamore 的量子电路)上评估我们的方法,结果表明在保持精度的同时吞吐量最大提高了 1.86 倍。
Quantum circuit simulation provides the foundation for the development of quantum algorithms and the verification of quantum supremacy. Among the various methods for quantum circuit simulation, tensor network contraction has been increasing in popularity due to its ability to simulate a larger number of qubits. During tensor contraction, the input tensors are reshaped to matrices and computed by a GEMM operation, where these GEMM operations could reach up to 90\% of the total calculation time. GEMM throughput can be improved by utilizing mixed-precision hardware such as Tensor Cores, but straightforward implementation results in insufficient fidelity for deep and large quantum circuits. Prior work has demonstrated that compensated summation with special care of the rounding mode can fully recover the FP32 precision of SGEMM even when using TF32 or FP16 Tensor Cores. The exponent range is a critical issue when applying such techniques to quantum circuit simulation. While TF32 supports almost the same exponent range as FP32, FP16 supports a much smaller exponent range. In this work, we use the exponent range statistics of input tensor elements to select which Tensor Cores we use for the GEMM. We evaluate our method on Random Circuit Sampling (RCS), including Sycamore's quantum circuit, and show that the throughput is 1.86 times higher at maximum while maintaining accuracy.