3
Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU Architectures M. Del Ben 1 , C. Yang 4 , F.H. da Jornada 2,3 , S.G. Louie 2,3 and J. Deslippe 4 [email protected] 1 Computational Research Division, Lawerence Berkeley National Laboratory (LBNL), 2 Material Science Division, Lawerence Berkeley National Laboratory (LBNL), 3 Department of Physics, University of California at Berkeley, 4 National Energy Research Scientific Computing Center (NERSC), Lawerence Berkeley National Laboratory (LBNL) ABSTRACT In this poster we present the strategy, progress, and perfor- mance while GPU porting one of the major modules, epsilon, of the electronic structure code BerkeleyGW [1, 2]. BerkeleyGW is a massively parallel software package often employed to study the ground and excited state phenomena of materials based on the GW method, GW plus Bethe-Salpeter equation (GW+BSE) approach and beyond. Among its four modules, epsilon represents the most time-consuming routines in the general GW workflow for large- scale Material Science simulations. This poster focuses on the GPU porting of epsilon which is mostly based on CUDA. Some of the porting/optimization strategies include, improving the basic data layout of the original algorithms to efficiently use libraries such as cuBLAS and cuFFT, implementation of specific CUDA kernels to minimize data copies between host and device, keeping data on device and avoiding synchronization, efficient use of data streams in combination with host-pinned memory to leverage high concur- rency on the device, asynchronous memory copies and overlapping (MPI) communication on the host and computation on the device. Some preliminary results are presented in terms of the speedup from CPU-only implementation to CPU-GPU hybrid implementation, strong and weak scaling, and power efficiency, on Summit@OLCF [3] for medium to large scale calculations (with a few hundred to thousand atoms). Excellent speedup is demonstrated: up to 30x for specific kernels and up to 14x for the overall epsilon module. Our port also exhibits good scalability and about 16x higher FLOPs/Watt efficiency compared to the CPU-only implementation. ACM Reference format: M. Del Ben 1 , C. Yang 4 , F.H. da Jornada 2,3 , S.G. Louie 2,3 and J. Deslippe 4 . 2019. Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU Architectures . In Proceedings of SC19, Denver, CO, Nov 17-22, 3 pages. 1 INTRODUCTION The rational design of novel technologies in fields such as photon- ics, photovoltaics, energy storage and conversion, catalysis, super- conductivity and quantum information, is driven by the possibility to engineer and design the unique electronic and optical properties of complex materials. Examples of such complex systems are point defects in semiconductors, which have recently become of particu- lar interest in quantum technologies (see Figure 1). Being able to access such properties from first-principles calculations rather than lengthy "trial and error" experiments, faces two major challenges: (I) requires very large simulation cells, with order of tens of thou- sands of atoms, (II) requires highly accurate theoretical approaches, Figure 1: Schematic representation of the electronic struc- ture of silicon divacancy defect in silicon (prototype of solid state Qbit) calculated employing BerkeleyGW. displaying increased computational cost and unfavorable scaling with system size, i.e. O (N 4 ) or higher. BerkeleyGW [1, 2, 4], a massively parallel software package employed to study the ground and excited state phenomena of materials, tackles these challenges by developing novel methods and algorithms to reduce computational cost, as well as optimal implementations suitable for high performance computing appli- cations. The theoretical framework behind BerkeleyGW is many- body perturbation theory, in particular the GW method, GW plus Bethe-Salpeter equation (GW+BSE) approach and beyond. The basic workflow of BerkeleyGW involve the execution of four major com- putational codes, namely epsilon, sigma, kernel and absorption, each having its own computational cost, data layout and paralleliza- tion strategy. In general for large scale application epsilon is by far the bottleneck of the GW method. 2 GPU SUPPORT FOR ESPILON CODE The espilon code displays four major computational kernels responsible for more than 95% of the overall computational work- load for large scale applications. These kernels are named Matrix Elements (MTXEL), Static Polarizability (CHI-0), Basis Transformation (Transf) and Frequency-dependent Polarizability (CHI-freq). MTXEL kernel implements a double loop with indices usually referred to as valence/conduction for the outer/inner loop respec- tively. In the inner most loop, Fast Fourier Transformations (FFTs) are performed (see Figure 2a). Therefore we use cuFFT library to perform FFT’s in combination with data streams and host pinned memory (one stream for each inner loop index). This allows for asynchronous memory transfer and high concurrency on device. Additionally we implemented CUDA kernels (Put/Multiply/Get of

Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU ... · Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU Architectures M. Del Ben1, C. Yang4, F.H. da Jornada2,3,

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU ... · Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU Architectures M. Del Ben1, C. Yang4, F.H. da Jornada2,3,

Accelerating Large-Scale GW Calculations on Hybrid CPU-GPUArchitectures

M. Del Ben1, C. Yang4, F.H. da Jornada2,3, S.G. Louie2,3 and J. [email protected]

1Computational Research Division, Lawerence Berkeley National Laboratory (LBNL),2Material Science Division, Lawerence Berkeley National Laboratory (LBNL),

3Department of Physics, University of California at Berkeley,4National Energy Research Scientific Computing Center (NERSC), Lawerence Berkeley National Laboratory (LBNL)

ABSTRACTIn this poster we present the strategy, progress, and perfor-

mance while GPU porting one of the major modules, epsilon,of the electronic structure code BerkeleyGW [1, 2]. BerkeleyGW isa massively parallel software package often employed to study theground and excited state phenomena of materials based on the GWmethod, GW plus Bethe-Salpeter equation (GW+BSE) approachand beyond. Among its four modules, epsilon represents the mosttime-consuming routines in the general GW workflow for large-scale Material Science simulations. This poster focuses on the GPUporting of epsilon which is mostly based on CUDA. Some of theporting/optimization strategies include, improving the basic datalayout of the original algorithms to efficiently use libraries suchas cuBLAS and cuFFT, implementation of specific CUDA kernelsto minimize data copies between host and device, keeping data ondevice and avoiding synchronization, efficient use of data streamsin combination with host-pinned memory to leverage high concur-rency on the device, asynchronous memory copies and overlapping(MPI) communication on the host and computation on the device.Some preliminary results are presented in terms of the speedup fromCPU-only implementation to CPU-GPU hybrid implementation,strong and weak scaling, and power efficiency, on Summit@OLCF[3] for medium to large scale calculations (with a few hundred tothousand atoms). Excellent speedup is demonstrated: up to 30x forspecific kernels and up to 14x for the overall epsilon module. Ourport also exhibits good scalability and about 16x higher FLOPs/Wattefficiency compared to the CPU-only implementation.

ACM Reference format:M. Del Ben1, C. Yang4, F.H. da Jornada2,3, S.G. Louie2,3 and J. Deslippe4. 2019. Accelerating Large-Scale GW Calculations on Hybrid CPU-GPUArchitectures . In Proceedings of SC19, Denver, CO, Nov 17-22, 3 pages.

1 INTRODUCTIONThe rational design of novel technologies in fields such as photon-

ics, photovoltaics, energy storage and conversion, catalysis, super-conductivity and quantum information, is driven by the possibilityto engineer and design the unique electronic and optical propertiesof complex materials. Examples of such complex systems are pointdefects in semiconductors, which have recently become of particu-lar interest in quantum technologies (see Figure 1). Being able toaccess such properties from first-principles calculations rather thanlengthy "trial and error" experiments, faces two major challenges:(I) requires very large simulation cells, with order of tens of thou-sands of atoms, (II) requires highly accurate theoretical approaches,

Figure 1: Schematic representation of the electronic struc-ture of silicon divacancy defect in silicon (prototype of solidstate Qbit) calculated employing BerkeleyGW.

displaying increased computational cost and unfavorable scalingwith system size, i.e. O(N 4) or higher.

BerkeleyGW [1, 2, 4], a massively parallel software packageemployed to study the ground and excited state phenomena ofmaterials, tackles these challenges by developing novel methodsand algorithms to reduce computational cost, as well as optimalimplementations suitable for high performance computing appli-cations. The theoretical framework behind BerkeleyGW is many-body perturbation theory, in particular the GW method, GW plusBethe-Salpeter equation (GW+BSE) approach and beyond. The basicworkflow of BerkeleyGW involve the execution of four major com-putational codes, namely epsilon, sigma, kernel and absorption,each having its own computational cost, data layout and paralleliza-tion strategy. In general for large scale application epsilon is byfar the bottleneck of the GW method.

2 GPU SUPPORT FOR ESPILON CODEThe espilon code displays four major computational kernels

responsible for more than 95% of the overall computational work-load for large scale applications. These kernels are named MatrixElements (MTXEL), Static Polarizability (CHI-0), Basis Transformation(Transf) and Frequency-dependent Polarizability (CHI-freq).

MTXEL kernel implements a double loop with indices usuallyreferred to as valence/conduction for the outer/inner loop respec-tively. In the inner most loop, Fast Fourier Transformations (FFTs)are performed (see Figure 2a). Therefore we use cuFFT library toperform FFT’s in combination with data streams and host pinnedmemory (one stream for each inner loop index). This allows forasynchronous memory transfer and high concurrency on device.Additionally we implemented CUDA kernels (Put/Multiply/Get of

Page 2: Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU ... · Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU Architectures M. Del Ben1, C. Yang4, F.H. da Jornada2,3,

SC19, Nov 17-22, Denver, CO M. Del Ben et al

(a)

(b)

Figure 2: Schematic representation of (a) the operationsperformed in the MTXEL kernel and (b) the data lay-out/communication scheme for the CHI-0 kernel.

Figure 2a) to keep intermediates on device and avoid synchroniza-tion. CHI-0 kernel implements a large distributed matrix multipli-cation between tall and skinny matrices (see Figure 2b). Here weuse cuBLAS library to perform the local matrix multiplication. Ad-ditionally, data streams and host pinned memory are used for thematrix buffers, allowing for asynchronous memory transfer. Whenrunning in parallel, with the developed non-blocking cyclic commu-nication scheme [4], communication is finalized before stream syn-chronization. In this way overlap between communication (CPU)and computation (GPU) can be achieved. Transf and CHI-freqkernels implement the generalization of the static CHI-0 to includethe frequency dependence [5, 6]. Therefore these kernels have asimilar communication scheme as CHI-0. The main difference isthat matrix sizes are typically 5-10 times smaller than in CHI-0 andmore distributed matrix multiplications need to be performed. Herewe use data streams over each individual frequency index allowingfor concurrent matrix multiplication execution on device.

3 PERFORMANCE ANALYSISAll performance assessment, unless otherwise stated, has been

measured on Summit@OLCF [3]. In the poster, we present theperformance in terms of GPU acceleration compared to the CPU-only implementation, strong/weak scaling and time versus power.To assess performance we employ three systems of increasing sizebased on a divacancy defect in Silicon (see Figure 1). These systemsare labelled Divac-Si-214, Divac-Si-512 and Divac-Si-998 containing214, 512 and 998 Silicon atoms respectively. In the poster we givemore details about the computational parameters and how theyaffect the calculation workload.

Figure 3a reports the strong scaling of the epsilon code for thethree systems employed to assess performance. The plot shows goodparallel scalability over a wide range of computational resourcesdepending on calculation requirements. For the largest run we had

(a)

(b)

Figure 3: Strong and weak scaling of the epsilon code mea-sured on Summit@OLCF.

issues with the parallel I/O library not seen on other HPC systemsusing similar parallel setups, therefore we report the performancewith and without I/O time. For the largest calculation running atscale we employ 4800 GPU’s achieving time to solution of ≃ 7mins.Figure 3b shows the weak scaling of the epsilon code measuredfor the Divac-Si-512 and Divac-Si-998 systems. The observed goodweak scaling ultimately comes from the O(N 3) vs O(N 4) increaseof memory vs FLOPs with respect to system size. This implies thatthe larger calculation has effectively a larger amount of availablememory on device than the smaller one. This allows to use largerbuffer sizes for the distributed operations resulting in less commu-nications and eventually better parallel performance.

4 SUMMARY AND OUTLOOKWe present here and in the poster our work in porting the

epsilon code of the BerkeleyGW software package to GPU support.We show excellent acceleration provided by GPU’s up to 30x forspecific kernels and up to 14x for the overall execution. Furthermorewe achieve good strong and weak scaling, improved FLOPs/Wattefficiency compared to the CPU-only architectures and achieveexcellent time to solution. Outcomes of this work are encouraging onthe direction of developing an accurate quantum mechanical basedpredictive capability for the design of new novel technologies based oncomplex materials that can run in reasonable timescales on availableHPC facilities. An accurate quantum mechanical modeling of thematerial’s target properties is in fact essential to fast developments tomarket and corresponding industrial leadership.

Page 3: Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU ... · Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU Architectures M. Del Ben1, C. Yang4, F.H. da Jornada2,3,

Accelerating Large-Scale GW Calculations on Hybrid CPU-GPU Architectures SC19, Nov 17-22, Denver, CO

REFERENCES[1] BerkeleyGW, http://www.berkeleygw.org, 2019.[2] J. Deslippe, G. Samsonidze, D. A. Strubbe, M. Jain, M. L. Cohen, S. G. Louie,

Berkeleygw: A massively parallel computer package for the calculation of thequasiparticle and optical properties of materials and nanostructures, Comput.Phys. Commun. 183 (2012) 1269–1289.

[3] Summit@OLCF, https://www.olcf.ornl.gov/summit/, 2019.[4] M. Del Ben, F. H. da Jornada, A. Canning, N. Wichmann, K. Raman, R. Sasanka,

C. Yang, S. G. Louie, J. Deslippe, Large-scale gw calculations on pre-exascale hpcsystems, Comput. Phys. Commun. 235 (2019) 187 – 195.

[5] M. Del Ben, F. H. da Jornada, G. Antonius, T. Rangel, S. G. Louie, J. Deslippe, A. Can-ning, Static subspace approximation for the evaluation of G0W0 quasiparticleenergies within a sum-over-bands approach, Phys. Rev. B 99 (2019) 125128.

[6] M. Govoni, G. Galli, Large scale gw calculations, J. Chem. Theory Comput. 11(2015) 2680–2696.