Optimizing a stateful dataflow language is a challenging task. There are strict correctness constraints for preserving properties expected by downstream consumers, a large space of possible optimizations, and complex analyses that must reason about the behavior of the program over time. Classic compiler techniques with specialized optimization passes yield unpredictable performance and have complex correctness proofs. But with e-graphs, we can dramatically simplify the process of building a correct optimizer while yielding more consistent results! In this short paper, we discuss our early work using e-graphs to develop an optimizer for a the Hydroflow dataflow language. Our prototype demonstrates that composing simple, easy-to-prove rewrite rules is sufficient to match techniques in hand-optimized systems.
翻译:优化有状态数据流语言是一项具有挑战性的任务。其中存在严格的正确性约束以保持下游消费者期望的性质,存在大量可能的优化空间,以及需要随时间推理程序行为的复杂分析。采用传统编译器中带有专门优化趟的技术会导致不可预测的性能,并具有复杂的正确性证明。然而,借助 e-graph,我们可以显著简化构建正确优化器的过程,同时获得更一致的结果!在这篇短文中,我们讨论了利用 e-graph 为 Hydroflow 数据流语言开发优化器的早期工作。我们的原型证明,组合简单且易于证明的重写规则就足以匹敌手工优化系统中的技术。