Precise hardware performance models play a crucial role in code optimizations. They can assist compilers in making heuristic decisions or aid autotuners in identifying the optimal configuration for a given program. For example, the autotuner for XLA, a machine learning compiler, discovered 10-20% speedup on state-of-the-art models serving substantial production traffic at Google. Although there exist a few datasets for program performance prediction, they target small sub-programs such as basic blocks or kernels. This paper introduces TpuGraphs, a performance prediction dataset on full tensor programs, represented as computational graphs, running on Tensor Processing Units (TPUs). Each graph in the dataset represents the main computation of a machine learning workload, e.g., a training epoch or an inference step. Each data sample contains a computational graph, a compilation configuration, and the execution time of the graph when compiled with the configuration. The graphs in the dataset are collected from open-source machine learning programs, featuring popular model architectures, e.g., ResNet, EfficientNet, Mask R-CNN, and Transformer. TpuGraphs provides 25x more graphs than the largest graph property prediction dataset (with comparable graph sizes), and 770x larger graphs on average compared to existing performance prediction datasets on machine learning programs. This graph-level prediction task on large graphs introduces new challenges in learning, ranging from scalability, training efficiency, to model quality.
翻译:精确的硬件性能模型在代码优化中扮演着关键角色,既能辅助编译器做出启发式决策,也能帮助自动调优器为给定程序识别最优配置。例如,机器学习编译器XLA的自动调优器在服务谷歌大规模生产流的最先进模型上实现了10%-20%的加速。尽管目前存在少量用于程序性能预测的数据集,但它们主要针对基本块或内核等小型子程序。本文介绍TpuGraphs——一个针对在张量处理单元(TPU)上运行的全量张量程序(以计算图形式表示)的性能预测数据集。该数据集中每个图代表机器学习工作负载(如训练周期或推理步骤)的主要计算过程。每个数据样本包含计算图、编译配置以及该配置下编译后的图执行时间。数据集中的图来自开源机器学习程序,涵盖ResNet、EfficientNet、Mask R-CNN和Transformer等流行模型架构。与最大图属性预测数据集相比,TpuGraphs提供的图数量多出25倍(且图规模相当),与现有机器学习程序性能预测数据集相比,平均图规模大770倍。这种面向大规模图的图级预测任务在学习过程中带来了可扩展性、训练效率到模型质量等多方面的新挑战。