Skip to main content
QUICK REVIEW

[论文解读] SPARK00: A Benchmark Package for the Compiler Evaluation of Irregular/Sparse Codes

Harmen L. A. van der Spek, Erwin M. Bakker|ArXiv.org|May 26, 2008
Parallel Computing and Optimization Techniques参考文献 16被引用 7
一句话总结

SPARK00 是一个基准测试套件,旨在评估优化编译器在不规则和稀疏计算内核上的表现,重点关注指针遍历和间接数组。它将不规则内存访问模式隔离在小型、可分析的内核中,以衡量编译器的有效性,结果表明,由于复杂的间接寻址和分散的内存访问,基于指针的代码从优化中获得的收益远低于基于数组的代码。

ABSTRACT

We propose a set of benchmarks that specifically targets a major cause of performance degradation in high performance computing platforms: irregular access patterns. These benchmarks are meant to be used to asses the performance of optimizing compilers on codes with a varying degree of irregular access. The irregularity caused by the use of pointers and indirection arrays are a major challenge for optimizing compilers. Codes containing such patterns are notoriously hard to optimize but they have a huge impact on the performance of modern architectures, which are under-utilized when encountering irregular memory accesses. In this paper, a set of benchmarks is described that explicitly measures the performance of kernels containing a variety of different access patterns found in real world applications. By offering a varying degree of complexity, we provide a platform for measuring the effectiveness of transformations. The difference in complexity stems from a difference in traversal patterns, the use of multiple indirections and control flow statements. The kernels used cover a variety of different access patterns, namely pointer traversals, indirection arrays, dynamic loop bounds and run-time dependent if-conditions. The kernels are small enough to be fully understood which makes this benchmark set very suitable for the evaluation of restructuring transformations.

研究动机与目标

  • 解决缺乏针对具有动态内存访问模式的不规则、稀疏代码的编译器评估平台的问题。
  • 隔离并衡量特定不规则性特征(如指针追逐和间接数组)对编译器优化有效性的影响。
  • 提供一个轻量级、可分析的内核套件,以支持对优化编译器中重构转换的详细分析。
  • 作为标准化评估框架,用于在不同优化级别和架构之间比较编译器行为。

提出的方法

  • 该基准测试套件包含两个主要子集:一个基于指针遍历(如 SPMATVEC、JACIT),另一个使用间接数组(如 ASM、TRMAT)。
  • 每个内核被设计为表现出特定类型的不规则访问:指针遍历、动态循环边界、运行时依赖的 if 条件,或多重间接寻址。
  • 该框架通过 vars.mk 配置构建系统,以设置编译器标志(CC、CFLAGS),确保在不同配置下的一致编译和计时。
  • 结果存储在 spark.dat 中,条目包含基准 ID、矩阵输入、参考运行时间,以及每种配置下的实测执行时间。
  • 该套件支持在单线程、顺序执行平台上运行,从而在无并行干扰的情况下隔离转换的影响。
  • 以 GCC 4.2.2 在 Intel Itanium 上的案例研究为例,评估了优化级别(-O2、-O3)相对于基线的性能提升,测量了不同访问模式下的加速比。

实验结果

研究问题

  • RQ1与基于数组的间接寻址相比,优化编译器在基于指针的不规则内存访问内核上的表现如何?
  • RQ2诸如循环变换和指令调度等编译器优化在不规则内核上能多大程度上提升性能?
  • RQ3不同不规则性特征(如多重间接寻址或运行时依赖的控制流)如何影响优化的有效性?
  • RQ4在链式数据结构中,内层循环遍历的复杂性对编译器优化有何性能影响?
  • RQ5不同编译器优化级别(-O2 与 -O3)对不规则内核的执行时间有何影响?

主要发现

  • 基于指针的基准测试(如 SPMATVEC、JACIT、MCF)从编译器优化中获得的性能提升显著低于基于数组的基准测试。
  • 具有聚集存储的基于数组的代码(如 ASM、TRMAT)由于更好的数据局部性和顺序访问模式,从优化中获益更多。
  • 基于指针的代码中存在内部遍历,特别是对长链表(如 bcsstk13)的遍历,由于重复的间接寻址和分散的内存访问,严重限制了优化收益。
  • 编译器设置(-O2 与 -O3)在性能上仅表现出微小差异,表明高级优化在不规则模式上的有效性有限。
  • MCF 中广泛使用指针遍历,导致无法实现有意义的优化,所有配置下的加速比均极低。
  • 该基准测试套件成功隔离了不规则性的影响,实现了特定访问模式与编译器优化结果之间的清晰关联。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。