[Paper Review] Runtime Prediction of AI Model Operations Using a GRU-Based Neural Network
This paper introduces TpuGraphs, a large-scale dataset for predicting the runtime of full machine learning computational graphs on TPUs, using a GRU-based neural network to model performance across layout and tile compilation configurations. The dataset enables graph-level performance prediction on large-scale models, achieving up to 2400x faster inference than real hardware evaluation, with baseline models showing moderate accuracy on complex, diverse workloads including ResNet, BERT, and Transformers.
Modern AI models can be represented as computational graphs, where eachnode corresponds to a tensor operation (e.g., matrix multiplication, convolution),and edges represent tensor data flows. Optimizing the executionof these graphs on hardware accelerators such as Tensor Processing Units(TPUs) requires careful selection of compiler configurations that control layoutand tiling strategies.The compilation configuration involves two key types of optimizations:• Layout Configuration: Controls how tensors are arranged in physicalmemory by specifying the dimension order for inputs and outputs ofeach operation node.• Tile Configuration: Controls the tile size of each fused subgraph,impacting data locality and parallelism. Accurately predicting the runtime of AI model graphs under various configurationscan automate and improve the selection of optimal compiler settings,reducing execution time and resource consumption. The Kaggle competition dataset “Google - Fast or Slow? Predict AIModel Runtime” provides runtime data for XLA High Level Optimizer (HLO)graphs running on TPU v3 hardware. This dataset, called TPUGraphs,comprises multiple collections with diverse layouts and tiling configurations,posing a challenging performance prediction task. This work proposes a GRU-based runtime prediction pipeline leveragingopcode runtime features, graph structure dependencies, and configurablenode embeddings. The method consolidates node features, integrates configurationconvolutions, and trains a neural network to predict runtime withmean squared error loss. The approach captures both static graph propertiesand dynamic configuration effects, enabling enhanced runtime estimation toguide compiler heuristics.
Motivation & Objective
- To address the lack of large-scale, graph-level performance prediction datasets for full machine learning programs running on accelerators like TPUs.
- To enable efficient and accurate prediction of execution time for computational graphs under various compilation configurations (layout and tile).
- To support the development of machine learning models that can accelerate compiler autotuning by replacing costly real hardware measurements.
- To provide a benchmark dataset with 31 million layout and 13 million tile configurations, covering diverse, production-scale models such as ResNet, BERT, and Transformers.
- To investigate the challenges of training scalable, generalizable models on large, diverse graphs with high redundancy and memory constraints.
Proposed method
- The dataset, TpuGraphs, consists of computational graphs from open-source ML programs, each paired with compilation configurations (layout and tile) and corresponding execution times on TPU v3.
- A GRU-based neural network is proposed to model the relationship between graph structure, configuration, and execution time, capturing sequential dependencies in graph operations.
- The model processes graph nodes and edges as sequences, using GRU layers to encode structural and operational features for performance prediction.
- Feature engineering includes encoding tensor layout orders and tile sizes as input embeddings, enabling the model to learn configuration-specific performance patterns.
- The training pipeline handles large graphs by batching and optimizing memory usage, with feature extraction amortized across multiple configurations of the same graph.
- Baseline models are implemented using Graph Neural Networks (GNNs) and supervised learning with loss functions like MSE and ListMLE for ranking-based optimization.

Experimental results
Research questions
- RQ1Can a learned performance model accurately predict the execution time of large-scale computational graphs on TPUs using only graph and configuration features?
- RQ2How does model performance vary across diverse, real-world ML workloads such as ResNet, BERT, and Transformers?
- RQ3What is the trade-off between training efficiency, model scalability, and prediction accuracy when handling graphs with up to 7,700 nodes and high configuration redundancy?
- RQ4How much faster is model-based prediction compared to actual hardware evaluation, and can this speedup be leveraged in autotuning pipelines?
- RQ5To what extent can a single model generalize across unseen graph structures and configurations in a production ML environment?
Key findings
- The TpuGraphs dataset contains 31 million layout and 13 million tile configurations, with graphs averaging 7,700 nodes—25x more than the largest comparable graph property dataset and 770x larger than existing ML performance datasets.
- Model prediction is up to 2,400x faster than real hardware evaluation, with inference times ranging from 0.004s to 0.1s per configuration versus 45–475s for compilation and execution.
- Baseline models using GRU and GNN architectures achieve median top-1 errors of 10.5% (ListMLE) and 19.0% (MSE) on the layout collection, with significant improvements on specific models like BERT and ResNet.
- The best-performing model (ListMLE with EarlySAGE) achieves a top-1 error of 10.5% on the layout collection and 10.5% on the tile collection, demonstrating strong generalization across diverse workloads.
- The model's feature extraction time is amortized across multiple configurations of the same graph, making it highly efficient in autotuning pipelines where multiple configurations are evaluated per graph.
- The study confirms that learned cost models can significantly accelerate autotuning, reducing the time to evaluate candidate configurations from hours to milliseconds.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.