TCL: Enabling Fast and Efficient Cross-Hardware Tensor Program Optimization via Continual Learning

Chaoyao Shen, Linfeng Jiang, Yixian Shen, Tao Xu, Guoqing Li, Anuj Pathania, Andy D. Pimentel, Meng ZhangarXiv 2026

TL;DR

TCL (Transferable Compiler framework via Continual Learning) is a novel deep learning compiler framework that drastically accelerates tensor program optimization across diverse hardware platforms. By combining an active learning sampler, a linear-time Mamba-based cost model, and a continual knowledge distillation framework, TCL reduces data collection needs to just 10% while delivering up to 16.8× faster tuning times and lower inference latency than state-of-the-art baselines.

What Problem Does This Paper Address?

Deep learning (DL) compilers act as a crucial bridge between high-level neural network descriptions and low-level hardware execution. To maximize performance, these compilers rely on "cost models" to predict the execution latency of various tensor program configurations (schedules) and guide the optimization search space.

However, existing offline cost models face three major bottlenecks:

  1. Exorbitant Data Collection Costs: Gathering enough performance data to train a cost model for a single new chip can take 40 to 60 days of continuous hardware profiling.
  2. Architectural Inefficiency: State-of-the-art cost models often use Transformers to capture long-range code dependencies, but their quadratic time complexity $O(n^2)$ makes them computationally heavy and slow.
  3. Poor Multi-Platform Scalability: Standard transfer learning is usually restricted to one-to-one hardware adaptation. Multi-task learning approaches can scale to multiple chips, but they suffer from parameter explosion and require simultaneous access to datasets from all platforms during training.

Methods

The authors introduce TCL, a framework built on three core innovations designed to make cross-hardware tensor optimization fast, lightweight, and scalable:

Fig. 2. Overview of the TCL cross-hardware DL Complier. The training phase offline-trains the cost model for the target hardware, leveraging models from other hardware. The inference phase integrates the trained model into the DL compiler’s end-to-end pipeline. The light black blocks represent the modules based on Ansor, the light pink blocks represent our proposed TCL modules, and the light yellow blocks represent the specific components within TCL.
  • RDU Sampler: A data-efficient active learning strategy that selects only the top 10% most informative tensor programs for labeling. It does this by jointly optimizing three criteria: Representativeness (ensuring the sample matches the overall operator distribution), Diversity (maximizing performance score differences between samples), and Uncertainty (targeting programs where the model's predictions have high variance).
  • Mamba-based Cost Model: Instead of using heavy Transformer or LSTM architectures, TCL utilizes a cost model based on the Mamba block. Mamba leverages structured state-space models (SSMs) to capture long-range schedule dependencies with linear time complexity $O(n)$, drastically reducing training and inference overhead.
  • Continuous Knowledge Distillation (CKD): To seamlessly transfer optimization insights across multiple chips, CKD decouples a frozen Hardware Knowledge Base (KB) from a flexible Hardware Active Column (AC). As the compiler encounters new hardware targets, the AC learns platform-specific nuances and distills them into the KB. The framework incorporates Elastic Weight Consolidation (EWC) to prevent "catastrophic forgetting" of previously learned hardware profiles without expanding the model's parameter size.

Datasets

The authors evaluated TCL using a mix of public benchmarks and newly collected data:

  • Tenset Dataset: A large-scale public dataset containing performance measurements across six hardware platforms (four CPUs and two GPUs).
  • New Custom Benchmark: The authors open-sourced a new dataset collected over several months, adding comprehensive profiles for an Intel i7-12700F CPU and an NVIDIA GeForce RTX 3080Ti GPU.
  • Target Models: Evaluation was performed across five diverse deep learning workloads: ResNet-50, MobileNet-V2, ResNeXt-50, BERT-tiny, and BERT-base.

Key Insights and Ideas

  • Quality Over Quantity in Data: Introducing too much low-quality or redundant performance data actually degrades cost model accuracy. By filtering out the noise and keeping only the most informative 10% of data, the RDU Sampler achieves performance that matches or even exceeds models trained on 100% of the data.
  • Linear Scaling is Essential for Compilers: Replacing Transformers with Mamba blocks maintains high prediction accuracy while slashing the cost model's memory footprint to a mere 0.35 MB. This makes it highly practical to deploy directly within compiler auto-tuning loops.
  • Manufacturer Alignment Matters: Cross-hardware knowledge transfer is highly effective when staying within the same manufacturer ecosystem (e.g., Intel CPU to Intel CPU, or NVIDIA T4 to RTX 3080Ti). However, transferring knowledge between completely different architectures (like AMD to Intel) can sometimes introduce "negative transfer" or architectural interference.

Key Results

  • Faster Tuning Times: Compared to the fully supervised baseline Tenset-MLP, TCL achieves an average tuning-time speedup of 16.8× on CPUs and 12.48× on GPUs. It also outperforms the multi-task learning baseline MTL-TLP by 3.84× on CPUs and 2.63× on GPUs.
  • Lower Inference Latency: Tensor programs optimized by TCL yielded 1.20× lower inference latency on CPUs and 1.13× lower latency on GPUs compared to Tenset-MLP.
  • Superior Accuracy with Fewer Parameters: Despite its tiny size (0.35 MB vs. TLP's 1.32 MB), the Mamba-based cost model achieved the highest prediction accuracy (Top-1 and Top-5 scores) on six out of eight evaluated hardware platforms.

Limitations and Future Work

While highly effective, the authors note that the CKD framework cannot completely eliminate the risk of negative transfer when migrating knowledge between vastly different hardware architectures from competing manufacturers.

For future work, the team aims to design more fine-grained cost models that can capture even subtler hardware-specific execution behaviors, further driving down inference latency.

Summary updated

BibTeX
@misc{shen2026tcl,
  author = {Chaoyao Shen and Linfeng Jiang and Yixian Shen and Tao Xu and Guoqing Li and Anuj Pathania and Andy D. Pimentel and Meng Zhang},
  title = {{TCL: Enabling Fast and Efficient Cross-Hardware Tensor Program Optimization via Continual Learning}},
  year = {2026},
  eprint = {2604.12891},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.12891},
}
Figure