Skip to main content
QUICK REVIEW

[Paper Review] TTC: A high-performance Compiler for Tensor Transpositions

Paul Springer, Jeff R. Hammond|RWTH Publications (RWTH Aachen)|Mar 7, 2016
Parallel Computing and Optimization TechniquesComputer Science18 references6 citations
TL;DR

TTC is a domain-specific compiler that generates high-performance C++ code for multidimensional tensor transpositions using optimizations like blocking, loop-reordering, software prefetching, and explicit vectorization. It achieves near-peak memory bandwidth on Intel Haswell and AMD Steamroller, outperforming modern compilers, and uses pruning heuristics to reduce search space with minimal performance loss—achieving 99% of exhaustive search performance with only 100 candidates.

ABSTRACT

We present TTC, an open-source parallel compiler for multidimensional tensor transpositions. In order to generate high-performance C++ code, TTC explores a number of optimizations, including software prefetching, blocking, loop-reordering, and explicit vectorization. To evaluate the performance of multidimensional transpositions across a range of possible use-cases, we also release a benchmark covering arbitrary transpositions of up to six dimensions. Performance results show that the routines generated by TTC achieve close to peak memory bandwidth on both the Intel Haswell and the AMD Steamroller architectures, and yield significant performance gains over modern compilers. By implementing a set of pruning heuristics, TTC allows users to limit the number of potential solutions; this option is especially useful when dealing with high-dimensional tensors, as the search space might become prohibitively large. Experiments indicate that when only 100 potential solutions are considered, the resulting performance is about 99% of that achieved with exhaustive search.

Motivation & Objective

  • To address the lack of high-performance, portable software for multidimensional tensor transpositions in HPC workloads.
  • To generate optimized C++ code that achieves near-peak memory bandwidth on modern architectures.
  • To reduce the combinatorial explosion of possible code transformations through effective pruning heuristics.
  • To enable efficient, reusable, and portable tensor operations in scientific computing and machine learning.
  • To support future integration into a broader tensor contraction compiler pipeline.

Proposed method

  • TTC compiles tensor transpositions using a domain-specific approach that generates C++ code with explicit loop transformations.
  • It applies loop-reordering to improve data locality and memory access patterns across multiple dimensions.
  • Blocking is used to optimize cache utilization by dividing tensors into manageable sub-blocks.
  • Software prefetching is dynamically tuned via a performance model to hide memory latency.
  • Explicit vectorization is applied using AVX instructions to maximize SIMD throughput.
  • A pruning strategy limits the search space by prioritizing high-quality candidates based on heuristics, reducing compilation time without significant performance loss.

Experimental results

Research questions

  • RQ1Can a domain-specific compiler generate tensor transpose code that achieves near-peak memory bandwidth on modern CPUs?
  • RQ2How effective are pruning heuristics in reducing the search space for high-dimensional tensor transpositions without sacrificing performance?
  • RQ3What is the individual impact of blocking, loop-reordering, prefetching, and vectorization on performance?
  • RQ4How does the performance of TTC compare to modern optimizing compilers across diverse tensor dimensions and data layouts?
  • RQ5To what extent can fixed prefetch distances be used as a practical compromise to reduce search space?

Key findings

  • TTC-generated code achieves close to peak memory bandwidth on both Intel Haswell and AMD Steamroller architectures.
  • With only 100 candidates, TTC achieves 99.10% of the performance of an exhaustive search across the benchmark.
  • A fixed prefetch distance of 5 to 8 achieves over 99% average efficiency and 98% minimum efficiency, making it a robust practical choice.
  • Even with just one candidate, TTC achieves 94.58% of the performance of exhaustive search, demonstrating strong heuristic quality.
  • The combination of blocking, loop-reordering, prefetching, and vectorization collectively accounts for the majority of performance gains over modern compilers.
  • The compiler’s design allows for extensibility to new instruction sets such as AVX512, ARM, Power, and GPUs in future work.

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.