Skip to main content
QUICK REVIEW

[论文解读] Optimal (Randomized) Parallel Algorithms in the Binary-Forking Model

Blelloch, Guy E., Fineman, Jeremy T.|arXiv (Cornell University)|Mar 11, 2019
Parallel Computing and Optimization TechniquesComputer Science被引用 35
一句话总结

本文首次在二叉分叉模型中为排序、链表与树压缩、范围最小值查询以及有序集操作等基本并行问题提出了最优工作量与最优跨度的算法。通过利用随机化技术与高效的分治策略,并结合测试并设置原语,作者实现了 O(log n) 的跨度与最优工作量,克服了朴素 PRAM 模拟中出现的 Ω(log n) 跨度开销。

ABSTRACT

In this paper we develop optimal algorithms in the binary-forking model for a variety of fundamental problems, including sorting, semisorting, list ranking, tree contraction, range minima, and ordered set union, intersection and difference. In the binary-forking model, tasks can only fork into two child tasks, but can do so recursively and asynchronously. The tasks share memory, supporting reads, writes and test-and-sets. Costs are measured in terms of work (total number of instructions), and span (longest dependence chain). The binary-forking model is meant to capture both algorithm performance and algorithm-design considerations on many existing multithreaded languages, which are also asynchronous and rely on binary forks either explicitly or under the covers. In contrast to the widely studied PRAM model, it does not assume arbitrary-way forks nor synchronous operations, both of which are hard to implement in modern hardware. While optimal PRAM algorithms are known for the problems studied herein, it turns out that arbitrary-way forking and strict synchronization are powerful, if unrealistic, capabilities. Natural simulations of these PRAM algorithms in the binary-forking model (i.e., implementations in existing parallel languages) incur an $\Omega(\log n)$ overhead in span. This paper explores techniques for designing optimal algorithms when limited to binary forking and assuming asynchrony. All algorithms described in this paper are the first algorithms with optimal work and span in the binary-forking model. Most of the algorithms are simple. Many are randomized.

研究动机与目标

  • 通过在二叉分叉模型中设计在工作量与跨度上均最优的算法,弥合最优 PRAM 算法与其在现代多线程语言中实际实现之间的差距。
  • 解决在二叉分叉模型中模拟 PRAM 算法时固有的性能损失问题,该损失源于任意方式分叉与同步假设所导致的 Ω(log n) 跨度开销。
  • 设计简单、实用且高效的并行算法,以充分利用现代共享内存系统(如 Cilk、TBB 和 Java Fork-Join)中常见的异步性与二叉分叉特性。
  • 探索是否可以在不使用测试并设置的情况下实现最优性能,以及当前依赖随机化的问題是否存在确定性变体。

提出的方法

  • 采用随机化的 nϵ 方式分治方法,通过递归地将问题划分为子问题并在并行中求解,以实现 O(log n) 的跨度。
  • 利用测试并设置(TS)操作,在异步环境中实现高效的同步与协调,这对于在实际系统中实现连接语义至关重要。
  • 将顺序迭代算法的依赖有向无环图(DAG)转换为二叉分叉算法,同时保持 DAG 中最长链的跨度不变。
  • 使用分层稀疏表变体,在对数层级上预计算前缀与后缀最小值,以支持 O(1) 的范围最小值查询,预处理时间为 O(n)。
  • 应用基于欧拉回路的树表示法与链表排序,通过叶优先标记与异步剔除操作实现高效的树压缩。
  • 设计一种异步的、基于标志的激活机制,用于处理树与链表压缩中被推迟的节点,确保以高概率实现 O(log n) 的跨度。

实验结果

研究问题

  • RQ1在缺乏任意方式分叉与严格同步机制的二叉分叉模型中,是否能为排序与范围最小值查询等基本问题实现最优工作量与 O(log n) 跨度?
  • RQ2在朴素模拟 PRAM 算法时,应采用何种算法技术可消除由此产生的 Ω(log n) 跨度开销?
  • RQ3如何将随机化技术与测试并设置操作相结合,以在保持简洁性与实用性的同时实现最优跨度?
  • RQ4能否在不增加跨度的前提下,有效将迭代顺序算法的依赖结构转换为高效的二叉分叉算法?
  • RQ5是否可能在二叉分叉模型中设计出具有最优工作量与跨度的确定性算法,还是说随机化对于在此模型中实现最优跨度是必需的?

主要发现

  • 本文首次在二叉分叉模型中为排序、半排序、链表与树压缩、范围最小值查询以及有序集操作提供了最优工作量与 O(log n) 跨度的算法。
  • 对于排序,该算法以高概率实现 O(n log n) 的工作量与 O(log n) 的跨度,优于该模型中先前的确定性结果。
  • 范围最小值查询算法通过 O(n) 的工作量与 O(log n) 的跨度完成数组预处理,支持 O(1) 的查询时间,采用改进的分层稀疏表结构。
  • 通过使用随机化的叶优先标记与异步剔除操作,树压缩以 O(n) 的工作量与 O(log n) 的跨度(以高概率)实现。
  • 有序集操作(并集、交集、差集)以最优工作量 O(m log(n/m + 1)) 与 O(log n) 的跨度完成,与比较模型中的最佳已知界限一致。
  • 研究结果表明,测试并设置操作在二叉分叉模型中实现最优跨度时至关重要,因为它可在无需显式同步的情况下实现高效的协调。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。