Array-of-structures (AoS) to structure-of-arrays (SoA) is a classic compiler transformation that improves memory locality and enables data-parallel execution. Existing AoS-to-SoA transformations primarily target regular, array-based programs in imperative languages like C and C++. In contrast, many applications manipulate tree-shaped data structures, for example, ASTs in compilers, DOM trees in browsers, and k-d trees in scientific workloads. Prior work improves the performance of functional programs operating on such data by serializing algebraic datatypes (ADTs) into contiguous memory buffers. However, these representations interleave fields within a single buffer, similar to AoS layouts. We introduce factored, multi-buffer layouts that store different ADT fields in separate buffers, enabling SoA-like layouts for serialized recursive data structures. We formalize this approach in SoCal, a language for generating factored ADT representations, and implement it in a compiler called Colobus. Colobus automatically transforms functional programs to operate over a serialized, factored layout of recursive ADTs. Our evaluation shows a 1.46x geometric mean speedup on a suite of tree-processing benchmarks.


翻译:数组结构体(AoS)到结构体数组(SoA)是一种经典的编译器变换,可改善内存局部性并支持数据并行执行。现有的AoS到SoA变换主要针对C和C++等命令式语言中基于数组的规则程序。相比之下,许多应用程序需要处理树形数据结构,例如编译器中的抽象语法树(AST)、浏览器中的DOM树以及科学计算中的k-d树。先前的工作通过将代数数据类型(ADT)序列化为连续内存缓冲区,提升了处理此类数据的函数式程序的性能。然而,这些表示方式会在单个缓冲区中交错存储各字段,类似于AoS布局。我们引入了分解的多缓冲区布局,将不同ADT字段存储于独立缓冲区中,从而为序列化递归数据结构实现类似SoA的布局。我们在SoCal语言中形式化了该方法(SoCal是一种用于生成分解ADT表示的语言),并在名为Colobus的编译器中实现了该方案。Colobus自动转换函数式程序,使其在序列化且分解的递归ADT布局上运行。在树处理基准测试集上,我们的评估显示几何平均加速比为1.46倍。

0
下载
关闭预览

相关内容

【NeurIPS2025】大型语言模型中关系解码线性算子的结构
专知会员服务
10+阅读 · 2025年11月2日
【干货书】C语言的数据结构和算法,354页pdf
专知会员服务
69+阅读 · 2023年10月1日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
【数据中台】什么是数据中台?
产业智能官
18+阅读 · 2019年7月30日
非平衡数据集 focal loss 多类分类
AI研习社
33+阅读 · 2019年4月23日
使用 Canal 实现数据异构
性能与架构
20+阅读 · 2019年3月4日
语义分割和转置卷积
AI研习社
11+阅读 · 2018年6月22日
【干货】深入理解自编码器(附代码实现)
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 5月4日
Arxiv
0+阅读 · 4月15日
VIP会员
最新内容
BES:让语言模型通过双向进化搜索自我改进
专知会员服务
1+阅读 · 5月30日
以色列-美国-伊朗战争中的无人机:关键要点
专知会员服务
3+阅读 · 5月30日
《Palantir任务保障性软件安全标准(MA-S2)》
专知会员服务
8+阅读 · 5月30日
基于声学的无人机检测技术综述
专知会员服务
5+阅读 · 5月30日
《当代混合战争分析框架:俄乌战争经验教训》
战略前沿人工智能的再思考(中文)
专知会员服务
7+阅读 · 5月29日
《量化地基防空系统间接效应的博弈论方法》
专知会员服务
5+阅读 · 5月29日
相关VIP内容
【NeurIPS2025】大型语言模型中关系解码线性算子的结构
专知会员服务
10+阅读 · 2025年11月2日
【干货书】C语言的数据结构和算法,354页pdf
专知会员服务
69+阅读 · 2023年10月1日
Transformer文本分类代码
专知会员服务
118+阅读 · 2020年2月3日
相关资讯
【数据中台】什么是数据中台?
产业智能官
18+阅读 · 2019年7月30日
非平衡数据集 focal loss 多类分类
AI研习社
33+阅读 · 2019年4月23日
使用 Canal 实现数据异构
性能与架构
20+阅读 · 2019年3月4日
语义分割和转置卷积
AI研习社
11+阅读 · 2018年6月22日
【干货】深入理解自编码器(附代码实现)
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员