NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

TenSet: A Large-scale Program Performance Dataset for Learned Tensor Compilers

Lianmin Zheng, Ruochen Liu, Junru Shao, Tianqi Chen, Joseph Gonzalez, Ion Stoica, Ameer Haj-Ali

TL;DR

This paper introduces TenSet, a massive dataset of over 52 million performance records for tensor programs across 6 hardware platforms. TenSet aims to standardize the development and benchmarking of learned cost models for tensor compilers, which are crucial for accelerating machine learning workloads. By leveraging TenSet, they demonstrate that pre-training cost models can reduce tensor compiler search times by up to 10x.

What Problem Does This Paper Address?

Modern machine learning models rely heavily on efficient tensor operations (like matrix multiplications and convolutions). Tensor compilers are designed to automatically generate highly optimized low-level code for these operations. A key component of these compilers is a "cost model," which predicts the performance of different code variations to guide the search for the best one, thereby avoiding costly on-device measurements. While machine learning, particularly deep learning, shows great promise for building these cost models, a significant hurdle has been the lack of a large, standardized, and multi-platform dataset. This absence makes it difficult to pre-train robust models and fairly compare different approaches, forcing many researchers to collect their own data, which is time-consuming and limits reproducibility.

Methods

The core contribution is the TenSet dataset itself. Beyond the dataset, the paper explores several aspects of learning and using cost models:

  • Data Collection: They systematically collect performance data by generating random tensor programs for popular deep learning models, compiling them using the TVM compiler, and measuring their execution time on various hardware.
  • Cost Model Learning: They investigate different model architectures (MLPs, LSTMs, etc.) and loss functions (regression vs. ranking losses).
  • Evaluation Metrics: They propose and evaluate dataset-based metrics (like RMSE, R², pairwise accuracy, and a novel "top-k score") and search-based metrics to assess cost model performance.
  • Transfer Learning: They explore how models trained on one hardware platform can be adapted or used for others.
  • Integration with Search: They integrate their pre-trained cost models into the Ansor tensor compiler to demonstrate the practical benefits.

Datasets

The primary contribution is the TenSet dataset, which contains:

  • 52 million program performance records.
  • Data from 6 hardware platforms (Intel CPUs, AMD CPUs, ARM CPUs, and NVIDIA GPUs).
  • Records derived from 120 network configurations and 13,848 unique tasks (subgraph-hardware pairs).

The dataset was collected using programs generated for popular deep learning models (from PyTorch's vision model zoo and Huggingface's transformer model zoo).

Key Insights and Ideas

  • The critical need for a standardized, large-scale dataset: The lack of such a dataset has been a major bottleneck for advancing learned cost models in tensor compilers. TenSet aims to fill this gap.
  • Ranking losses are more suitable for cost models: Models trained with ranking losses (which focus on relative performance) tend to yield better results in practice, even if regression metrics like RMSE appear poor. This is because the ultimate goal is to find the best programs, not necessarily to predict their exact latency.
  • Top-k score is a good proxy for end-to-end performance: Among dataset-based metrics, the "top-k score" (how well the model predicts the actual top-performing programs) correlates best with actual search efficiency and final program performance.
  • Transfer learning is promising but nuanced: Models pre-trained on one platform can accelerate search on others, though performance might not be as good as a model trained specifically for that platform. The paper suggests that transfer learning between different CPU architectures is more effective than between CPUs and GPUs.
  • Pre-training significantly reduces search time: Using a cost model pre-trained on TenSet can drastically cut down the time compilers spend searching for optimal code.

Key Results

  • TenSet contains over 52 million performance records across 6 hardware platforms.
  • A cost model pre-trained on TenSet and integrated into the Ansor tensor compiler reduced search time by up to 10x while achieving the same search quality.
  • MLP models trained with ranking loss generally performed best.
  • The "top-k score" was identified as a strong dataset-based metric for evaluating cost models.
  • Transfer learning demonstrated improvements in search results, leading to lower latency programs.

Limitations and Future Work

  • Limited Program Types: The dataset currently only includes programs for floating-point operations and dense neural networks.
  • Specific Subgraph Partitioning: The subgraphs are partitioned using a specific algorithm, which might limit the diversity of subgraph structures.
  • CPU-GPU Transfer Learning: The paper hypothesizes that transfer learning between CPUs and GPUs might not be very effective due to architectural differences and suggests this as future work.
  • Exploring other hardware: Expanding the dataset to include more diverse hardware architectures is a natural next step.
  • End-to-end optimization: Further research into optimizing the entire compilation pipeline, not just individual tasks, is suggested.

Summary updated

BibTeX
@inproceedings{zheng2021tenset,
  author = {Lianmin Zheng and Ruochen Liu and Junru Shao and Tianqi Chen and Joseph Gonzalez and Ion Stoica and Ameer Haj-Ali},
  title = {{TenSet: A Large-scale Program Performance Dataset for Learned Tensor Compilers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}

Loading related content...

Figure