前言
当前主流的基于polyhedral model的deep learning compiler 例如Tensor Comprehensions(Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions)都用到了schedule tree技术,这里简单介绍。
Schedule tree节点类型
Filter node:选择部分statement instances来做schedule
Band node:节点内所有statement instances都进行schedule
sequence与set node:子节点分别是有序和无序执行
Domain node和Context node比较容易理解,上面图中解释已经很清晰了。
mark node:A mark node allows the user to mark specific subtrees of the schedule tree.
extension node:introduce auxiliary computations that are not part of the original iteration domain, which is useful for, e.g., introducing statements copying data to and from shared memory.
Example (from tensor comprehensions):
Schedule tree operation
参考文献Schedule Trees
注:本文主要内容摘自/改编自文中已注释的和下面列出的参考文献等,欢迎大家批评指正。
S. Verdoolaege, S. Guelton, T. Grosser, and A. Cohen. Schedule Trees. In 4th Workshop on
Polyhedral Compilation Techniques (IMPACT, Associated with HiPEAC), page 9, Vienna, Austria,
Jan. 2014.http://impact.gforge.inria.fr/impact2014/papers/impact2014-verdoolaege.pdf
Oleksandr Zinenko, Lorenzo Chelini, Tobias Grosser. Declarative Transformations in the Polyhedral Model. [Research Report] RR-9243, Inria; ENS Paris - Ecole Normale Supérieure de Paris; ETH Zurich; TU Delft; IBM Zürich. 2018. ffhal-01965599f. https://hal.inria.fr/hal-01965599/document
Tensor Comprehensions: Framework-Agnostic High-Performance Machine Learning Abstractions
Polyhedral AST Generation Is More Than Scanning Polyhedra.
Polyhedral Parallel Code Generation for CUDA
https://dl.acm.org/doi/pdf/10.1145/2400682.2400713
Diesel: DSL for linear algebra and neural net computations on gpus