[论文解读] Analysis of Randomized Work Stealing with False Sharing
本文分析了并行计算中随机工作窃取(RWS)的假共享问题,假共享是由缓存一致性协议引起的性能瓶颈。文章引入了分层树算法类及其子类HBP算法,在合理假设下推导出改进的缓存未命中边界,表明当算法结构被设计为最小化处理器间竞争时,RWS即使在存在假共享的情况下也能实现接近最优的性能。
This paper analyzes the cache miss cost of algorithms when scheduled using randomized work stealing (RWS) in a parallel environment, taking into account the effects of false sharing. First, prior analyses (due to Acar et al.) are extended to incorporate false sharing. However, to control the possible delays due to false sharing, some restrictions on the algorithms seem necessary. Accordingly, the class of Hierarchical Tree algorithms is introduced and their performance analyzed. In addition, the paper analyzes the performance of a subclass of the Hierarchical Tree Algorithms, called HBP algorithms, when scheduled using RWS; improved complexity bounds are obtained for this subclass. This class was introduced in a companion paper with efficient resource oblivious computation in mind. Finally, we note that in a scenario in which there is no false sharing the results in this paper match prior bounds for cache misses but with reduced assumptions, and in particular with no need for a bounding concave function for the cost of cache misses as in prior work by Frigo and Strumpen. This allows non-trivial cache miss bounds in this case to be obtained for a larger class of algorithms.
研究动机与目标
- 分析假共享对并行算法中随机工作窃取(RWS)缓存未命中成本的影响。
- 识别能最小化RWS调度中假共享及其性能开销的算法结构。
- 将先前的缓存复杂度边界扩展至包含假共享效应,且减少假设条件,特别是避免对凹函数进行上界约束。
- 为HBP算法(如矩阵乘法、FFT和排序)在RWS调度下提供更紧致、更实用的复杂度边界。
- 证明当通过结构约束考虑假共享时,RWS可对更广泛的算法类别实现接近最优的性能。
提出的方法
- 引入分层树算法类,该类以最小化处理器间写竞争的方式组织计算,从而减少假共享。
- 通过一个细化模型分析其子类HBP(分层平衡并行)算法,该模型同时考虑了因假共享导致的窃取和块未命中。
- 在均匀随机窃取选择的假设下,使用概率分析推导成功窃取次数 $ S $ 的边界,表明以高概率有 $ S = O(p(\frac{b+s}{s}\text{depth} + \frac{b}{s}B\text{depth}))(1+a) $。
- 将缓存未命中成本建模为 $ S $ 的函数,同时包含顺序缓存未命中和因假共享导致的额外块未命中,其中块未命中成本受 $ O(S \times B) $ 限制。
- 通过推导操作数 $ W $、顺序缓存未命中数 $ Q $ 和深度 $ T_{\text{infty}} $,将分析应用于具体算法(如矩阵乘法、FFT、排序和链表归约),并将它们与窃取次数结合。
- 对HBP算法使用边界 $ C(S,n) = O(S) $,对排序使用 $ C(S,n) = O(2^j n / (M^{1/2^j}) \times \text{log} n / \text{log} M) $,以推导出紧致的缓存和块未命中总成本。
实验结果
研究问题
- RQ1假共享如何影响并行算法中随机工作窃取(RWS)的缓存未命中成本?
- RQ2算法的何种结构特性可最小化假共享并提升RWS性能?
- RQ3能否在不需对缓存复杂度函数施加凹上界约束的前提下,为RWS推导出更紧致的缓存未命中边界?
- RQ4HBP算法在RWS下的缓存和块未命中总成本是多少?在何种条件下其性能可与顺序执行相当?
- RQ5当存在假共享时,成功窃取次数如何随处理器数量和算法深度变化?
主要发现
- 对于深度为 $ \log^2 n $ 的算法(如矩阵乘法),以高概率成功窃取次数为 $ O(p \log n [\log n + B]) $,当 $ p(\log^2 n + B \log n) \leq n^3 / M^{3/2} $ 且 $ B^2 \leq M $ 时该结果为最优。
- 对于HBP算法(如矩阵转置和FFT),当 $ pB(\log n + B) \leq n $ 时,缓存和块未命中总成本与顺序缓存未命中成本一致,前提是 $ s = \Theta(b) $ 且 $ a = O(1) $。
- 对于排序算法,当 $ pB \log M (\log \log n + B / \log B) \max\{B, M^{1/2^j}\} \leq n $ 且 $ j = O(1) $ 时,总成本与顺序性能一致,前提条件同上。
- 该分析通过消除对缓存复杂度函数的凹上界约束需求,优于先前工作,使更广泛算法类可获得非平凡边界。
- 由于总问题规模为 $ O(n \log n) $,链表归约算法(迭代排序 $ O(\log n) $ 次)的边界不会比排序差超过 $ O\left(\log n\right) $ 倍。
- 连通分量算法(迭代链表归约 $ O(\log n) $ 次)继承了链表归约的边界,且各次迭代的问题规模相同。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。