量子电路模拟中内存层次过渡的受控研究:基于苹果M4 Pro统一内存架构
A Controlled Study of Memory Hierarchy Transitions in Quantum Circuit Simulation on Apple M4 Pro Unified Memory Architecture
AI总结:
本文通过苹果M4 Pro统一内存架构研究量子电路模拟中的内存层次过渡,发现内存带宽限制及非连续内存访问模式对模拟速度的影响,揭示了内存带宽与计算性能之间的关系。
摘要:
状态向量量子电路模拟受到内存带宽的限制,但内存层次、访问模式和硬件并行性之间的相互作用仍未完全明确。我们利用苹果M4 Pro统一内存架构(UMA),其中CPU和GPU共享相同的物理LPDDR5X DRAM(两者均约为224 GB/s的STREAM带宽),消除了内存技术和互连的混淆因素。通过在11个模拟后端上对GHZ和QFT电路(从3到30个量子比特)进行热隔离、多轮测试,我们做出了三个核心贡献。首先,Roofline分析证实所有门实现的算术强度≤0.38 FLOP/byte,远低于现代硬件的任何可能峰值计算的 ridge 点,确立了结构内存限制性。其次,我们识别出在28→29个量子比特过渡处可重复的4.46倍时间不连续性,在热隔离条件下确认,并在GHZ和QFT电路中交叉验证;tensordot后端表现出完整的不连续性,而direct-index后端在整个过程中保持约2倍的每量子比特缩放。第三,尽管STREAM预测只有1.85倍的GPU加速(MLX CPU 119.9 GB/s vs. MLX GPU 221.9 GB/s),所有三个算法类别均超过了这一预测:tensordot 3.1-4.1倍,flat-index 3.5-5.9倍,direct-index 6-10倍,表明峰值流带宽不预测非连续内存访问模式的模拟加速,随着访问不规则性增加,差距扩大。这些发现为量子模拟工作负载在UMA上的硬件特性框架提供了依据。
英文摘要:
State-vector quantum circuit simulation is memory-bandwidth bound, yet the interaction between memory hierarchy, access pattern, and hardware parallelism remains incompletely characterized. We address this using the Apple M4 Pro Unified Memory Architecture (UMA), where CPU and GPU share identical physical LPDDR5X DRAM ($\sim$224 GB/s STREAM bandwidth for both), eliminating memory-technology and interconnect confounds. Using a thermally isolated, multi-trial methodology across 11 simulation backends on GHZ and QFT circuits from 3 to 30 qubits, we make three central contributions. First, a Roofline analysis confirms all gate implementations have arithmetic intensity $\leq$0.38 FLOP/byte, well below the ridge point for any plausible peak compute on modern hardware, establishing structural memory-boundedness. Second, we identify a reproducible 4.46$\times$ timing discontinuity at the 28$\rightarrow$29 qubit transition, confirmed under thermally isolated conditions and cross-validated across GHZ and QFT circuits; tensordot backends exhibit the full discontinuity while direct-index backends maintain $\sim$2$\times$ per-qubit scaling throughout. Third, despite STREAM predicting only 1.85$\times$ GPU speedup (MLX CPU 119.9 GB/s vs. MLX GPU 221.9 GB/s), all three algorithm classes exceed this prediction: tensordot 3.1--4.1$\times$, flat-index 3.5--5.9$\times$, and direct-index 6--10$\times$, demonstrating that peak streaming bandwidth does not predict simulation speedup for non-contiguous memory access patterns, with the gap widening as access irregularity increases. These findings provide a hardware-characterization framework for quantum simulation workloads on UMA.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。