一句话:提出允许实数索引的连续张量抽象与代数表达式,并为分段常数张量实现存储格式与自动内核生成。
传统张量模型假定索引为整数,难以直接表达计算几何、计算机图形学等连续域上的计算。本文提出连续张量抽象,允许索引取实数值(如 A[3.14]),并给出定义在连续域上的连续张量代数表达式(如 C x,y = A x,y * B x,y)。实现上聚焦分段常数张量,使无限域可在有限时间内被处理;同时设计新的张量存储格式以高效存储,并提出代码生成技术自动生成内核。这是首次用张量编程语言表达计算几何与图形学等领域的问题。评估在多种应用上与领先库中手工优化内核对比,基于编译器的实现相对 CPU 手写库在 2D 半径搜索上平均加速 9.20×、代码量减少约 60×,在基因组区间重叠查询上加速 1.22×(代码量减少约 18×),在 NeRF 三线性插值上加速 1.69×(代码量减少约 6×)。
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 * 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× on 2D radius search with ∼60× fewer lines of code (LoC), 1.22× on genomic interval overlapping queries (with ∼18× LoC saving), and 1.69× on trilinear interpolation in Neural Radiance Field (with ∼6× LoC saving).
@article{paperbot3000,
title = {The Continuous Tensor Abstraction: Where Indices Are Real},
author = {Jaeyeon Won and Willow Ahrens and Teodoro Fields Collin and Joel S. Emer and Saman Amarasinghe},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA2},
year = {2025},
doi = {10.1145/3763146}
}