超越vDSP:通过双层寄存器线程组内存分解实现138 GFLOPS的Radix-8 Stockham FFT
Beating vDSP: A 138 GFLOPS Radix-8 Stockham FFT on Apple Silicon via Two-Tier Register-Threadgroup Memory Decomposition
AI总结:
本文提出一种优化的Apple Silicon GPU FFT实现,通过双层本地内存模型实现138.45 GFLOPS性能,比vDSP基准提升29%。采用Radix-8 Split-Radix Stockham内核,发现线程组内存屏障成本低而散列访问是瓶颈。
摘要:
我们提出了一种优化的快速傅里叶变换(FFT)实现,针对Apple Silicon GPU,实现N=4096复数单精度变换的138.45 GFLOPS性能,比Apple的vDSP/Accelerate基准提升29%。我们的方法基于双层本地内存模型,将Apple GPU的208 KiB寄存器文件作为主要数据驻留层,32 KiB线程组内存作为仅交换层。我们实现了Radix-4和Radix-8 Split-Radix Stockham内核,发现Radix-8时域分解蝴蝶内核在512线程下性能最佳。我们进一步研究了Apple的simdgroup_matrix 8×8硬件MMA用于FFT蝴蝶计算,并发现线程组内存屏障成本低(约2个周期),而散列线程组访问模式是真正的瓶颈。多尺寸实现支持N=256到N=16384,通过四步分解处理超过32 KiB线程组内存限制的尺寸。所有内核均通过vDSP参考输出验证。
英文摘要:
We present an optimized Fast Fourier Transform (FFT) implementation for Apple Silicon GPUs, achieving 138.45~GFLOPS for $N\!=\!4096$ complex single-precision transforms -- a 29\% improvement over Apple's highly optimized vDSP/Accelerate baseline (107~GFLOPS). Our approach is grounded in a \emph{two-tier local memory model} that formally characterizes the Apple GPU's 208~KiB register file as the primary data-resident tier and the 32~KiB threadgroup memory as an exchange-only tier, extending the decomposition framework established in a 2015 PhD thesis on Intel integrated GPU FFT for radar processing. We implement and evaluate radix-4 and radix-8 split-radix Stockham kernels in Metal Shading Language (MSL), demonstrating that the radix-8 decimation-in-time butterfly with 512 threads yields the best performance. We further present the first investigation of Apple's \texttt{simdgroup\_matrix} 8$\times$8 hardware MMA for FFT butterfly computation and report the counter-intuitive finding that on Apple GPU, threadgroup memory barriers are inexpensive ($\sim$2 cycles) while scattered threadgroup access patterns are the true bottleneck. Our multi-size implementation supports $N\!=\!256$ through $N\!=\!16384$ using a four-step decomposition for sizes exceeding the 32~KiB threadgroup memory limit. All kernels are validated against vDSP reference outputs.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。