UniTe: A Universal Tensor Abstraction for Capturing Spatial Relationships
Author(s)
Ray, Jessica; Collin, Teodoro; Sze, Vivienne; Reuther, Albert; Amarasinghe, Saman
Download3787218.pdf (647.6Kb)
Publisher with Creative Commons License
Publisher with Creative Commons License
Creative Commons Attribution
Terms of use
Metadata
Show full item recordAbstract
Tensors are an integral part of numerous domains, and while significant effort has been put into the design of tensor data structures in isolation, little attention has been paid to the relationships that exist across tensors and how this affects their representation and use. In this paper, we focus on spatial relationships across tensors in a program, where such tensors are defined relative to a common reference coordinate system. These relationships are complicated by the fact that the tensors may differ in their representations, such as having variations in their axes, spacings, origins, and overall shape. Due to the lack of existing abstractions and language support for these types of tensor semantics, users are currently forced to manually perform the bookkeeping necessary to account for these varying relationships and representations. Unfortunately, we cannot rely on a simple library to capture these relationships, as computations on these types of tensors often happen at the innermost levels of programs; we find that the overheads associated with an unoptimized implementation quickly accumulate, leading to performance up to nearly 65x slower than a reference C implementation on a series of image and video compression benchmarks. In this paper, we introduce the novel UniTe abstraction, which captures spatial relationships across all such tensors in a program. We also introduce two domain-specific languages and optimizing compilers, CoLa for Python and SHiM for C/C++, built off of UniTe. Both CoLa and SHiM provide users an intuitive set of tensor primitives based on spatial relationships, hiding the complexity that goes into maintaining the tensors and computing accesses across them. In addition, we discuss the optimizations necessary to remove the associated abstraction overhead, and describe their implementations. On the benchmarks, we show that both CoLa and SHiM successfully remove the overheads, achieving performance parity with existing C implementations.
Department
Lincoln Laboratory; Massachusetts Institute of Technology. Department of Electrical Engineering and Computer ScienceJournal
ACM Transactions on Architecture and Code Optimization
Publisher
ACM
Citation
Jessica Ray, Teodoro Collin, Vivienne Sze, Albert Reuther, and Saman Amarasinghe. 2026. UniTe: A Universal Tensor Abstraction for Capturing Spatial Relationships. ACM Trans. Archit. Code Optim. Just Accepted (January 2026).
Version: Final published version
ISSN
1544-3566
Collections
The following license files are associated with this item: