一句话:提出 HBC 编译器,将 OpenMP 等 fork-join 并行程序编译为可自动控制并行粒度、适应不规则负载的二进制。
现代语言通过并行循环支持嵌套 fork-join 逻辑并行,但在多核系统上,任务创建与管理开销可能抵消并行收益;不规则、输入敏感的负载更使程序员难以手动调优。本文提出 HBC,首个将带高层 fork-join 构造(如 OpenMP)的 C/C++ 程序编译为二进制的编译器,能自动控制并行成本并处理不规则负载。其基础是 Heartbeat Scheduling,一种带性能形式化保证的自动粒度控制方法。评估表明,即使在完全手工方案也难以平衡并行收益与开销的工作负载上,HBC 生成的二进制仍优于 OpenMP 二进制。
Modern programming languages offer special syntax and semantics for logical fork-join parallelism in the form of parallel loops, allowing them to be nested, e.g., a parallel loop within another parallel loop. This expressiveness comes at a price, however: on modern multicore systems, realizing logical parallelism results in overheads due to the creation and management of parallel tasks, which can wipe out the benefits of parallelism. Today, we expect application programmers to cope with it by manually tuning and optimizing their code. Such tuning requires programmers to reason about architectural factors hidden behind layers of software abstractions, such as task scheduling and load balancing. Managing these factors is particularly challenging when workloads are irregular because their performance is input-sensitive. This paper presents HBC, the first compiler that translates C/C++ programs with high-level, fork-join constructs (e.g., OpenMP) to binaries capable of automatically controlling the cost of parallelism and dealing with irregular, input-sensitive workloads. The basis of our approach is Heartbeat Scheduling, a recent proposal for automatic granularity control, which is backed by formal guarantees on performance. HBC binaries outperform OpenMP binaries for workloads for which even entirely manual solutions struggle to find the right balance between parallelism and its costs.
@inproceedings{SuRWDLADC24,
title = {Compiling Loop-Based Nested Parallelism for Irregular Workloads},
author = {Yian Su and Mike Rainey and Nick Wanninger and Nadharm Dhiantravan and Jasper Liang and Umut A. Acar and Peter Dinda and Simone Campanoni},
booktitle = {ASPLOS},
year = {2024},
doi = {10.1145/3620665.3640405}
}