Optimizing tensor contraction expressions for hybrid CPU-GPU execution

  • Authors:
  • Wenjing Ma;Sriram Krishnamoorthy;Oreste Villa;Karol Kowalski;Gagan Agrawal

  • Affiliations:
  • Computational Sciences and Mathematics Division, Pacific Northwest National Laboratory, Richland, USA;Computational Sciences and Mathematics Division, Pacific Northwest National Laboratory, Richland, USA;Computational Sciences and Mathematics Division, Pacific Northwest National Laboratory, Richland, USA;Computational Sciences and Mathematics Division, Pacific Northwest National Laboratory, Richland, USA and Environmental Molecular Sciences Laboratory, Pacific Northwest National Laboratory, Richla ...;Department of Computer Sciences and Engineering, The Ohio State University, Columbus, USA

  • Venue:
  • Cluster Computing
  • Year:
  • 2013

Quantified Score

Hi-index 0.00

Visualization

Abstract

Tensor contractions are generalized multidimensional matrix multiplication operations that widely occur in quantum chemistry. Efficient execution of tensor contractions on Graphics Processing Units (GPUs) requires several challenges to be addressed, including index permutation and small dimension-sizes reducing thread block utilization. Moreover, to apply the same optimizations to various expressions, we need a code generation tool. In this paper, we present our approach to automatically generate CUDA code to execute tensor contractions on GPUs, including management of data movement between CPU and GPU. To evaluate our tool, GPU-enabled code is generated for the most expensive contractions in CCSD(T), a key coupled cluster method, and incorporated into NWChem, a popular computational chemistry suite. For this method, we demonstrate speedup over a factor of 8.4 using one GPU as compared to one CPU core and over 2.6 when utilizing the entire system using hybrid CPU+GPU solution with 2 GPUs and 5 cores (instead of 7 cores per node). We further investigate tensor contraction code on a new series of GPUs, the Fermi GPUs, and provide several effective optimization algorithms. For the same computation of CCSD(T), on a cluster with Fermi GPUs, we achieve a speedup of 3.4 over a cluster with T10 GPUs. With a single Fermi GPU on each node, we achieve a speedup of 43 over the sequential CPU version.