Pure tensor program rewriting via access patterns (representation pearl)
Gus Henry Smith, Andrew M. Liu, Steven Lyubomirsky, Scott Davidson, Joseph McMahan, Michael Bedford Taylor, Luís Ceze, Zachary Tatlock · 2021
Tensor kernels in machine learning (ML) often correspond to pure mathematical expressions, making term rewriting an attractive strategy for optimization and mapping to specialized hardware accelerators. However, existing ML intermediate representations (IRs) tend to either be pure but high-level, making low-level rewrites to hardware targets inexpressible, or low-level but impure, hampering the use of term rewriting altogether.