Libfork:使用无栈协程实现可移植的续体窃取
Libfork: portable continuation-stealing with stackless coroutines
AI总结:
本文提出 libfork,利用 C++20 无栈协程和用户态几何分段栈实现可移植、无锁的续体窃取,并在基准测试中显著优于 openMP 与 TBB。
摘要:
全严格 fork-join 并行是共享内存编程的强大模型,因为它具有最优的时间扩展性和很强的内存扩展性界限。后者很少能够实现,原因在于传统高性能计算(HPC)语言中实现续体窃取十分困难——在这些语言中,如果不修改编译器或诉诸不可移植技术,通常无法实现。我们展示了无栈协程(C++20 中的一项新特性)如何能够实现完全可移植的续体窃取,并提出 libfork,这是一个无锁细粒度并行库,将协程与用户态几何分段栈相结合。我们表明,在多种基准测试中,我们的方法在理论上和经验上都能够实现最优的时间/内存扩展性。与 openMP(libomp)相比,libfork 平均快 7.2 倍,并且内存消耗少 10 倍。类似地,与 Intel 的 TBB 相比,libfork 平均快 2.7 倍,并且内存消耗少 6.2 倍。此外,我们为调度器引入了非统一内存访问(NUMA)优化,证明其性能可与忙等调度器相媲美。
英文摘要:
Fully-strict fork-join parallelism is a powerful model for shared-memory programming due to its optimal time scaling and strong bounds on memory scaling. The latter is rarely achieved due to the difficulty of implementing continuation stealing in traditional High Performance Computing (HPC) languages -- where it is often impossible without modifying the compiler or resorting to non-portable techniques. We demonstrate how stackless coroutines (a new feature in C++20) can enable fully-portable continuation stealing and present libfork a lock-free fine-grained parallelism library, combining coroutines with user-space, geometric segmented-stacks. We show our approach is able to achieve optimal time/memory scaling, both theoretically and empirically, across a variety of benchmarks. Compared to openMP (libomp), libfork is on average 7.2x faster and consumes 10x less memory. Similarly, compared to Intel's TBB, libfork is on average 2.7x faster and consumes 6.2x less memory. Additionally, we introduce non-uniform memory access (NUMA) optimizations for schedulers that demonstrate performance matching busy-waiting schedulers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。