Skip to main content
QUICK REVIEW

[论文解读] Efficient Hybrid Execution of C++ Applications using Intel(R) Xeon Phi(TM) Coprocessor

Jǐŕı Dokulil, Enes Bajrović|arXiv (Cornell University)|Nov 23, 2012
Parallel Computing and Optimization Techniques参考文献 9被引用 7
一句话总结

本文提出了一种C++库,通过使用任务并行技术在主机CPU与一个或多个协处理器之间动态分配工作负载,实现了在Intel Xeon Phi协处理器上对C++应用程序的高效混合执行。该方法利用Intel TBB和编译器卸载技术,在单一源代码下实现高性能,展示了在使用光滑粒子流体动力学(SPH)的流体模拟中,最高达2.5倍的加速效果。

ABSTRACT

The introduction of Intel(R) Xeon Phi(TM) coprocessors opened up new possibilities in development of highly parallel applications. The familiarity and flexibility of the architecture together with compiler support integrated into the Intel C++ Composer XE allows the developers to use familiar programming paradigms and techniques, which are usually not suitable for other accelerated systems. It is now easy to use complex C++ template-heavy codes on the coprocessor, including for example the Intel Threading Building Blocks (TBB) parallelization library. These techniques are not only possible, but usually efficient as well, since host and coprocessor are of the same architectural family, making optimization techniques designed for the Xeon CPU also beneficial on Xeon Phi. As a result, highly optimized Xeon codes (like the TBB library) work well on both. In this paper we present a new parallel library construct, which makes it easy to apply a function to every member of an array in parallel, dynamically distributing the work between the host CPUs and one or more coprocessor cards. We describe the associated runtime support and use a physical simulation example to demonstrate that our library construct can be used to quickly create a C++ application that will significantly benefit from hybrid execution, simultaneously exploiting CPU cores and coprocessor cores. Experimental results show that one optimized source code is sufficient to make the host and the coprocessors run efficiently.

研究动机与目标

  • 实现C++应用程序在主机CPU与Xeon Phi协处理器之间的高效混合执行。
  • 通过允许单一源代码同时针对主机和协处理器执行,简化开发流程。
  • 降低在异构系统中管理数据传输、任务调度和工作分配的复杂性。
  • 证明经过优化的可移植C++代码无需采用低级GPU式编程,也能在Xeon Phi上实现高性能。

提出的方法

  • 作者实现了一种新的C++库构造 `offload_for_each`,该构造可并行地在主机和协处理器上对序列的每个元素应用函数。
  • 使用Intel TBB任务调度器动态分配工作负载,以在主机和协处理器核心之间实现负载均衡。
  • 通过双缓冲技术优化主机与协处理器之间的数据传输,降低延迟并提高吞吐量。
  • 该库与Intel C++ Composer XE编译器的卸载支持功能集成,实现主机与协处理器上的无缝编译与执行。
  • 在SPH模拟中使用空间索引结构以优化内存访问模式,减少冗余计算。
  • 采用两阶段流水线设计,使模拟与渲染并行执行,以隐藏延迟。

实验结果

研究问题

  • RQ1是否能够通过单一C++源代码在不进行低级代码特化的情况下,高效利用主机CPU与Xeon Phi协处理器?
  • RQ2在类似CPU-GPU的混合环境中,使用TBB任务调度进行动态工作分配的效率如何?
  • RQ3在Xeon Phi上采用混合执行方式,对SPH等数据并行工作负载能带来多大的性能提升?
  • RQ4与传统CPU相比,内存访问模式和数据布局对Xeon Phi上的性能有何影响?
  • RQ5由于架构相似性,针对Xeon CPU的优化技术是否可有效复用于Xeon Phi?

主要发现

  • 使用 `offload_for_each` 的混合执行模型在使用一个Xeon Phi协处理器时,相比仅在主机上执行,最高可实现2.5倍的加速;在使用两个协处理器时,最高可实现3.5倍的加速。
  • 性能随问题规模增大而提升:粒子数量越多,加速效果越明显,这是由于协处理器并行性的更好利用以及相对数据传输成本的降低。
  • 使用双缓冲技术进行数据传输显著降低了延迟并提高了吞吐量,尤其在流水线化的模拟与渲染工作负载中效果明显。
  • 空间索引结构显著提升了缓存效率并减少了冗余计算,对整体性能提升有重要贡献。
  • 由于应用可在主机上使用标准工具完整运行和监控,因此更易于调试和优化。
  • Xeon与Xeon Phi之间的架构相似性使得现有针对CPU优化的库(如TBB)无需修改即可在协处理器上高效运行。

更好的研究,从现在开始

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

无需绑定信用卡

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