【24h】

Safe Programmable Speculative Parallelism

机译:安全的可编程投机并行

获取原文
获取原文并翻译 | 示例

摘要

Execution order constraints imposed by dependences can serialize computation, preventing parallelization of code and algorithms. Speculating on the value(s) carried by dependences is one way to break such critical dependences. Value speculation has been used effectively at a low level, by compilers and hardware. In this paper, we focus on the use of speculation by programmers as an algorithmic paradigm to parallelize seemingly sequential code. We propose two new language constructs, speculative composition and speculative iteration. These constructs enable programmers to declaratively express speculative parallelism in programs: to indicate when and how to speculate, increasing the parallelism in the program, without concerning themselves with mundane implementation details. We present a core language with speculation constructs and mutable state and present a formal operational semantics for the language. We use the semantics to define the notion of a correct speculative execution as one that is equivalent to a non-speculative execution. In general, speculation requires a runtime mechanism to undo the effects of speculative computation in the case of mis-predictions. We describe a set of conditions under which such rollback can be avoided. We present a static analysis that checks if a given program satisfies these conditions. This allows us to implement speculation efficiently, without the overhead required for rollbacks. We have implemented the speculation constructs as a C# library, along with the static checker for safety. We present an empirical evaluation of the efficacy of this approach to parallelization.
机译:依赖所施加的执行顺序约束可以使计算序列化,从而防止代码和算法并行化。对依赖关系所携带的值进行推测是打破此类关键依赖关系的一种方法。编译器和硬件已在较低层次上有效地使用了价值推测。在本文中,我们专注于程序员的推测作为算法范式的使用,以并行化看似顺序的代码。我们提出了两种新的语言构造,即投机组合和投机迭代。这些构造使程序员能够在程序中声明性地表达推测性并行性:指示何时以及如何进行推测,从而增加了程序中的并行性,而不必考虑平凡的实现细节。我们提出了具有推测构造和可变状态的核心语言,并提出了该语言的正式操作语义。我们使用语义将正确的推测执行的概念定义为等同于非推测执行的概念。一般而言,在错误预测的情况下,推测需要运行时机制来消除推测计算的影响。我们描述了可以避免这种回滚的一组条件。我们提供一个静态分析,检查给定程序是否满足这些条件。这使我们能够有效地执行推测,而无需回滚所需的开销。为了安全起见,我们已经将推测构造与C#库一起实现为C#库。我们对这种并行化方法的有效性进行了实证评估。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号