Skip to main content
QUICK REVIEW

[Paper Review] Simulating Execution Time of Tensor Programs using Graph Neural Networks

Jakub M. Tomczak, Romain Lepert|arXiv (Cornell University)|Apr 26, 2019
Advanced Graph Neural NetworksComputer Science25 references3 citations
TL;DR

This paper proposes using Graph Neural Networks (GNNs) to predict the execution time of tensor program configurations represented as abstract syntax trees (ASTs), outperforming fixed feature extractors like context relations. The method leverages graph convolutional networks to propagate structural information across nodes, achieving superior generalization—especially for low-latency configurations—on a new dataset of 12 ResNet18 convolution workloads compiled via TVM on CPU hardware.

ABSTRACT

Optimizing the execution time of tensor program, e.g., a convolution, involves finding its optimal configuration. Searching the configuration space exhaustively is typically infeasible in practice. In line with recent research using TVM, we propose to learn a surrogate model to overcome this issue. The model is trained on an acyclic graph called an abstract syntax tree, and utilizes a graph convolutional network to exploit structure in the graph. We claim that a learnable graph-based data processing is a strong competitor to heuristic-based feature extraction. We present a new dataset of graphs corresponding to configurations and their execution time for various tensor programs. We provide baselines for a runtime prediction task.

Motivation & Objective

  • Address the challenge of optimizing tensor program execution time across vast configuration spaces in hardware-aware compilation.
  • Overcome the infeasibility of exhaustive search by learning a surrogate model for runtime prediction.
  • Introduce a new application of Graph Neural Networks to model tensor program configurations as graphs for performance prediction.
  • Provide a new, publicly available dataset of ASTs and corresponding execution times for 12 convolution workloads on CPU.
  • Evaluate the generalization capability of GNN-based models across unseen workloads and limited training data.

Proposed method

  • Represent each tensor program configuration as an abstract syntax tree (AST), with nodes encoding operator and configuration features extracted from TVM.
  • Apply a shared multi-layer perceptron (MLP) encoder to embed node features, including node type embeddings.
  • Use graph convolutional networks (GCNs) to propagate information between nodes, preserving the AST's structural dependencies.
  • Aggregate node representations using an average pooling operation to form a global graph embedding.
  • Train a final MLP head on the aggregated representation to predict execution time using Huber loss.
  • Compare against a baseline using fixed context relation features (Curve) with a learnable predictor, and a non-convolutional MLP baseline.

Experimental results

Research questions

  • RQ1Can Graph Neural Networks effectively model the structural relationships in ASTs of tensor program configurations to improve runtime prediction?
  • RQ2How does a learnable graph-based representation compare to handcrafted features like context relations in predicting execution time?
  • RQ3To what extent can a GNN-based surrogate model generalize to unseen tensor program workloads with limited training data?
  • RQ4Does the GNN-based approach achieve better prediction accuracy for low-latency configurations, which are critical for optimization?
  • RQ5Can the proposed model transfer knowledge across different convolution workloads in ResNet18, indicating potential for transfer learning in compiler optimization?

Key findings

  • The GNN-based model generalizes significantly better to unseen workloads than the MLP baseline, especially with limited training data.
  • The GNN outperforms the fixed context relation feature baseline (Curve) when more than 15% of training data is used, indicating superior scalability.
  • The GNN makes consistently smaller prediction errors, particularly in the critical range of 0–20ms execution time, where accurate identification of fast configurations is essential.
  • The model achieves lower mean absolute error (ℓ₁ loss) on test data compared to both MLP and Curve baselines, with the largest improvement observed in low-latency regimes.
  • The results suggest that graph-structured representations learned by GNNs capture meaningful patterns in tensor program configurations that are not fully exploited by fixed feature extractors.
  • The proposed dataset enables cross-workload generalization evaluation, and the results demonstrate that transfer learning across different convolution workloads is feasible with GNNs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.