SySTeC: A Symmetric Sparse Tensor Compiler

Radha Patel, Willow Ahrens, Saman Amarasinghe
{"title":"SySTeC: A Symmetric Sparse Tensor Compiler","authors":"Radha Patel, Willow Ahrens, Saman Amarasinghe","doi":"arxiv-2406.09266","DOIUrl":null,"url":null,"abstract":"Symmetric and sparse tensors arise naturally in many domains including linear\nalgebra, statistics, physics, chemistry, and graph theory. Symmetric tensors\nare equal to their transposes, so in the $n$-dimensional case we can save up to\na factor of $n!$ by avoiding redundant operations. Sparse tensors, on the other\nhand, are mostly zero, and we can save asymptotically by processing only\nnonzeros. Unfortunately, specializing for both symmetry and sparsity at the\nsame time is uniquely challenging. Optimizing for symmetry requires\nconsideration of $n!$ transpositions of a triangular kernel, which can be\ncomplex and error prone. Considering multiple transposed iteration orders and\ntriangular loop bounds also complicates iteration through intricate sparse\ntensor formats. Additionally, since each combination of symmetry and sparse\ntensor formats requires a specialized implementation, this leads to a\ncombinatorial number of cases. A compiler is needed, but existing compilers\ncannot take advantage of both symmetry and sparsity within the same kernel. In\nthis paper, we describe the first compiler which can automatically generate\nsymmetry-aware code for sparse or structured tensor kernels. We introduce a\ntaxonomy for symmetry in tensor kernels, and show how to target each kind of\nsymmetry. Our implementation demonstrates significant speedups ranging from\n1.36x for SSYMV to 30.4x for a 5-dimensional MTTKRP over the non-symmetric\nstate of the art.","PeriodicalId":501256,"journal":{"name":"arXiv - CS - Mathematical Software","volume":"9 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-06-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - CS - Mathematical Software","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2406.09266","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Symmetric and sparse tensors arise naturally in many domains including linear algebra, statistics, physics, chemistry, and graph theory. Symmetric tensors are equal to their transposes, so in the $n$-dimensional case we can save up to a factor of $n!$ by avoiding redundant operations. Sparse tensors, on the other hand, are mostly zero, and we can save asymptotically by processing only nonzeros. Unfortunately, specializing for both symmetry and sparsity at the same time is uniquely challenging. Optimizing for symmetry requires consideration of $n!$ transpositions of a triangular kernel, which can be complex and error prone. Considering multiple transposed iteration orders and triangular loop bounds also complicates iteration through intricate sparse tensor formats. Additionally, since each combination of symmetry and sparse tensor formats requires a specialized implementation, this leads to a combinatorial number of cases. A compiler is needed, but existing compilers cannot take advantage of both symmetry and sparsity within the same kernel. In this paper, we describe the first compiler which can automatically generate symmetry-aware code for sparse or structured tensor kernels. We introduce a taxonomy for symmetry in tensor kernels, and show how to target each kind of symmetry. Our implementation demonstrates significant speedups ranging from 1.36x for SSYMV to 30.4x for a 5-dimensional MTTKRP over the non-symmetric state of the art.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
SySTeC:对称稀疏张量编译器
对称和稀疏张量自然出现在线性代数、统计学、物理学、化学和图论等许多领域。对称张量等于它们的转置,因此在 $n$ 维的情况下,我们可以通过避免多余的运算节省高达 $n!另一方面,稀疏张量大部分为零,我们可以通过只处理非转置数来逐渐节省成本。不幸的是,同时针对对称性和稀疏性进行专门化处理具有独特的挑战性。优化对称性需要考虑三角形内核的 $n!$ 转置,这可能会变得复杂且容易出错。考虑多个转置迭代阶数和三角形循环边界也会使复杂的空间传感器格式迭代变得复杂。此外,由于对称性和 sparsetensor 格式的每种组合都需要专门的实现方法,这就导致了大量情况的出现。我们需要一个编译器,但现有的编译器无法在同一个内核中同时利用对称性和稀疏性。在本文中,我们描述了第一个可以为稀疏或结构化张量内核自动生成对称感知代码的编译器。我们介绍了张量核对称性的分类标准,并展示了如何针对每种对称性进行编译。与目前的非对称技术相比,我们的实现大大提高了速度,从 SSYMV 的 1.36 倍到 5 维 MTTKRP 的 30.4 倍不等。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
A prony method variant which surpasses the Adaptive LMS filter in the output signal's representation of input TorchDA: A Python package for performing data assimilation with deep learning forward and transformation functions HOBOTAN: Efficient Higher Order Binary Optimization Solver with Tensor Networks and PyTorch MPAT: Modular Petri Net Assembly Toolkit Enabling MPI communication within Numba/LLVM JIT-compiled Python code using numba-mpi v1.0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1