arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2301.11559quant-phcs.DC
收藏

在异构量子-经典编程模型中启用多线程

Enabling Multi-threading in Heterogeneous Quantum-Classical Programming Models

Akihiro Hayashi, Austin Adams, Jeffrey Young, Alexander McCaskey, Eugene Dumitrescu, Vivek Sarkar, Thomas M. Conte

AI总结:

本文在QCOR编程模型中引入基于C++的多线程与异步并行结构,通过增强线程安全性和消除数据竞争提升量子-经典异构平台的并行性能,实验表明并行执行多个量子内核可显著加速并改善强可扩展性。

摘要:

在本文中,我们解决了实现面向量子-经典异构平台的通用异构并行编程模型所面临的一些关键限制。我们讨论了在QCOR中启用用户级多线程的经验,以及为未来量子-经典系统编程所需应对的挑战。具体而言,我们讨论了引入基于C++的并行结构的设计与实现,以支持:1)使用std::thread并行执行量子内核;2)使用std::async进行异步执行。为此,我们详细概述了QCOR编程模型和运行时的当前实现,并讨论了我们如何:1)为其部分面向用户的API例程增加线程安全性;2)通过消除阻碍多线程的数据竞争来提高QCOR的并行性,从而更好地利用可用计算资源。我们还展示了在单节点Ryzen9 3900X机器上使用Quantum++后端获得的初步性能结果,该机器具有12个物理核心(24个硬件线程)和128GB内存。结果表明,以每个内核12个线程并行运行两个Bell内核,优于以每个内核24个线程依次运行这两个内核(性能提升1.63倍)。此外,在并行运行两个Shor算法内核时,我们观察到相同的趋势(比依次执行内核快1.22倍)。而且,并行版本在强可扩展性方面表现更好。我们相信,我们的设计、实现和结果不仅将在短期内为在量子电路模拟器上更快地原型化并行/异步感知的量子-经典算法创造机会,而且从长远来看,还将为实现面向量子-经典异构平台的通用异构并行编程模型开辟可能。

英文摘要:

In this paper, we address some of the key limitations to realizing a generic heterogeneous parallel programming model for quantum-classical heterogeneous platforms. We discuss our experience in enabling user-level multi-threading in QCOR as well as challenges that need to be addressed for programming future quantum-classical systems. Specifically, we discuss our design and implementation of introducing C++-based parallel constructs to enable 1) parallel execution of a quantum kernel with std::thread and 2) asynchronous execution with std::async. To do so, we provide a detailed overview of the current implementation of the QCOR programming model and runtime, and discuss how we add 1) thread-safety to some of its user-facing API routines, and 2) increase parallelism in QCOR by removing data races that inhibit multi-threading so as to better utilize available computing resources. We also present preliminary performance results with the Quantum++ back end on a single-node Ryzen9 3900X machine that has 12 physical cores (24 hardware threads) with 128GB of RAM. The results show that running two Bell kernels with 12 threads per kernel in parallel outperforms running the kernels one after the other each with 24 threads (1.63x improvement). In addition, we observe the same trend when running two Shor's algorthm kernels in parallel (1.22x faster than executing the kernels one after the other). Furthermore, the parallel version is better in terms of strong scalability. We believe that our design, implementation, and results will open up an opportunity not only for 1) enabling quicker prototyping of parallel/asynchrony-aware quantum-classical algorithms on quantum circuit simulators in the short-term, but also for 2) realizing a generic heterogeneous parallel programming model for quantum-classical heterogeneous platforms in the long-term.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑