arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.22183cs.PL
收藏

面向发散型并行工作负载的编译模型

A Compilation Model for Divergent Parallel Workloads

Stanford University(斯坦福大学);NVIDIA(英伟达);MIT(麻省理工学院);Adobe(奥多比)

Alexander J Root, Christophe Gyurgyik, Devanshu Ladsaria, Rohan Sawhney, Jonathan Ragan-Kelley, Andrew Adams, Matt Pharr, Kayvon Fatahalian, Fredrik Kjolstad

AI总结:

提出并行调度图编译模型,结合可组合变换与调度语言,在空间计算应用中生成的代码性能优于或相当于手动优化实现,且最佳调度随程序、机器和输入变化。

摘要:

在现代并行机器上实现高效执行,不仅需要充足的并行性,还需指令一致性、内存一致性和负载平衡,以最大化SIMD利用率和内存带宽。将发散型并行工作负载(其控制流、内存访问和无界迭代依赖于每个线程的运行时值)高效映射到现代机器,通常需要全局程序重构,这种重构以降低局部性、并行性或增加额外工作为代价,换取一致性的提升。我们发现,用于加速发散型并行程序的关键优化可表示为函数编程和循环优化领域知名程序变换的组合。我们通过并行调度图(parallel dispatch graphs)将这一见解付诸实践:该编译模型通过在单个抽象中表示控制流、逻辑阶段间的数据流以及并行循环,来表示发散型程序。为便于快速探索优化空间中的点,我们提供了一种调度语言,其包含数据依赖控制流和数据流的可组合变换,以及标准循环变换和硬件绑定。这种关注点分离使核心算法保持可移植性,而执行调度可针对目标硬件和输入数据值的具体情况进行定制。我们使用空间计算领域的流行应用评估了我们的系统,结果表明,手动优化的并行树遍历、路径追踪器和蒙特卡洛PDE求解器的优化策略可在我们的系统中作为调度实现。我们生成的代码与手动优化实现相当或更优(几何平均速度提升1.02至2.95倍)。此外,我们通过实验证明,最佳调度会因程序、机器和输入的不同而变化。

英文摘要:

Efficient execution on modern parallel machines requires more than abundant parallelism; it demands instruction coherence, memory coherence, and load balance to maximize SIMD utilization and memory bandwidth. Efficiently mapping \textit{divergent} parallel workloads to modern machines, where control flow, memory accesses, and unbounded iteration depend on per-thread runtime values, often requires global program restructuring that trades off increased coherence with reduced locality, parallelism, or extra work. We observe that the key optimizations used to accelerate divergent parallel programs can be expressed as compositions of well-known program transformations from the functional programming and loop optimization communities. We operationalize this insight through \textit{parallel dispatch graphs}: a compilation model that represents divergent programs by representing control flow, data flow between logical stages, and parallel loops within a single abstraction. To facilitate rapid exploration of points in the optimization space, we provide a scheduling language that includes composable transformations of data-dependent control flow and data flow, together with standard loop transformations and hardware bindings. This separation of concerns allows the core algorithm to remain portable, while the execution schedule can be specialized to the specifics of target hardware and input data values. We evaluate our system using popular applications from the domain of spatial computing, and show that the optimization strategies of hand-optimized parallel tree traversals, path tracers, and Monte Carlo PDE solvers can be reproduced as schedules in our system. Our generated code matches or outperforms the hand-optimized implementations (geomeans $1.02$--$2.95\times$ faster). Additionally, we demonstrate empirically that the best schedule varies across programs, machines, and inputs.

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

↑