Contemporary accelerator designs exhibit a high degree of spatial localization, wherein two-dimensional physical distance determines communication costs between processing elements. This situation presents considerable algorithmic challenges, particularly when managing sparse data, a pivotal component in progressing data science. The spatial computer model quantifies communication locality by weighting processor communication costs by distance, introducing a term named energy. Moreover, it integrates depth, a widely-utilized metric, to promote high parallelism. We propose and analyze a framework for efficient spatial tree algorithms within the spatial computer model. Our primary method constructs a spatial tree layout that optimizes the locality of the neighbors in the compute grid. This approach thereby enables locality-optimized messaging within the tree. Our layout achieves a polynomial factor improvement in energy compared to utilizing a PRAM approach. Using this layout, we develop energy-efficient treefix sum and lowest common ancestor algorithms, which are both fundamental building blocks for other graph algorithms. With high probability, our algorithms exhibit near-linear energy and poly-logarithmic depth. Our contributions augment a growing body of work demonstrating that computations can have both high spatial locality and low depth. Moreover, our work constitutes an advancement in the spatial layout of irregular and sparse computations.
翻译:当代加速器设计呈现出高度的空间局部性特征,其中二维物理距离决定了处理单元间的通信成本。这种情况带来了显著的算法挑战,尤其是在处理稀疏数据时——这是推进数据科学的关键组成部分。空间计算模型通过按距离加权处理器通信成本来量化通信局部性,引入了名为“能量”的术语。此外,该模型融合了广泛使用的深度指标以促进高并行性。我们在空间计算模型框架内提出并分析了一套高效的树形空间算法体系。我们的核心方法构建了可优化计算网格中邻居局部性的空间树布局,从而实现了树结构内的局部性优化消息传递。与采用PRAM方法相比,该布局在能量效率上实现了多项式因子提升。基于此布局,我们开发了能量高效的树前缀求和与最近公共祖先算法,这两者都是其他图算法的基础构建模块。在大概率条件下,我们的算法展现出近线性能量消耗与多对数深度。我们的工作丰富了关于计算可同时具备高空间局部性与低深度特性的研究成果,并推动了不规则与稀疏计算空间布局领域的发展。