The Continuous Tensor Abstraction: Where Indices are Real
This program is tentative and subject to change.
This paper introduces the continuous tensor abstraction, allowing indices to take real-number values (e.g., A[3.14]). It also presents continuous tensor algebra expressions, such as $C_{x,y} = A_{x,y} \ast B_{x,y}$, where indices are defined over a continuous domain. This work expands the traditional tensor model to include continuous tensors. Our implementation supports piecewise-constant tensors, on which infinite domains can be processed in finite time. We also introduce a new tensor format for efficient storage and a code generation technique for automatic kernel generation. For the first time, our abstraction expresses domains like computational geometry and computer graphics in the language of tensor programming. Our approach demonstrates competitive or better performance to hand-optimized kernels in leading libraries across diverse applications. Compared to hand-implemented libraries on a CPU, our compiler-based implementation achieves an average speedup of 9.20$\times$ on 2D radius search with 60$\times$ fewer lines of code (LoC), 1.22$\times$ on genomic interval overlapping queries (with 18$\times$ LoC saving), and 1.69$\times$ on trilinear interpolation in Neural Radiance Field (with 6$\times$ LoC saving).