원시데이터 수집 시스템
선정목록으로

GPU acceleration of all-electron electronic structure theory using localized numeric atom-centered basis functions

간접 관련 화학·수지 · (21) 에폭시수지 (6) PEM(고분자전해질막)(7) MEA(막전극접합체)(15) 디스플레이 패널재료

기본 정보

저자
  1. William Huhn — Department of Mechanical Engineering and Materials Science, Duke University, Durham, NC 27708, USA
  2. Björn Lange — Department of Mechanical Engineering and Materials Science, Duke University, Durham, NC 27708, USA
  3. Victor Wen‐zhe Yu — Department of Mechanical Engineering and Materials Science, Duke University, Durham, NC 27708, USA
  4. Mina Yoon — Center for Nanophase Materials Sciences, Oak Ridge National Laboratory, Oak Ridge, TN 37830, USA
  5. Volker Blüm — Department of Chemistry, Duke University, Durham, NC 27708, USA|||Department of Mechanical Engineering and Materials Science, Duke University, Durham, NC 27708, USA
DOI
10.1016/j.cpc.2020.107314
저널
Computer Physics Communications
발행년도
2020
발행기관
Elsevier BV
피인용수
41
라이선스
publisher-specific-oa
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1016/j.cpc.2020.107314
토픽
Graphene research and applications
OpenAlex ID
W3016156025

평가 내용

관련도
간접 관련
사업분야
화학·수지 · (21) 에폭시수지
부 분야
(6) PEM(고분자전해질막), (7) MEA(막전극접합체), (15) 디스플레이 패널재료
R&D 측면
분석·모델링
확신도
0.70
근거 용어
density-functional theory, GPGPU acceleration, electronic structure simulation, materials prediction, computational materials science
판단 근거
본 논문은 밀도범함수이론(DFT)을 GPU로 가속화하여 물질의 전자 구조를 시뮬레이션하는 계산 방법론에 관한 연구입니다. 이는 코오롱인더스트리의 화학 수지(21)나 수소 연료전지(6, 7), 디스플레이 소재(15) 개발 시 분자 수준의 물성을 예측하고 설계하는 데 활용될 수 있는 상위 수준의 계산 과학 기술입니다.
R&D 활용 포인트
신규 고분자(에폭시, 페놀수지 등) 및 연료전지용 이온전도성 막의 화학적/물리적 특성을 실험 전 컴퓨터 시뮬레이션으로 예측하여 R&D 기간과 비용을 단축하는 데 활용 가능합니다.
평가 입력
섹션 본문 58,005자 중 30,032자 발췌

초록

초록이 없습니다.

본문 60,142자

본문 펼치기
We present an implementation of all-electron density-functional theory for massively parallel GPGPU-based platforms, using localized atom-centered basis functions and real-space integration grids. Special attention is paid to domain decomposition of the problem on non-uniform grids, which enables compute-and memory-parallel execution across thousands of nodes for realspace operations, e.g. the update of the electron density, the integration of the real-space Hamiltonian matrix, and calculation of Pulay forces. To assess the performance of our GPGPU implementation, we performed benchmarks on three different architectures using a 103-material test set. We find that operations which rely on dense serial linear algebra show dramatic speedups from GPGPU acceleration: in particular, SCF iterations including force and stress calculations exhibit speedups ranging from 4.5 to 6.6. For the architectures and problem types investigated here, this translates to an expected overall speedup between 3-4 for the entire calculation (including non-GPU accelerated parts), for problems featuring several tens to hundreds of atoms. Additional calculations for a 375-atom Bi 2 Se 3 bilayer show that the present GPGPU strategy scales for large-scale distributed-parallel simulations. Introduction Kohn-Sham density-functional theory (KS-DFT) [1,2] is the primary tool for computational materials prediction across a wide range of areas in science and engineering [3,4,5,6]. One class of KS-DFT codes uses spatially localized atom-centered basis sets, e.g. Gaussian orbitals [7,8,9,10,11,12,13,14,15,16,17], Slater orbitals [18,19,20], and numeric atom-centered orbitals (NAOs). [21,22,23,24,25,26,27,19,28,29,30,31] For these basis sets, local operations such as Hamiltonian and overlap matrix integrations, updates of the electron density and its gradients, or parts of force and stress tensor computations, can be carried out on real-space grids. Due to the locality of the basis functions and of the Kohn-Sham potential, these operations can be implemented such that the computational timings scale linearly in number of atoms. [32,33,34,35,19,28,36,37] Accordingly, in the system size range for which real-space operations dominate the cost -typically small-to-mid-sized calculations comprising several tens to hundreds of atoms -this translates into approximately linear-scaling overall execution times as well. For larger-scale calculations, most KS-DFT codes have a formal default O(N 3 atoms ) scaling due to the reliance on eigenvalue solvers to directly solve the Kohn-Sham eigenvalue problem for all occupied electron states, known as the "cubic wall" of standard KS-DFT. However, much of the practical science addressed by KS-DFT occurs below this limiting regime and instead in the range where operations with lower scaling exponents still account for the majority of the cost. Introduction An increasingly available paradigm in high-performance computing (HPC) are general purpose graphics processing unit (GPGPU)-accelerated architectures, in which each computational node contains one or more GPGPU accelerators working in tandem with the traditional CPUs employed in HPC applications. GPGPUs are well suited for evaluation of highly vectorizable, compute-intensive algorithms due to their unique massively-parallel design, prompting early work to demonstrate matrix multiplications [38] and FFTs [39] on commodity hardware. The feasibility of GPU-accelerated electronic structure calculations was demonstrated in works by Ufimtsev and Martínez [40,41,42,43] which would form the basis for the TeraChem electronic structure package [44], as well as by Yasuda using the Gaussian package [45,46]. Since then, a number of electronic structure packages have incorporated GPU acceleration, including ABINIT [47], ADF [48], BigDFT [49,50], CP2K [51], GPAW [52,53,54], LS3DF [55], octopus [56,57,58], ONETEP [59], PEtot (now PWmat) [60,61,62,63], Q-Chem [64,65,15], Quantum ESPRESSO [66,67], RMG [68,69], VASP [70,71,72,73], and FHI-aims (this work). Development cost can be alleviated by using dropin GPU-accelerated libraries such as cuBLAS [74], cuFFT [75], Thrust [76], ELPA [77,78,79], and MAGMA [80,81,82] for general mathematical operations. Nevertheless, GPU acceleration is generally not a trivial task due to the need to target low-level algorithms, which constitute the majority of the computational workload, specific to a given software package and port them to a new architecture. However, the raw computational output afforded by GPGPUs can be immense. Introduction In this paper, we describe a careful GPGPU adaption and analysis of several of the dominant real-space operations for KS-DFT in the NAO-based full-potential, all-electron electronic structure code FHI-aims. [30,37,83] FHI-aims is a general-purpose electronic structure simulation code, offering proven scalability to thousands of atoms and on very large, conventional distributed-parallel high-performance computers. [84,77,85,86] The code achieves benchmark-quality accuracy for semi-local [87,17], hybrid [88,89,17], and many-body perturbative [88,90] levels of theory. The specific implementation described here helps unlock the potential of GPGPU architectures for a broad range of production simulations using semilocal DFT, including generalized gradient approximation (GGA) and meta-GGA exchangecorrelation functionals. We specifically target Hamilton and overlap matrix integrations, updates of the density and its gradients, and the computation of forces and stress tensor components. Introduction In FHI-aims, linear scaling in the real-space operations covered in this paper is achieved using a real-space domain decomposition (RSDD) algorithm [37], wherein the set of all real-space integration points is subdivided into compact sets of points known as "batches". As shown below, this RSDD algorithm is naturally parallel in both memory and workload and thus allows for an efficient load-balanced, distributed-parallel GPGPU-assisted im-plementation. The problem sizes for each individual batch of points are naturally suited for GPGPU acceleration, allowing for the usage of drop-in GPGPU-accelerated libraries with minimal code restructuring necessary for the Hamiltonian matrix integrals, update of density and density gradients, and total energy gradients. The electrostatic potential calculation uses a multipole summation algorithm differing from the RSDD algorithm presented here and thus was not GPGPU-accelerated for this work. Likewise, the exact-exchange operator of hybrid DFT and eigenvalue solutions that can be accessed through libraries such as ELPA [77,78,79] and MAGMA [80,81,82] are not targeted by this work. This paper is organized as follows. First, we outline the fundamental equations entering into real-space Kohn-Sham density functional theory. Next, we discuss design principles for numerical algorithms which facilitate optimal usage of GPGPU resources, the RSDD algorithms used for evaluating integrals with FHI-aims and their adaption for execution on GPGPU resources. Finally, timing and scaling benchmarks for four different GPGPUaccelerated architectures and two sets of materials demonstrate GPGPU speedups for real-space integrations across a broad class of architectures and systems encountered in electronic structure based materials simulations. Background Within the Born-Oppenheimer approximation, the objective of KS-DFT is to determine the electron density n(r) for a given set of fixed nuclear position {R at } of each atom (the "system geometry"). The ground-state total energy E tot [n] and other observables are then evaluated as functionals of n(r). Throughout this section, we assume a non-spin-polarized system for simplicity. However, the extension to collinearly spin-polarized systems is straightforward, as is the extension to spin-orbit coupled and/or non-collinear spin systems, [91] since the underlying matrix integrals, density and gradient updates follow exactly analogous formulae. The density is determined by solving an effective single-particle Hamiltonianĥ KS . In scalar-relativistic form,ĥ Background wheret s is the (scalar-relativistic) kinetic energy,v ext is the external potential,v H [n] is the Hartree potential of the electrons, andv xc [n] is the exchange-correlation potential. Evidently, the density n(r) depends on the Hamiltonianĥ KS and the Hamiltonian depends on the density. Finding a stationary density that yields the particular Hamiltonian that generates this density is a non-linear optimization problem and is cast as a "self-consistent field" (SCF) cycle. The complete flow of a typical electronic structure calculation is shown in Figure 1, which also indicates the specific operations that are GPUaccelerated in this work. For a given set of initial nuclear positions, the eigenfunctions {ψ l } (with eigenvalues l ) and/or the stationary density of the Hamiltonian in Eq. (1) are expressed in terms of a finite set of basis functions {ϕ i }. For a non-periodic system, this expansion has the form Background N b is the size of the basis set and c il is the coefficient of the l th eigenvector for the i th basis function. The density can then be computed as Background where n ij is the density matrix, defined as Background where f l is the occupation number of orbital ψ l . If n ij is already known, Eq. (4) may be implemented in an O(N ) approach for localized basis elements. Initial guesses for the electronic structure ( Figure 1) can either be given in terms of ψ l (r) or in terms of n ij . In FHI-aims, these initial quantities are produced by solving the Hamiltonian in Eq. (1) for the potential of a sum of overlapping free-atom densities. The density gradient ∇n is required for GGA calculations, where the Hessian ∇ 2 n dependence in the exchangecorrelation potential energy may be converted to a ∇n dependence via integration by parts (Eq. (30) of [30]) The Hessian is required for any force computation, or when evaluation of the explicit Kohn-Sham potential for GGAs is needed for any other reason. Background In this work, we use localized atom-centered basis functions, which are generally non-orthonormal to one another and yield a non-trivial overlap Figure 1: Program flow for a typical electronic structure calculation involving geometry relaxation or molecular dynamics. Shaded boxes indicate steps contributing to the actual computational workload. Yellow shading indicates steps that are subject to real-space GPU acceleration in this work, whereas gray shading indicates steps that are GPU-accelerated only partly, not at all, or that are handled by separate software components [92,77,79,78,86] outside the scope of this work. Background For periodic systems, we discretize the eigenvectors in terms of Bloch orbitals {χ ik } that are extended throughout the entire crystal: Background k is the crystal momentum quantum number and N b is the number of basis functions associated with a single unit cell. Each χ ik is associated with a particular localized basis function ϕ i (r) and its periodic images in all other unit cells (labelled by lattice translation vectors T ) via the transformation Background As a result, χ ik (r) is normalized per unit cell. The relevant overlap matrix is then Background Importantly, for spatially localized real-space basis functions {ϕ i (r)}, and using Eqs. (6) and (7), the density matrix can also be expressed in terms of the real-space basis functions, just like in Eq. (3). The difference is that the sum in Eq. (3) now runs over real-space basis functions and their images both inside and outside a given unit cell. More precisely, since only grid points r inside a single cell (say, the cell at T =(0,0,0)) need be considered, i and j in Eq. (3) run from 1, ..., N rs , where N rs is the number of all localized real-space basis functions in the crystal that are non-zero somewhere inside the volume of the unit cell at T =(0,0,0). As mentioned above and as indicated in Figure 1, the density computation Eq. (3), which has the form of matrix multiplications, is GPU-accelerated in this work. Additionally, the calculation of density gradients ∇n(r) is necessary for almost any current density functional approximations, i.e., GGA and beyond. Finally, the Hessian matrix of the density, ∂ x i ∂ x j n(r) (i, j=1,..., 3), is needed at least for total energy gradient calculations (forces and stresses). For a given density matrix, these gradients are straightforward extensions of Eq. (3), but their evaluation can still contribute significantly to the overall computational cost: ∇n(r) has three components, ∂ x i ∂ x j n(r) has six components, and each component has the same cost as the evaluation of n(r) itself. Background As a next step, the Hartree potentialv H [n] in Eq. (1) is a local operator of the formv Background In practice,v ext (which includes the potential due to the nuclei) andv H [n] (the averaged electrostatic potential due to the electron density) are treated together in order to evaluate an overall charge-neutral system. As mentioned above, this full electrostatic potential may be computed via a multipole summation scheme [30] and is not subject to GPGPU acceleration in this work. Background In the system range investigated here, it does not dominate the computational cost. Background In non-periodic system geometries and for real-valued local basis functions ϕ i (r), the Hamiltonian is naturally expressed in terms of matrix elements h ij with an integral form of Background In periodic boundary conditions, Background In the periodic case, each matrix element h ij (k) can still be summed up from local real-space integrals (the equivalent of Eq. (10)) of the following type: Background However, in contrast to the non-periodic case, the running indices i and j for h uc ij in Eq. (12) are not restricted to 1, ..., N b (the number of basis functions associated with a single unit cell) but instead run over 1, ..., N rs , the number of localized real-space basis functions in the crystal that are non-zero somewhere inside the volume of the unit cell at T =(0,0,0). The local integrals h uc ij can be computed using the exact same real-space integration code as their non-periodic equivalents. The only difference is that each integration point r is mapped back to its periodic image within the unit cell at T =(0,0,0), so that the local integrals in Eq. (12) are restricted to that unit cell. The full Bloch integrals h ij (k) can then be constructed by inserting Eq. (7) into Eq. (11). The expression for h ij (k) becomes a sum over individual real-space integrals of form h uc ij , multiplied by Bloch phase factors e ik·(T i −T j ) that connect the unit cells where the real-space basis functions i and j are centered. The overlap matrix elements s ij (k) can be constructed analogously. To unify the notation between periodic and non-periodic systems, we will refer to both Eqs. (10) and (12) as the "real-space Hamiltonian matrix" h uc ij for the remainder of this paper. As shown in Figure (1), its computation is GPU-accelerated in this work. Background Given the updated KS-DFT Hamiltonian, the Hamiltonian's approximate eigenvectors ψ lk (r) and eigenvectors lk can now be found by solving Background (for non-periodic systems, the k index may just be omitted). A new density matrix n ij can thus be found. The eigenvector-based approach Eq. (13) scales computationally at least as O(N 3 e ), where N e is the number of electrons in the system. Alternatively, the KS eigenvalue problem may be circumvented entirely by density-matrix-based solvers, [93,94,95,86] often with reduced-dimensional scaling. In FHI-aims, the solution of the KS eigenvalue equation in matrix form is performed via the dense generalized eigensolver library ELPA [92,77,79,78] or circumvented by other solvers interfaced through ELSI [86], an open-source library which provides an interface layer between KS-DFT codes and methods that solve or circumvent the Kohn-Sham eigenvalue problem in density-functional theory. The GPU acceleration or circumvention of Eq. (13) is thus not the topic of this paper; however, options exist in the form of the open-source, GPU-accelerated ELPA and MAGMA eigensolver libraries that are benchmarked elsewhere in the literature. [78,79,80,81,82] After the SCF cycle for a given geometry is complete, electronic structure calculations may continue by changing the geometry of a material as the calculation progresses, e.g. to find a local minimum-energy geometry at the Born-Oppenheimer surface, or for molecular dynamics. In these cases, the position of atomic nuclei, R at , are updated by calculating the forces on each atom, Background as a function of the electronic structure after the SCF cycle has converged. Background Here, E tot is the Born-Oppenheimer total energy of the material and the subscript at labels different atoms for convenience. For localized basis elements, the computationally expensive portion of Eq. (14) is the Pulay forces, which on the scalar-relativistic -here, the atomic zero-order regular approximation (atomic ZORA; cf. Eqs. (55) and (56) in [30]) -and GGA level have the form Background where Background is the local (density-only) parts of the Pulay forces, Background is the q ij energy-weighted density matrix, Background is the correction to the Pulay forces arising from explicit density gradients in GGA, and Background is the correction to the Pulay forces arising from atomic ZORA. Background For periodic calculations, one may also calculate overall stresses on the computational cell by calculating the stress tensor Background after the SCF cycle has converged. Here, λµ is the symmetric, infinitesimal strain tensor and V is the volume of the computational cell. A full account of the terms that make up the stress tensor in an atom-centered basis set is given in [83]. As mentioned above, the computation of the gradients Eqs. (14) and (20) using atom-centered basis functions for semilocal density functionals can include the numerically expensive evaluation of higher density derivatives such as the density Hessian and similar quantities evaluated on a real-space grid. When needed, the computational cost of Eqs. (14) and (20) can therefore amount to a large fraction of the overall time required to execute the type of computation shown in Figure 1. The corresponding steps are thus also GPU accelerated in this work, using the same real-space grid techniques as for the density and the Hamilton matrices, outlined below. Design Principles for GPGPU-Accelerated Code There are three major design priorities entering into GPGPU acceleration of an algorithm: Design Principles for GPGPU-Accelerated Code • The workload offloaded to the GPGPU should be highly vectorizable, Design Principles for GPGPU-Accelerated Code • Thread-divergent branching statements (e.g. "if" statements that can lead to different conditional states for different threads) should be avoided in the workload offloaded to the GPGPU, and Design Principles for GPGPU-Accelerated Code • Communication between the CPU and GPGPU over relatively slow buses should be minimized. Design Principles for GPGPU-Accelerated Code Sections of an algorithm which are not easily vectorizable and/or contain a large number of thread-divergent branching statements should be performed by the CPU(s), and sections of an algorithm that are easily vectorizable should be offloaded to the GPGPU. Ideally, GPGPU and CPU workloads should be carried out in parallel in an asynchronous fashion if that is possible. There is an additional design priority implicit in this scheme: the problem size for the workload offloaded to the GPGPU must fit into the GPGPU's onboard memory. Computational Choices in FHI-aims 3.2.1. Real-Space Integration Grids A visualization of the real-space integration grids in FHI-aims for a mercury atom is shown in Figures 2a (light settings of FHI-aims) and 2b (tight settings of FHI-aims. Analogous figures for the multi-atom benzene molecule are shown in Figures 2c and 2d. The grid consists of spherical shells of points around each nucleus, with individual grid points located on each shell according to the point distributions described by Lebedev et al. [96,97,98] and Delley [99]. For the mercury atom, the outermost spherical shells can be observed as "rays" of points far from the respectively nuclei. Closer to the nucleus, there are less points per spherical shell, but the radial density of spherical shells increases systematically (see Eq. 18 in [30]) to account for rapidly varying wavefunctions. Computational Choices in FHI-aims 3.2.1. Real-Space Integration Grids In polyatomic systems like benzene, every atom contributes integration points to the overall integration grid of the system. The radial cutoffs for the radial integration grids well exceed bond lengths in molecules and materials, leading to a densely-interlocking, irregular cloud of integration points covering both nuclear and interstitial regions. Integration weights w(r) are calculated on-the-fly (see Eq. (111) and Appendix C in [83] for the exact definition of the respective weight functions used in FHI-aims), yielding a form for the real-space Hamiltonian integration Computational Choices in FHI-aims 3.2.1. Real-Space Integration Grids or (for periodic systems) Computational Choices in FHI-aims 3.2.1. Real-Space Integration Grids FHI-aims calculates w(r) using a partition-of-unity approach [100] with a modified form of the O(N atom ) partitioning scheme proposed by Stratmann et al. [33] (see Eqs. 111-112 and C.5-C.8 in Knuth et al. [83]), where N atom is the number of atoms in the computational cell. Here, it is sufficient to note that the resulting set of points is not an simple even-spaced grid and may be freely distributed across processes. Also, the process to update overlap matrix integrals s ij or s uc ij (once per SCF cycle) is exactly analogous to the process outlined below for the elements of the Hamiltonian. Computational Choices in FHI-aims 3.2.1. Real-Space Integration Grids The default basis sets {ϕ i (r)} used by FHI-aims for evaluating Eq. (22) are preconstructed sets of numerical atom-centered orbitals (NAO) optimized for KS-DFT-based total energy calculations, as outlined in [30] The NAO basis sets used in FHI-aims have been shown to have accuracy on par with the best available benchmark codes for total and atomization energies of molecules [17] and calculated equations of state and band energies for solids [87,91]. A cutoff potential is used to smoothly limit the spacial extent of the basis functions. The cutoff potential (Eq. (9) in [30]) reaches infinity at a user-definable outermost edge that is 6Å for most chemical species using tight settings. Thus, any radial functions approach zero smoothly at this radius and remain zero at larger distances from their center. Real-Space Domain Decomposition (RSDD) The RSDD is used for the update of the electron density and integration of various matrix elements for semi-local operators. We will focus on integration of the real-space Hamiltonian matrix (Eqs. (10) and (12)) in this section, although the procedure presented applies to matrix elements of an arbitrary semi-local operator. Additional steps related to the electron density update will be presented when relevant. A detailed study of the expected linear scaling in runtime of the RSDD algorithm, including an examination of the performance of various partitioning schemes for integration points, was performed by Havu et al [37]. Figure 3a shows a visualization of the partitioning of the set of integration points P into mutually-disjoint "batches" of points B ν ⊂ P . Each batch is a compact, spatially-local set of points on which vectorized operations will be performed and are distributed in a round-robin fashion among processes. At no time does any individual process have knowledge of the full real-space integration grid. Grid Partitioning The partitioning is accomplished by using a "grid adapted cut-plane method" (Algorithm 3 of [37]) in which the full set P is iteratively divided to smaller subsets using cut-planes (red lines in 3a) until some targeted number of points per subset is reached. The resulting subsets are the batches B ν . The targeted number of points per batch will be denoted as the "batch size" throughout this paper. The default batch size in FHI-aims is 100 points per batch for CPU-only calculations and 200 points per batch for (a) (b) Figure 3: A visualization of the batch partitioning scheme used by FHI-aims. Black points denote integration points, and red lines denote boundaries between batches of points. In subfigure (b), the dark blue circle denotes the support of a local basis function, and batches on which the local basis function has non-zero support are highlighted in light blue. Grid Partitioning GPGPU-accelerated calculations. We increase the batch size for GPGPUaccelerated calculations as this will decrease the number of batches, decreasing the amount of CPU-GPU communication and increasing the amount of work accelerated per batch. In our tests, increasing the batch size beyond 200 points does not lead to further overall acceleration. Parallelization and Dimensionality Reduction Having generated a set of mutually disjoint batches {B ν }, we may rewrite Eq. (22) as Parallelization and Dimensionality Reduction where Parallelization and Dimensionality Reduction is the contribution of batch B ν to the real-space Hamiltonian matrix element h uc ij . Eqs. (23) and (24) are trivially parallelizable over batches. The RSDD algorithm parcels out batches to MPI tasks, so that each MPI task owns multiple batches, and each batch is owned uniquely by a single MPI task [37]. Parallelization and Dimensionality Reduction The indices in Eqs. (23) and (24) by default run over all basis functions. h uc ij [B ν ] for a given batch B ν will be sparse for medium-to-large-sized systems, as many basis functions are centered too far away to touch the integration points in B ν . While it may be tempting to store h uc ij [B ν ] in a sparse format, the usage of a sparse matrix format will introduce an intermediate non-trivial indexing step when accessing the matrix elements, impeding vectorization due to indirect addressing. More importantly, the sparse representations for matrices h uc ij and h uc ij [B ν ] will scale in size as O(N atom ). Retaining local copies of the full h uc ij [B ν ] on each separate MPI process will eventually become the dominant memory cost of the calculation. Parallelization and Dimensionality Reduction For each batch, we instead define a reduced-dimensional subspace nnz(B ν ) consisting of basis functions with support on the batch, i.e., basis functions that are nonzero on at least part of the grid points in this batch. h uc ij [B ν ] can be considerably reduced in size by calculating only matrix elements between basis elements ϕ i lying in nnz(B ν ), yielding a dense "batch Hamiltonian matrix" with form identical to Eq. (24). We take h uc ij [B ν ] to refer to this subspace batch Hamiltonian matrix for the rest of this paper. When evaluating the electron density update (Eq. (3)) using the RSDD algorithm, an analogous subspace representation is employed for the density matrix Blue squares indicate matrix elements h uc ij to which the batch may contribute, and white squares denote matrix elements with no contribution from the batch. We show the real-space Hamiltonian matrix as an uncompressed full matrix for simplicity; see Figure 5 for the matrix layouts used in FHI-aims. Parallelization and Dimensionality Reduction (if required) for the energy-weighted density matrix q ij [B ν ] when calculating Pulay forces (Eq. (14)) and the stress tensor (Eq. (20)). Parallelization and Dimensionality Reduction Defining the nnz(B ν ) × B ν matrix, Parallelization and Dimensionality Reduction and the B ν × nnz(B ν ) matrix Parallelization and Dimensionality Reduction A visualization of the difference between h uc ij and h uc ij [B ν ] is provided in Figure 4. h uc ij is a sparse matrix for large systems and localized basis sets, since only a bounded number of basis functions in some proximity to one another will overlap. h uc ij [B ν ], in contrast, is dense for sufficiently compact set of points, e.g., a sufficiently small batch, since its indices only run over the subset of basis functions that are non-zero anywhere within the compact set of grid points (i.e., these basis functions are already located close to one another). It therefore has a memory consumption of nnz(B ν ) 2 . Parallelization and Dimensionality Reduction While different batches will have different values for nnz(B ν ) depending on local basis set density and geometry, there exists some upper limit max( nnz(B ν ) ) for the number of basis functions interacting with any batch. max( nnz(B ν ) ) depends on basis set density and local geometry but not on the system size. The independence of the size of each batch from the overall system size is responsible for the observed O(N atom ) execution of integrals, as shown in Havu et al. [37]. Parallelization and Dimensionality Reduction Once h uc ij [B ν ] has been calculated, the local copy of h uc ij on each MPI task (here denoted h uc,task ij ) is updated. There are two matrix formats for the local copy of h uc ij commonly used in FHI-aims: a globally-indexed compressed sparse row (CSR) format and a locally-indexed dense format.Both are further explained in two subsections below. The term "globally indexed" refers to storage of an identical, sparse copy of the final matrix h uc ij across all MPI tasks. In the "globally indexed" case, the size of the stored array thus grows with system size on each MPI task, regardless of the number of MPI ranks employed. In contrast, the term "locally indexed" refers to the storage on each MPI task of separate, dense matrix versions of only those integration contributions to h uc ij that are non-zero on the localized subset of grid points handled by that task. In the "locally indexed" case, the size of the stored array on each task thus remains bounded if the system size increases, as long as the number of MPI ranks is increased along with the system size. Globally-Indexed Sparse Real-Space Hamiltonian Shown in Figure 5a is a visualization of the globally-indexed sparse matrix format, in which each MPI task has a full copy of the real-space matrix along with associated indexing arrays. In FHI-aims, we use the CSR format for the sparse representation. Indexing from h uc ij [B ν ] to h uc ij in the globally-indexed CSR format requires two steps. First, the basis function index in nnz(B ν ) is mapped back to the basis function index in the set of all basis functions, i.e. the row/column indices of the matrix in Figure 4b are mapped back to the row/column indices of the matrix in Figure 4a. Second, the matrix element is mapped back to the sparse matrix representation used to store the real-space Hamiltonian matrix via indexing arrays. Globally-Indexed Sparse Real-Space Hamiltonian Each process, after evaluating all batches assigned to it, has a local incomplete copy of the real-space Hamiltonian matrix Globally-Indexed Sparse Real-Space Hamiltonian At the end of the RSDD algorithm, an in-place synchronization call sums up all local copies of h uc ij across processes, Globally-Indexed Sparse Real-Space Hamiltonian yielding the final values for the real-space Hamiltonian matrix synchronized across all processes. This is the only communication step in the RSDD algorithm. Globally-Indexed Sparse Real-Space Hamiltonian The sparse matrix storage used in this matrix format makes it an efficient choice for smaller calculations. However, it has two key disadvantages impeding its usage for large-scale calculations and massively-parallel architectures. The sparse storage of h uc ij nevertheless scales as O(N atom ) on each MPI task and will be a memory bottleneck for large-scale systems, in particular illsuited to reside in the on-board GPGPU memory. Additionally, the usage of non-trivial indexing arrays considerably impedes vectorization, making it ill-suited to the massively-vectorized GPGPU programming paradigm. Figure 5: Visualization of the two main matrix formats used for storing real-space matrices in FHI-aims. Subfigure (a) shows the globally-indexed sparse format, where each MPI task has a full copy of the matrix H in a sparse format (here, CSR) along with two indexing arrays indices and indptr. Subfigure (b) shows the locally-indexed dense format, where each MPI task has a partial section of the matrix in a dense format. Locally-Indexed Dense Real-Space Hamiltonian Shown in Figure 5b is a visualization of the locally-indexed dense matrix format, where h uc ij is distributed across processes. Each MPI task stores its portion of the integrals that contribute to h uc ij locally in a dense formati.e., those partial integrals h uc,task ij (Eq. 28) that are non-zero for this task. In short, only matrix elements involving basis functions with non-zero support on at least one batch on a given process, i.e. with support on the set ∪ Bν on task B ν , are stored. The indexing step from h uc ij [B ν ] to h uc,task ij is amenable to GPGPU resources due to the dense storage of h uc,task ij , amounting to a usage of a simple pre-calculated look-up table. Locally-Indexed Dense Real-Space Hamiltonian After the RSDD algorithm has concluded, the locally-index matrix elements h uc,task ij are distributed across MPI tasks in an overlapping fashion, i.e. a given matrix element h uc ij may have non-zero contributions h uc,task ij on multiple MPI tasks. Implementing Eq. (29) to convert these local matrices into a form h ij (non-periodic systems) or h ij (k) (periodic systems) suitable for the eigensolver (here, BLACS for ELPA) is considerably more tedious than in the globally-indexed case, as book keeping to determine ownership of matrix elements and point-to-point communication between MPI tasks is required. Nevertheless, this synchronization step only occurs once and has negligible effect on the overall timings. Locally-Indexed Dense Real-Space Hamiltonian This dense matrix format consumes more memory than the globallyindexed sparse format for small calculations, as negligible matrix elements will be computed and stored in the local dense matrices. For sufficiently large calculations with sufficiently many MPI tasks, the distributed nature of this format is far more efficient in overall memory usage than the globallyindexed sparse format, and the resulting local dense matrices fit completely into GPGPU onboard memory, minimizing CPU-GPGPU communication. Density and Density Derivatives, Force and Stress Tensor Components In principle, all computational steps of other quantities derived from basis functions on the real-space grid can profit from very similar sparsity considerations as laid out for the Hamiltonian and overlap matrices above. This entails the density and its derivatives, which (cf. Eq. (3)) obey precisely the same locality constraints in each batch of grid points as the Hamiltonian and overlap matrices. The force and stress tensor components are likewise cast in the form of numerical integrals that, within each batch, are touched by only a bounded number of localized basis functions in the limit of large systems. Density and Density Derivatives, Force and Stress Tensor Components The computationally dominant operations for all these terms are, again, dense matrix multiplications. Since they can be carried out on the same set of distributed batches of grid points as the Hamiltonian and overlap matrices, the relevant index ranges (grid points in each batch and non-zero basis functions in each batch) are effectively identical to those in Eq. (27). Quantities are either kept on the distributed grid directly (density and its derivatives, which are local quantities) or (for forces and stress tensor components) the necessary integrals can be carried out by initially assembling matrix elements with basis functions as their indices. The process for the latter matrix elements is essentially identical to the detailed distribution strategy described above for the Hamiltonian matrix. Actual force and stress tensor components in terms of atomic coordinates can then be summed up from these matrix elements once, after the entire integration grid has been completely processed. Figure 6 shows pseudocode for the CPU-only and GPGPU-accelerated implementations of the real-space (a) Hamiltonian matrix integration and (b) electron density update. We refer to these two operations collectively as "the real-space operations" hereafter. The basic structure of the real-space operations consists of a loop over every batch assigned to the process, possibly followed by a final post-processed synchronization across all processes for integrals. No synchronization is necessary for the electron density update, as the real-space points where the electron density is defined are distributed across processes. For each batch assigned to a process, its contribution to the desired quantity is calculated. The processing of each batch can be broken up into three phases: initial processing where the necessary quantities (basis functions on each grid point, their gradients, etc.) are computed, a sequence of serial dense linear algebra operations (e.g., Eq. (27)), and a final indexing step to sort matrix contributions from each batch into their respective storage arrays on each MPI task. GPGPU Acceleration of the Real-Space Domain Decomposition Algorithm Common to the initial processing phase for all real-space operations is the construction of the basis elements ϕ i ∈ nnz(B ν ) for all r ∈ B ν . The initial processing phase for the electron density update additionally includes the reduction of the density matrix of the full system (stored in a sparse representation) to the dense-but-smaller n ij matrix as outlined in the previous section. The real-space Hamiltonian matrix integration requires that the pre-computed integration point weights be re-indexed for the current batch and the quantities {ĥ KS ϕ i (r)} be evaluated on every point in B ν for all basis elements in nnz(B ν ). The construction of {ϕ i (r)}, and {ĥ KS ϕ i (r)} for each point on a batch is executed per point, with relatively small workload compared to the final DGEMMs, but with some thread-divergent branching statements during the construction, i.e. not immediately suitable for GPGPUS. As we will see below, for the integrals, we can overlay this work on the CPU while the GPU works on something else. GPGPU Acceleration of the Real-Space Domain Decomposition Algorithm The dense linear algebra phase consists of two subroutine calls for Hamiltonian integration: a matrix multiplication (DSYR2K for the real-space Hamiltonian matrix and DSYMM for the electron density) and a dot product. This step is offloadable to the GPGPU at the cost of communication of the quantities previously calculated during the initial processing phase: the integration weights w(r), basis functions {ϕ i (r)}, and {ĥ KS ϕ i (r)} matrix for the real-space Hamiltonian integration in Eq. (22), and the basis functions ϕ and batch subspace restricted density matrix n ij for the electron density in Eq. (3). GPGPU Acceleration of the Real-Space Domain Decomposition Algorithm The final phase for each loop iteration is an indexing phase, where the results from the dense linear algebra phase h uc ij [B ν ] are indexed back into the accumulated matrices h uc ij . The GPGPU acceleration strategy for the realspace Hamiltonian integration diverges based on the choice of indexing for the Hamiltonian matrix h uc ij : (i) The globally-indexed CSR format uses several thread-divergent branching conditionals, complicating GPGPU acceleration of the indexing. The GPGPU-accelerated algorithm thus communicates the results of the dense linear algebra step for each batch back to the CPU, which performs the indexing. In this approach, the CPU is idle while the GPGPU evaluates the dense linear algebra for each batch. GPGPU Acceleration of the Real-Space Domain Decomposition Algorithm (ii) Alternatively, when using the locally-indexed dense storage format for h uc ij , indexing is embarrassingly parallelizable, allowing for the usage of custom CUDA kernels to perform the indexing on the GPGPU. After the CPU has communicated {ϕ i (r)} and {ĥ KS ϕ i (r)} to the GPGPU, it is free to begin calculating {ϕ i (r)} and {ĥ KS ϕ i (r)} for the next batch, allowing for effective overlay of computation between the CPU and GPGPU. Communication from the GPGPU back to the CPU occurs only once at the end of the algorithm, when the GPGPU communicates its copy of h uc ij back to the CPU. GPGPU Acceleration of the Real-Space Domain Decomposition Algorithm A similar approach to (ii) is employed when calculating the electron density or its derivatives, as the mapping from real-space points r ∈ B ν to the set of all integration points assigned to the present process ∪ Bν on task B ν is trivial. This permits the electron density indexing to be performed via a simple CUDA kernel and stored on the GPGPU locally, similarly avoiding communication from the GPGPU back to the CPU communication for each batch. The electron density stored on the GPGPU is communicated back to the CPU at the end of the algorithm. Results All benchmark calculations were performed with the full-potential, allelectron FHI-aims electronic structure code [30,37] using its productionquality "tight" basis sets and "tight" real-space integration grids and Hartree potential. The PBE functional [101] was used to model exchange-correlation effects. We use a Γ-point-only k-grid in this work, as we focus on real-space operations whose timings are independent of the selected reciprocal-space grid. All timings shown use the locally-indexed dense matrix format (Figure 5b) for the Hamiltonian integration and forces/stress evaluation. The choice of "tight" settings is important since the larger workload associated with denser grids and larger basis sets can dominate the overall effort associated with a particular DFT-based simulation project. By construction, larger workloads of this kind also benefit more from GPGPU acceleration. For progressively lighter settings, smaller but still useful speedups would be expected. The benchmarks below reflect the highest-cost parts of a routine simulation where, it turns out, GPU acceleration will most efficiently take off the edge of a very large workload. Results The time-intensive operations for semi-local DFT in FHI-aims are the real-space Hamiltonian integration (Eq. (10) or (12)), density update (Eq. Results (3)), Hartree potential calculation (Eq. (9)), and the solution of the Kohn-Sham eigenvalue equation (Eq. (13)). Figure 1 shows a schematic for the program flow of a standard KS-DFT calculation with geometry relaxation or molecular dynamics. First, the electronic structure for current geometry is converged by iterative calculation of the Hartree potential (9), Hamiltonian operator (Eq. (1)), Hamiltonian matrix elements (Eq. (10) or 11), and electron density via the Kohn-Sham eigenvalue equation (Eqs. (3) and (13)). We denote a single collective iteration of these operations in which the electronic structure is updated as a "standard" SCF iteration. Results Once self-consistency is reached in the electronic structure, F at and σ λµ may be calculated by Eqs. (14) and (20) respectively. The implementation of Eqs. (14) and (20) in FHI-aims are published in [30,83]; here, it is sufficient to highlight two contributions to F at and σ λµ which contribute appreciably to timings: Results • The Hellmann-Feynman contribution to F at and σ λµ is calculated alongside the Hartree multipole summation, as it relies on the Hartree potential of the system. Thus, the domain decomposition strategy is not used for evaluating this contribution, and GPGPU acceleration is not employed. Results • The Pulay contribution to F at and σ λµ is calculated alongside the density update, as it relies on the density matrix n ij and the energyweighted density matrix q ij . The domain decomposition strategy is used for evaluating this contribution. Its evaluation is GPGPU-accelerated using the strategy outlined in Section 3.4. Results While the calculations of these quantities are computationally expensive, they are ideally evaluated only once per geometry step (outer loop of Figure 1), whereas the SCF iterations will be evaluated multiple times per geometry step (inner loop of Figure 1). In principle, the electronic structure should be further iterated until F at and σ λµ have converged. The production settings for FHI-aims are sufficiently tight that in practice only a single calculation of F at and σ λµ are needed at the end of each self-consistency cycle. The geometry is then updated using F at and σ λµ . Accordingly, we benchmark three different types of SCF iterations in this paper: Results • "SCF": a single iteration of the SCF cycle loop, Results • "SCF + F at ": a single iteration of the SCF cycle loop followed by the computation of forces F at , and Results • "SCF + F at + σ λµ ": a single iteration of the SCF cycle loop followed by the computation of forces F at and stress tensor σ λµ . We emphasize that these timings are per iteration, not per cycle. As outlined in Figure 1, a given system geometry loop will contain multiple iterations of "SCF" but ideally only one iteration of "SCF + F at " or "SCF + F at + σ λµ " per geometry step. We cover a broad range of GPGPU-accelerated architectures by performing benchmarks on four different architectures provided by three different computing clusters: a local cluster ("timewarp") at Duke University, a dedicated testing cluster ("PSG") at NVIDIA Corporation, and the Lassen supercomputer at Lawrence Livermore National Laboratory ("LLNL"). The hardware architectures, which we categorize based on CPU and GPU generations, are IvyBridge/GP100 [timewarp], Haswell/P100 [PSG], Skylake/V100 [PSG], and POWER9/V100 [LLNL]. More information on architectures may be found in Table 1. Full node utilization was employed for all architectures except on IvyBridge/GP100 [timewarp], where 16 MPI tasks were used (out of the 20 physical cores) due to limitations imposed on Pascal GPGPUs by the NVIDIA MPS service, which was used to distribute the computational load to the GPGPU. Results We consider two types of timings for a given operation in this work, the timing t CP U for an operation when employing all available CPU cores on a given node using the Message Passing Interface (MPI), and the timings t GP GP U for an operation when GPGPU acceleration has been employed alongside full CPU node utilization. The GPGPU-accelerated speedup, or simply "speedup", is then defined as Results Using this definition, identical timings for CPU-only and GPGPU-accelerated operations correspond to a speedup of s = 1.0. We note specifically that this is a hard comparison, in that the GPU+CPU timings must be better than a computation using all CPU cores on a given, state-of-the-art node to show a net speedup. Materials Used Two different sets of materials are considered in this work: Materials Used • The first set of materials is a benchmark set comprising 103 different inorganic compounds (bulk solids), proposed in [91] The compounds in this benchmark set span 66 chemical elements in 10 structural prototypes, providing a broad coverage of the structural and chemical diversity found in real-world condensed-matter simulations. 3×3×3 supercells of the primitive cell for each material were used, leading to cell sizes of 27, 54, and 108 atoms. In addition to discussing averaged / aggregated data, we highlight timings for the 54-atom diamond Si supercell calculation as a particular example in the body of this text. The benchmark set is investigated on a single node of three out of the four architectures listed in • The second set of materials consists of a 5×5 supercell of a 2D Bi 2 Se 3 bilayer. A vacuum thickness of 40Å was used. In a standard FHI-aims calculation, the vacuum thickness contributes to timings only through the reciprocal-space contribution of the Ewald summation [102,30] used to evaluate the electrostatic potential to the Hartree potential. Calculations for the Bi 2 Se 3 bilayer were performed on the POWER9/V100 Materials Used [LLNL] architecture using 2 to 128 nodes. Table 2 shows a comparison of timings computed on the Skylake/V100 [PSG] architecture for diamond Si. The evaluation of the electron density and its gradients is the dominant contribution to the total time for all SCF iteration types. The relative weight of the density calculation increases for SCF iterations involving F at and σ λµ as the evaluation of the Pulay contribution must also be performed in this step. For an SCF + F at + σ λµ iteration, 95% of the calculation time is spent calculating the density and the Pulay contribution to F at + σ λµ . The timing for Hartree summation weakly increases for SCF cycles involving F at as the Hellmann-Feynman forces must Only t CP U is presented for the Hartree summation and Hellmann-Feynman contributions to F at and σ λµ , as GPGPU acceleration is not employed for these calculations. All timings were taken from a single calculation. GPGPU Acceleration Across Materials and Architectures be calculated, but this is a comparatively small expense relative to the time required to compute the Pulay terms. In contrast, the Hamiltonian integration does not include F at or σ λµ components, leading to consistent timings across iteration types. For all three iteration types, when GPGPU acceleration is enabled, there is a consistent s=6.4 speedup in the Hamiltonian integration on the Skylake/V100 [PSG] architecture. Differences in the GPGPU performance are observed when calculating the density, its gradients,and potentially the Pulay contributions to forces and stress. Speedups of 3.9, 8.4, and 10.4 are observed in the density calculation on the Skylake/V100 [PSG] architecture for the standard SCF, SCF + F at , and SCF + F at + σ λµ iterations, respectively. The differences in speedups arise from the increased workload of dense linear algebra performed when calculating the Pulay contribution to F at and σ λµ . The computationally more demanding iterations with more dense linear algebra exhibit greater GPGPU-accelerated improvements for timings in both relative and absolute terms. Speedups for the total times of an iteration show a similar trend to the density update, with speedups of 3.1, 5.7, and 7.8 observed on the Skylake/V100 [PSG] architecture for the three SCF iteration types. The density update dominates the runtimes for the iterations. While an individual SCF + F at + σ λµ iteration benefits greatly from GPGPU acceleration and takes considerably more time than a standard SCF iteration, it is calculated only when self-consistency is reached and often only needs to be calculated once (Fig. 1). On the other hand, there will be multiple standard SCF iterations, which show a reduced GPGPU speedup. To assess the impact of this difference in speedups on the overall timing of a calculation, Figure 7 shows the timings for complete calculations for diamond Si on IvyBridge/GP100 [timewarp], Haswell/P100 [PSG], and Skylake/V100 [PSG] architectures. Self-consistency is reached after 12 standard SCF iterations and one SCF + F at + σ λµ iteration, leading to speedups between 3.7 and 4.0 for the total time of the calculation. GPGPU Acceleration Across Materials and Architectures We next turn our attention to the 103 material benchmark set. To compare results from different materials, we estimate the expected workload for a given material using a metric GPGPU Acceleration Across Materials and Architectures where |B ν | is the average number of points per batch for a material, nnz(B ν ) is the average number of basis functions with non-zero support per batch for a material, and #B ν is the number of batches for a material. The quantity M M is then a measure of the timing for a hypothetical real-space operation involving a single matrix multiplication, and # ops is a measure of the total time of the real-space operation across all batches. As motivated by Eq. (27), and as we show below, this metric will give an approximate estimate for the expected workload, as it is expected to map particularly the dominant part Figure 7: Overall timings across architectures for the calculation for a 54-atom Si supercell (diamond structure). All calculations contain initialization, 12 SCF iterations, and 1 SCF + F at + σ λµ iteration. Importantly, this also contains all non-GPU accelerated parts of the calculation of the workload associated with dense serial matrix multiplications with high accuracy. GPGPU Acceleration Across Materials and Architectures Shown in Figure 8 are timings for an SCF + F at + σ λµ iteration calculated using Skylake/V100 [PSG]. The proposed metric correlates well to the timings observed for real-space operations in FHI-aims. A strong linear trend for the Hamiltonian integration (Fig. 8a) and density + force + stress evaluation (Fig. 8c) is observed, reflecting the relatively significant workload of dense linear algebra in these operations. The total time for an iteration (Fig. 8a) shows a similar trend, as it is dominated by the density + force + stress evaluation. No such trend is observed in the Hartree multipole summation, which does not rely on dense linear algebra and is also not yet GPU accelerated in the present work. GPGPU Acceleration Across Materials and Architectures Average speedups of 3.7, 9.0, and 6.6 are observed for Hamiltonian integration, density evaluation, and the total time for an SCF + F at + σ λµ iteration for the 103 material benchmark set. These speedups are consistent with the speedups observed for diamond Si. Table 4 shows a comparison across architectures for the speedups calculated for the 103 material benchmark set. These results are analogous to the results in Table 3, indicating that our analysis of trends observed in the diamond Si system extends to other materials and other architectures as well. Strong Scaling for CPU-Only and GPGPU-Accelerated Calculations The calculations in the previous section were performed using a fixed number of MPI tasks on a single node. In the present section, we assess the scaling across nodes using a 375-atom Bi 2 Se 3 bilayer system as a larger example. Strong scaling plots for the POWER9/V100 [LLNL] architecture are shown in Figure 9, with subfigure (a) showing a standard SCF iteration and subfigure (b) showing an SCF + F at + σ λµ iteration. Timings for 80, 160, 320, 640, 1280, 2560, and 5120 MPI tasks are presented, and we reintroduce the timings for the solution of the Kohn-Sham eigenvalue equation. The slab geometry corresponds to a (5×5) supercell, using FHI-aims' "tight" production settings (17,850 basis functions total) and a Γ-point only calculation is performed. The calculations shown correspond to scalar-relativistic self-consistency iterations for this system, i.e., the workload that constitutes the bulk of a typical DFT calculation for such a system. As shown in [91] and others, the energy band structure of such a system is subject to spin-orbit coupling effects that would be essential to include at least at a post-processed second-variational (i.e., perturbative) level for qualitatively correct results. The necessary spin-orbit coupled Hamiltonian matrix integrals follow the exact same algorithms as those of the scalar-relativistic integrations shown in Fig. 9(a) and are therefore not repeated in detail in the plots. Strong Scaling for CPU-Only and GPGPU-Accelerated Calculations Timings for the Bi 2 Se 3 bilayer are dominated by the real-space density update and potentially forces and stresses, consistent with the results from the previous section. GPGPU-accelerated speedups of 1.8 -2.1 and 7.8 -9.8 are observed for overall timings in a standard SCF iteration and SCF + F at + σ λµ iterations, respectively. Real-space operations show ideal scaling as a function of the number of MPI tasks, as is expected for the domain decomposition algorithm. The solution of the Kohn-Sham matrix eigenvalue problem using the ELPA library [92,77,79,78] (not GPU-accelerated in Fig. 9) shows reduced scaling due to the still relatively small matrix dimension size, but its diminished weight in these calculations does not meaningfully impact the overall scaling of the calculations. A denser k-space grid (e.g., 2×2×1 or 4×4×1) would increase the eigenvalue solver related workload and could be accelerated, e.g, by the recently published distributed-parallel, GPGPUaccelerated one-stage ELPA solver [79,78] (a computational step that is separate and independent of the real-space operations reported in this work). Conclusion In this paper, we show GPGPU acceleration for real-space operations relevant in semilocal DFT for production-quality materials simulations. We particularly focus on the domain decomposition method used by the fullpotential, all-electron FHI-aims electronic structure code for real-space operations. We show that the time-intensive portions of the domain decomposition method are dense linear algebra operations which are bounded in memory consumption, allowing for efficient offloading to GPGPU resources. Conclusion The performance of the GPGPU acceleration in FHI-aims was assessed using a 103-material benchmark set on three heterogeneous CPU-GPGPU architectures. GPGPU-accelerated speedups ranging from s = 2.4 for SCF iterations to s = 6.6 for SCF iterations including evaluation of forces F at and the stress tensor σ λµ were observed, with an overall estimated speedup of s ≈ 3 − 4 expected for total times for entire calculations. Conclusion Scaling on HPC resources was assessed on LLNL's Lassen calculations involving a 375-atom Bi 2 Se 3 slab supercell. The GPGPU-accelerated implementation shows near-ideal scaling similar to the CPU-only implementation. We find that the evaluation of the density, forces, and stress tensors is the dominant computational workload for the 375-atom bilayer, allowing for overall GPGPU-accelerated speedups of s≈8-10. For significantly larger systems, the well-known cubic bottleneck of the Kohn-Sham DFT equation (the eigenvalue solver, which is not GPGPU-accelerated in this work) would begin to dominate the computational workload. However, a large subset of electronic structure computational needs in the range of small and mid-sized problems (below the range in which the eigenvalue solver dominates, i.e., up to several hundred atoms in this work) becomes accessible to GPGPU acceleration using the localized basis set strategies described above. Acknowledgements This work was supported by the LDRD Program of ORNL managed by UT-Battelle, LLC, for the U.S. DOE and by the Oak Ridge Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC05-00OR22725. A portion of work was conducted at the Center for Nanophase Materials Sciences, which is a DOE Office of Science User Facility, and supported by the Creative Materials Discovery Program through the National Research Foundation of Korea funded by the Ministry of Science, ICT and Future Planning (NRF-2016M3D1A1919181). We gratefully acknowledge the support of NVIDIA Corporation with the donation of Quadro GP100 and Titan V GPGPUs used for local development, as well as access to their PSG cluster. We thank Dr. Vincenzo Lordi and the Lawrence Livermore National Laboratory (LLNL), a U.S. Department of Energy Facility, for assistance with and access to LLNL's supercomputer Lassen for benchmarks conducted in this work. The work on LLNLs Lassen supercomputer was performed under the auspices of the U.S. Department of Energy at Lawrence Livermore National Laboratory under Contract No. DE-

섹션 본문 98문단 · 57,106자

(제목 없음)

1We present an implementation of all-electron density-functional theory for massively parallel GPGPU-based platforms, using localized atom-centered basis functions and real-space integration grids. Special attention is paid to domain decomposition of the problem on non-uniform grids, which enables compute-and memory-parallel execution across thousands of nodes for realspace operations, e.g. the update of the electron density, the integration of the real-space Hamiltonian matrix, and calculation of Pulay forces. To assess the performance of our GPGPU implementation, we performed benchmarks on three different architectures using a 103-material test set. We find that operations which rely on dense serial linear algebra show dramatic speedups from GPGPU acceleration: in particular, SCF iterations including force and stress calculations exhibit speedups ranging from 4.5 to 6.6. For the architectures and problem types investigated here, this translates to an expected overall speedup between 3-4 for the entire calculation (including non-GPU accelerated parts), for problems featuring several tens to hundreds of atoms. Additional calculations for a 375-atom Bi 2 Se 3 bilayer show that the present GPGPU strategy scales for large-scale distributed-parallel simulations.

Introduction

2Kohn-Sham density-functional theory (KS-DFT) [1,2] is the primary tool for computational materials prediction across a wide range of areas in science and engineering [3,4,5,6]. One class of KS-DFT codes uses spatially localized atom-centered basis sets, e.g. Gaussian orbitals [7,8,9,10,11,12,13,14,15,16,17], Slater orbitals [18,19,20], and numeric atom-centered orbitals (NAOs). [21,22,23,24,25,26,27,19,28,29,30,31] For these basis sets, local operations such as Hamiltonian and overlap matrix integrations, updates of the electron density and its gradients, or parts of force and stress tensor computations, can be carried out on real-space grids. Due to the locality of the basis functions and of the Kohn-Sham potential, these operations can be implemented such that the computational timings scale linearly in number of atoms. [32,33,34,35,19,28,36,37] Accordingly, in the system size range for which real-space operations dominate the cost -typically small-to-mid-sized calculations comprising several tens to hundreds of atoms -this translates into approximately linear-scaling overall execution times as well. For larger-scale calculations, most KS-DFT codes have a formal default O(N 3 atoms ) scaling due to the reliance on eigenvalue solvers to directly solve the Kohn-Sham eigenvalue problem for all occupied electron states, known as the "cubic wall" of standard KS-DFT. However, much of the practical science addressed by KS-DFT occurs below this limiting regime and instead in the range where operations with lower scaling exponents still account for the majority of the cost.

3An increasingly available paradigm in high-performance computing (HPC) are general purpose graphics processing unit (GPGPU)-accelerated architectures, in which each computational node contains one or more GPGPU accelerators working in tandem with the traditional CPUs employed in HPC applications. GPGPUs are well suited for evaluation of highly vectorizable, compute-intensive algorithms due to their unique massively-parallel design, prompting early work to demonstrate matrix multiplications [38] and FFTs [39] on commodity hardware. The feasibility of GPU-accelerated electronic structure calculations was demonstrated in works by Ufimtsev and Martínez [40,41,42,43] which would form the basis for the TeraChem electronic structure package [44], as well as by Yasuda using the Gaussian package [45,46]. Since then, a number of electronic structure packages have incorporated GPU acceleration, including ABINIT [47], ADF [48], BigDFT [49,50], CP2K [51], GPAW [52,53,54], LS3DF [55], octopus [56,57,58], ONETEP [59], PEtot (now PWmat) [60,61,62,63], Q-Chem [64,65,15], Quantum ESPRESSO [66,67], RMG [68,69], VASP [70,71,72,73], and FHI-aims (this work). Development cost can be alleviated by using dropin GPU-accelerated libraries such as cuBLAS [74], cuFFT [75], Thrust [76], ELPA [77,78,79], and MAGMA [80,81,82] for general mathematical operations. Nevertheless, GPU acceleration is generally not a trivial task due to the need to target low-level algorithms, which constitute the majority of the computational workload, specific to a given software package and port them to a new architecture. However, the raw computational output afforded by GPGPUs can be immense.

4In this paper, we describe a careful GPGPU adaption and analysis of several of the dominant real-space operations for KS-DFT in the NAO-based full-potential, all-electron electronic structure code FHI-aims. [30,37,83] FHI-aims is a general-purpose electronic structure simulation code, offering proven scalability to thousands of atoms and on very large, conventional distributed-parallel high-performance computers. [84,77,85,86] The code achieves benchmark-quality accuracy for semi-local [87,17], hybrid [88,89,17], and many-body perturbative [88,90] levels of theory. The specific implementation described here helps unlock the potential of GPGPU architectures for a broad range of production simulations using semilocal DFT, including generalized gradient approximation (GGA) and meta-GGA exchangecorrelation functionals. We specifically target Hamilton and overlap matrix integrations, updates of the density and its gradients, and the computation of forces and stress tensor components.

5In FHI-aims, linear scaling in the real-space operations covered in this paper is achieved using a real-space domain decomposition (RSDD) algorithm [37], wherein the set of all real-space integration points is subdivided into compact sets of points known as "batches". As shown below, this RSDD algorithm is naturally parallel in both memory and workload and thus allows for an efficient load-balanced, distributed-parallel GPGPU-assisted im-plementation. The problem sizes for each individual batch of points are naturally suited for GPGPU acceleration, allowing for the usage of drop-in GPGPU-accelerated libraries with minimal code restructuring necessary for the Hamiltonian matrix integrals, update of density and density gradients, and total energy gradients. The electrostatic potential calculation uses a multipole summation algorithm differing from the RSDD algorithm presented here and thus was not GPGPU-accelerated for this work. Likewise, the exact-exchange operator of hybrid DFT and eigenvalue solutions that can be accessed through libraries such as ELPA [77,78,79] and MAGMA [80,81,82] are not targeted by this work. This paper is organized as follows. First, we outline the fundamental equations entering into real-space Kohn-Sham density functional theory. Next, we discuss design principles for numerical algorithms which facilitate optimal usage of GPGPU resources, the RSDD algorithms used for evaluating integrals with FHI-aims and their adaption for execution on GPGPU resources. Finally, timing and scaling benchmarks for four different GPGPUaccelerated architectures and two sets of materials demonstrate GPGPU speedups for real-space integrations across a broad class of architectures and systems encountered in electronic structure based materials simulations.

Background

6Within the Born-Oppenheimer approximation, the objective of KS-DFT is to determine the electron density n(r) for a given set of fixed nuclear position {R at } of each atom (the "system geometry"). The ground-state total energy E tot [n] and other observables are then evaluated as functionals of n(r). Throughout this section, we assume a non-spin-polarized system for simplicity. However, the extension to collinearly spin-polarized systems is straightforward, as is the extension to spin-orbit coupled and/or non-collinear spin systems, [91] since the underlying matrix integrals, density and gradient updates follow exactly analogous formulae. The density is determined by solving an effective single-particle Hamiltonianĥ KS . In scalar-relativistic form,ĥ

7wheret s is the (scalar-relativistic) kinetic energy,v ext is the external potential,v H [n] is the Hartree potential of the electrons, andv xc [n] is the exchange-correlation potential. Evidently, the density n(r) depends on the Hamiltonianĥ KS and the Hamiltonian depends on the density. Finding a stationary density that yields the particular Hamiltonian that generates this density is a non-linear optimization problem and is cast as a "self-consistent field" (SCF) cycle. The complete flow of a typical electronic structure calculation is shown in Figure 1, which also indicates the specific operations that are GPUaccelerated in this work. For a given set of initial nuclear positions, the eigenfunctions {ψ l } (with eigenvalues l ) and/or the stationary density of the Hamiltonian in Eq. (1) are expressed in terms of a finite set of basis functions {ϕ i }. For a non-periodic system, this expansion has the form

8N b is the size of the basis set and c il is the coefficient of the l th eigenvector for the i th basis function. The density can then be computed as

9where n ij is the density matrix, defined as

10where f l is the occupation number of orbital ψ l . If n ij is already known, Eq. (4) may be implemented in an O(N ) approach for localized basis elements. Initial guesses for the electronic structure ( Figure 1) can either be given in terms of ψ l (r) or in terms of n ij . In FHI-aims, these initial quantities are produced by solving the Hamiltonian in Eq. (1) for the potential of a sum of overlapping free-atom densities. The density gradient ∇n is required for GGA calculations, where the Hessian ∇ 2 n dependence in the exchangecorrelation potential energy may be converted to a ∇n dependence via integration by parts (Eq. (30) of [30]) The Hessian is required for any force computation, or when evaluation of the explicit Kohn-Sham potential for GGAs is needed for any other reason.

11In this work, we use localized atom-centered basis functions, which are generally non-orthonormal to one another and yield a non-trivial overlap Figure 1: Program flow for a typical electronic structure calculation involving geometry relaxation or molecular dynamics. Shaded boxes indicate steps contributing to the actual computational workload. Yellow shading indicates steps that are subject to real-space GPU acceleration in this work, whereas gray shading indicates steps that are GPU-accelerated only partly, not at all, or that are handled by separate software components [92,77,79,78,86] outside the scope of this work.

12For periodic systems, we discretize the eigenvectors in terms of Bloch orbitals {χ ik } that are extended throughout the entire crystal:

13k is the crystal momentum quantum number and N b is the number of basis functions associated with a single unit cell. Each χ ik is associated with a particular localized basis function ϕ i (r) and its periodic images in all other unit cells (labelled by lattice translation vectors T ) via the transformation

14As a result, χ ik (r) is normalized per unit cell. The relevant overlap matrix is then

15Importantly, for spatially localized real-space basis functions {ϕ i (r)}, and using Eqs. (6) and (7), the density matrix can also be expressed in terms of the real-space basis functions, just like in Eq. (3). The difference is that the sum in Eq. (3) now runs over real-space basis functions and their images both inside and outside a given unit cell. More precisely, since only grid points r inside a single cell (say, the cell at T =(0,0,0)) need be considered, i and j in Eq. (3) run from 1, ..., N rs , where N rs is the number of all localized real-space basis functions in the crystal that are non-zero somewhere inside the volume of the unit cell at T =(0,0,0). As mentioned above and as indicated in Figure 1, the density computation Eq. (3), which has the form of matrix multiplications, is GPU-accelerated in this work. Additionally, the calculation of density gradients ∇n(r) is necessary for almost any current density functional approximations, i.e., GGA and beyond. Finally, the Hessian matrix of the density, ∂ x i ∂ x j n(r) (i, j=1,..., 3), is needed at least for total energy gradient calculations (forces and stresses). For a given density matrix, these gradients are straightforward extensions of Eq. (3), but their evaluation can still contribute significantly to the overall computational cost: ∇n(r) has three components, ∂ x i ∂ x j n(r) has six components, and each component has the same cost as the evaluation of n(r) itself.

16As a next step, the Hartree potentialv H [n] in Eq. (1) is a local operator of the formv

17In practice,v ext (which includes the potential due to the nuclei) andv H [n] (the averaged electrostatic potential due to the electron density) are treated together in order to evaluate an overall charge-neutral system. As mentioned above, this full electrostatic potential may be computed via a multipole summation scheme [30] and is not subject to GPGPU acceleration in this work.

18In the system range investigated here, it does not dominate the computational cost.

19In non-periodic system geometries and for real-valued local basis functions ϕ i (r), the Hamiltonian is naturally expressed in terms of matrix elements h ij with an integral form of

20In periodic boundary conditions,

21In the periodic case, each matrix element h ij (k) can still be summed up from local real-space integrals (the equivalent of Eq. (10)) of the following type:

22However, in contrast to the non-periodic case, the running indices i and j for h uc ij in Eq. (12) are not restricted to 1, ..., N b (the number of basis functions associated with a single unit cell) but instead run over 1, ..., N rs , the number of localized real-space basis functions in the crystal that are non-zero somewhere inside the volume of the unit cell at T =(0,0,0). The local integrals h uc ij can be computed using the exact same real-space integration code as their non-periodic equivalents. The only difference is that each integration point r is mapped back to its periodic image within the unit cell at T =(0,0,0), so that the local integrals in Eq. (12) are restricted to that unit cell. The full Bloch integrals h ij (k) can then be constructed by inserting Eq. (7) into Eq. (11). The expression for h ij (k) becomes a sum over individual real-space integrals of form h uc ij , multiplied by Bloch phase factors e ik·(T i −T j ) that connect the unit cells where the real-space basis functions i and j are centered. The overlap matrix elements s ij (k) can be constructed analogously. To unify the notation between periodic and non-periodic systems, we will refer to both Eqs. (10) and (12) as the "real-space Hamiltonian matrix" h uc ij for the remainder of this paper. As shown in Figure (1), its computation is GPU-accelerated in this work.

23Given the updated KS-DFT Hamiltonian, the Hamiltonian's approximate eigenvectors ψ lk (r) and eigenvectors lk can now be found by solving

24(for non-periodic systems, the k index may just be omitted). A new density matrix n ij can thus be found. The eigenvector-based approach Eq. (13) scales computationally at least as O(N 3 e ), where N e is the number of electrons in the system. Alternatively, the KS eigenvalue problem may be circumvented entirely by density-matrix-based solvers, [93,94,95,86] often with reduced-dimensional scaling. In FHI-aims, the solution of the KS eigenvalue equation in matrix form is performed via the dense generalized eigensolver library ELPA [92,77,79,78] or circumvented by other solvers interfaced through ELSI [86], an open-source library which provides an interface layer between KS-DFT codes and methods that solve or circumvent the Kohn-Sham eigenvalue problem in density-functional theory. The GPU acceleration or circumvention of Eq. (13) is thus not the topic of this paper; however, options exist in the form of the open-source, GPU-accelerated ELPA and MAGMA eigensolver libraries that are benchmarked elsewhere in the literature. [78,79,80,81,82] After the SCF cycle for a given geometry is complete, electronic structure calculations may continue by changing the geometry of a material as the calculation progresses, e.g. to find a local minimum-energy geometry at the Born-Oppenheimer surface, or for molecular dynamics. In these cases, the position of atomic nuclei, R at , are updated by calculating the forces on each atom,

25as a function of the electronic structure after the SCF cycle has converged.

26Here, E tot is the Born-Oppenheimer total energy of the material and the subscript at labels different atoms for convenience. For localized basis elements, the computationally expensive portion of Eq. (14) is the Pulay forces, which on the scalar-relativistic -here, the atomic zero-order regular approximation (atomic ZORA; cf. Eqs. (55) and (56) in [30]) -and GGA level have the form

27where

28is the local (density-only) parts of the Pulay forces,

29is the q ij energy-weighted density matrix,

30is the correction to the Pulay forces arising from explicit density gradients in GGA, and

31is the correction to the Pulay forces arising from atomic ZORA.

32For periodic calculations, one may also calculate overall stresses on the computational cell by calculating the stress tensor

33after the SCF cycle has converged. Here, λµ is the symmetric, infinitesimal strain tensor and V is the volume of the computational cell. A full account of the terms that make up the stress tensor in an atom-centered basis set is given in [83]. As mentioned above, the computation of the gradients Eqs. (14) and (20) using atom-centered basis functions for semilocal density functionals can include the numerically expensive evaluation of higher density derivatives such as the density Hessian and similar quantities evaluated on a real-space grid. When needed, the computational cost of Eqs. (14) and (20) can therefore amount to a large fraction of the overall time required to execute the type of computation shown in Figure 1. The corresponding steps are thus also GPU accelerated in this work, using the same real-space grid techniques as for the density and the Hamilton matrices, outlined below.

Design Principles for GPGPU-Accelerated Code

34There are three major design priorities entering into GPGPU acceleration of an algorithm:

35• The workload offloaded to the GPGPU should be highly vectorizable,

36• Thread-divergent branching statements (e.g. "if" statements that can lead to different conditional states for different threads) should be avoided in the workload offloaded to the GPGPU, and

37• Communication between the CPU and GPGPU over relatively slow buses should be minimized.

38Sections of an algorithm which are not easily vectorizable and/or contain a large number of thread-divergent branching statements should be performed by the CPU(s), and sections of an algorithm that are easily vectorizable should be offloaded to the GPGPU. Ideally, GPGPU and CPU workloads should be carried out in parallel in an asynchronous fashion if that is possible. There is an additional design priority implicit in this scheme: the problem size for the workload offloaded to the GPGPU must fit into the GPGPU's onboard memory.

Computational Choices in FHI-aims 3.2.1. Real-Space Integration Grids

39A visualization of the real-space integration grids in FHI-aims for a mercury atom is shown in Figures 2a (light settings of FHI-aims) and 2b (tight settings of FHI-aims. Analogous figures for the multi-atom benzene molecule are shown in Figures 2c and 2d. The grid consists of spherical shells of points around each nucleus, with individual grid points located on each shell according to the point distributions described by Lebedev et al. [96,97,98] and Delley [99]. For the mercury atom, the outermost spherical shells can be observed as "rays" of points far from the respectively nuclei. Closer to the nucleus, there are less points per spherical shell, but the radial density of spherical shells increases systematically (see Eq. 18 in [30]) to account for rapidly varying wavefunctions.

40In polyatomic systems like benzene, every atom contributes integration points to the overall integration grid of the system. The radial cutoffs for the radial integration grids well exceed bond lengths in molecules and materials, leading to a densely-interlocking, irregular cloud of integration points covering both nuclear and interstitial regions. Integration weights w(r) are calculated on-the-fly (see Eq. (111) and Appendix C in [83] for the exact definition of the respective weight functions used in FHI-aims), yielding a form for the real-space Hamiltonian integration

41or (for periodic systems)

42FHI-aims calculates w(r) using a partition-of-unity approach [100] with a modified form of the O(N atom ) partitioning scheme proposed by Stratmann et al. [33] (see Eqs. 111-112 and C.5-C.8 in Knuth et al. [83]), where N atom is the number of atoms in the computational cell. Here, it is sufficient to note that the resulting set of points is not an simple even-spaced grid and may be freely distributed across processes. Also, the process to update overlap matrix integrals s ij or s uc ij (once per SCF cycle) is exactly analogous to the process outlined below for the elements of the Hamiltonian.

43The default basis sets {ϕ i (r)} used by FHI-aims for evaluating Eq. (22) are preconstructed sets of numerical atom-centered orbitals (NAO) optimized for KS-DFT-based total energy calculations, as outlined in [30] The NAO basis sets used in FHI-aims have been shown to have accuracy on par with the best available benchmark codes for total and atomization energies of molecules [17] and calculated equations of state and band energies for solids [87,91]. A cutoff potential is used to smoothly limit the spacial extent of the basis functions. The cutoff potential (Eq. (9) in [30]) reaches infinity at a user-definable outermost edge that is 6Å for most chemical species using tight settings. Thus, any radial functions approach zero smoothly at this radius and remain zero at larger distances from their center.

Real-Space Domain Decomposition (RSDD)

44The RSDD is used for the update of the electron density and integration of various matrix elements for semi-local operators. We will focus on integration of the real-space Hamiltonian matrix (Eqs. (10) and (12)) in this section, although the procedure presented applies to matrix elements of an arbitrary semi-local operator. Additional steps related to the electron density update will be presented when relevant. A detailed study of the expected linear scaling in runtime of the RSDD algorithm, including an examination of the performance of various partitioning schemes for integration points, was performed by Havu et al [37]. Figure 3a shows a visualization of the partitioning of the set of integration points P into mutually-disjoint "batches" of points B ν ⊂ P . Each batch is a compact, spatially-local set of points on which vectorized operations will be performed and are distributed in a round-robin fashion among processes. At no time does any individual process have knowledge of the full real-space integration grid.

Grid Partitioning

45The partitioning is accomplished by using a "grid adapted cut-plane method" (Algorithm 3 of [37]) in which the full set P is iteratively divided to smaller subsets using cut-planes (red lines in 3a) until some targeted number of points per subset is reached. The resulting subsets are the batches B ν . The targeted number of points per batch will be denoted as the "batch size" throughout this paper. The default batch size in FHI-aims is 100 points per batch for CPU-only calculations and 200 points per batch for (a) (b) Figure 3: A visualization of the batch partitioning scheme used by FHI-aims. Black points denote integration points, and red lines denote boundaries between batches of points. In subfigure (b), the dark blue circle denotes the support of a local basis function, and batches on which the local basis function has non-zero support are highlighted in light blue.

46GPGPU-accelerated calculations. We increase the batch size for GPGPUaccelerated calculations as this will decrease the number of batches, decreasing the amount of CPU-GPU communication and increasing the amount of work accelerated per batch. In our tests, increasing the batch size beyond 200 points does not lead to further overall acceleration.

Parallelization and Dimensionality Reduction

47Having generated a set of mutually disjoint batches {B ν }, we may rewrite Eq. (22) as

48where

49is the contribution of batch B ν to the real-space Hamiltonian matrix element h uc ij . Eqs. (23) and (24) are trivially parallelizable over batches. The RSDD algorithm parcels out batches to MPI tasks, so that each MPI task owns multiple batches, and each batch is owned uniquely by a single MPI task [37].

50The indices in Eqs. (23) and (24) by default run over all basis functions. h uc ij [B ν ] for a given batch B ν will be sparse for medium-to-large-sized systems, as many basis functions are centered too far away to touch the integration points in B ν . While it may be tempting to store h uc ij [B ν ] in a sparse format, the usage of a sparse matrix format will introduce an intermediate non-trivial indexing step when accessing the matrix elements, impeding vectorization due to indirect addressing. More importantly, the sparse representations for matrices h uc ij and h uc ij [B ν ] will scale in size as O(N atom ). Retaining local copies of the full h uc ij [B ν ] on each separate MPI process will eventually become the dominant memory cost of the calculation.

51For each batch, we instead define a reduced-dimensional subspace nnz(B ν ) consisting of basis functions with support on the batch, i.e., basis functions that are nonzero on at least part of the grid points in this batch. h uc ij [B ν ] can be considerably reduced in size by calculating only matrix elements between basis elements ϕ i lying in nnz(B ν ), yielding a dense "batch Hamiltonian matrix" with form identical to Eq. (24). We take h uc ij [B ν ] to refer to this subspace batch Hamiltonian matrix for the rest of this paper. When evaluating the electron density update (Eq. (3)) using the RSDD algorithm, an analogous subspace representation is employed for the density matrix Blue squares indicate matrix elements h uc ij to which the batch may contribute, and white squares denote matrix elements with no contribution from the batch. We show the real-space Hamiltonian matrix as an uncompressed full matrix for simplicity; see Figure 5 for the matrix layouts used in FHI-aims.

52(if required) for the energy-weighted density matrix q ij [B ν ] when calculating Pulay forces (Eq. (14)) and the stress tensor (Eq. (20)).

53Defining the nnz(B ν ) × B ν matrix,

54and the B ν × nnz(B ν ) matrix

55A visualization of the difference between h uc ij and h uc ij [B ν ] is provided in Figure 4. h uc ij is a sparse matrix for large systems and localized basis sets, since only a bounded number of basis functions in some proximity to one another will overlap. h uc ij [B ν ], in contrast, is dense for sufficiently compact set of points, e.g., a sufficiently small batch, since its indices only run over the subset of basis functions that are non-zero anywhere within the compact set of grid points (i.e., these basis functions are already located close to one another). It therefore has a memory consumption of nnz(B ν ) 2 .

56While different batches will have different values for nnz(B ν ) depending on local basis set density and geometry, there exists some upper limit max( nnz(B ν ) ) for the number of basis functions interacting with any batch. max( nnz(B ν ) ) depends on basis set density and local geometry but not on the system size. The independence of the size of each batch from the overall system size is responsible for the observed O(N atom ) execution of integrals, as shown in Havu et al. [37].

57Once h uc ij [B ν ] has been calculated, the local copy of h uc ij on each MPI task (here denoted h uc,task ij ) is updated. There are two matrix formats for the local copy of h uc ij commonly used in FHI-aims: a globally-indexed compressed sparse row (CSR) format and a locally-indexed dense format.Both are further explained in two subsections below. The term "globally indexed" refers to storage of an identical, sparse copy of the final matrix h uc ij across all MPI tasks. In the "globally indexed" case, the size of the stored array thus grows with system size on each MPI task, regardless of the number of MPI ranks employed. In contrast, the term "locally indexed" refers to the storage on each MPI task of separate, dense matrix versions of only those integration contributions to h uc ij that are non-zero on the localized subset of grid points handled by that task. In the "locally indexed" case, the size of the stored array on each task thus remains bounded if the system size increases, as long as the number of MPI ranks is increased along with the system size.

Globally-Indexed Sparse Real-Space Hamiltonian

58Shown in Figure 5a is a visualization of the globally-indexed sparse matrix format, in which each MPI task has a full copy of the real-space matrix along with associated indexing arrays. In FHI-aims, we use the CSR format for the sparse representation. Indexing from h uc ij [B ν ] to h uc ij in the globally-indexed CSR format requires two steps. First, the basis function index in nnz(B ν ) is mapped back to the basis function index in the set of all basis functions, i.e. the row/column indices of the matrix in Figure 4b are mapped back to the row/column indices of the matrix in Figure 4a. Second, the matrix element is mapped back to the sparse matrix representation used to store the real-space Hamiltonian matrix via indexing arrays.

59Each process, after evaluating all batches assigned to it, has a local incomplete copy of the real-space Hamiltonian matrix

60At the end of the RSDD algorithm, an in-place synchronization call sums up all local copies of h uc ij across processes,

61yielding the final values for the real-space Hamiltonian matrix synchronized across all processes. This is the only communication step in the RSDD algorithm.

62The sparse matrix storage used in this matrix format makes it an efficient choice for smaller calculations. However, it has two key disadvantages impeding its usage for large-scale calculations and massively-parallel architectures. The sparse storage of h uc ij nevertheless scales as O(N atom ) on each MPI task and will be a memory bottleneck for large-scale systems, in particular illsuited to reside in the on-board GPGPU memory. Additionally, the usage of non-trivial indexing arrays considerably impedes vectorization, making it ill-suited to the massively-vectorized GPGPU programming paradigm. Figure 5: Visualization of the two main matrix formats used for storing real-space matrices in FHI-aims. Subfigure (a) shows the globally-indexed sparse format, where each MPI task has a full copy of the matrix H in a sparse format (here, CSR) along with two indexing arrays indices and indptr. Subfigure (b) shows the locally-indexed dense format, where each MPI task has a partial section of the matrix in a dense format.

Locally-Indexed Dense Real-Space Hamiltonian

63Shown in Figure 5b is a visualization of the locally-indexed dense matrix format, where h uc ij is distributed across processes. Each MPI task stores its portion of the integrals that contribute to h uc ij locally in a dense formati.e., those partial integrals h uc,task ij (Eq. 28) that are non-zero for this task. In short, only matrix elements involving basis functions with non-zero support on at least one batch on a given process, i.e. with support on the set ∪ Bν on task B ν , are stored. The indexing step from h uc ij [B ν ] to h uc,task ij is amenable to GPGPU resources due to the dense storage of h uc,task ij , amounting to a usage of a simple pre-calculated look-up table.

64After the RSDD algorithm has concluded, the locally-index matrix elements h uc,task ij are distributed across MPI tasks in an overlapping fashion, i.e. a given matrix element h uc ij may have non-zero contributions h uc,task ij on multiple MPI tasks. Implementing Eq. (29) to convert these local matrices into a form h ij (non-periodic systems) or h ij (k) (periodic systems) suitable for the eigensolver (here, BLACS for ELPA) is considerably more tedious than in the globally-indexed case, as book keeping to determine ownership of matrix elements and point-to-point communication between MPI tasks is required. Nevertheless, this synchronization step only occurs once and has negligible effect on the overall timings.

65This dense matrix format consumes more memory than the globallyindexed sparse format for small calculations, as negligible matrix elements will be computed and stored in the local dense matrices. For sufficiently large calculations with sufficiently many MPI tasks, the distributed nature of this format is far more efficient in overall memory usage than the globallyindexed sparse format, and the resulting local dense matrices fit completely into GPGPU onboard memory, minimizing CPU-GPGPU communication.

Density and Density Derivatives, Force and Stress Tensor Components

66In principle, all computational steps of other quantities derived from basis functions on the real-space grid can profit from very similar sparsity considerations as laid out for the Hamiltonian and overlap matrices above. This entails the density and its derivatives, which (cf. Eq. (3)) obey precisely the same locality constraints in each batch of grid points as the Hamiltonian and overlap matrices. The force and stress tensor components are likewise cast in the form of numerical integrals that, within each batch, are touched by only a bounded number of localized basis functions in the limit of large systems.

67The computationally dominant operations for all these terms are, again, dense matrix multiplications. Since they can be carried out on the same set of distributed batches of grid points as the Hamiltonian and overlap matrices, the relevant index ranges (grid points in each batch and non-zero basis functions in each batch) are effectively identical to those in Eq. (27). Quantities are either kept on the distributed grid directly (density and its derivatives, which are local quantities) or (for forces and stress tensor components) the necessary integrals can be carried out by initially assembling matrix elements with basis functions as their indices. The process for the latter matrix elements is essentially identical to the detailed distribution strategy described above for the Hamiltonian matrix. Actual force and stress tensor components in terms of atomic coordinates can then be summed up from these matrix elements once, after the entire integration grid has been completely processed. Figure 6 shows pseudocode for the CPU-only and GPGPU-accelerated implementations of the real-space (a) Hamiltonian matrix integration and (b) electron density update. We refer to these two operations collectively as "the real-space operations" hereafter. The basic structure of the real-space operations consists of a loop over every batch assigned to the process, possibly followed by a final post-processed synchronization across all processes for integrals. No synchronization is necessary for the electron density update, as the real-space points where the electron density is defined are distributed across processes. For each batch assigned to a process, its contribution to the desired quantity is calculated. The processing of each batch can be broken up into three phases: initial processing where the necessary quantities (basis functions on each grid point, their gradients, etc.) are computed, a sequence of serial dense linear algebra operations (e.g., Eq. (27)), and a final indexing step to sort matrix contributions from each batch into their respective storage arrays on each MPI task.

GPGPU Acceleration of the Real-Space Domain Decomposition Algorithm

68Common to the initial processing phase for all real-space operations is the construction of the basis elements ϕ i ∈ nnz(B ν ) for all r ∈ B ν . The initial processing phase for the electron density update additionally includes the reduction of the density matrix of the full system (stored in a sparse representation) to the dense-but-smaller n ij matrix as outlined in the previous section. The real-space Hamiltonian matrix integration requires that the pre-computed integration point weights be re-indexed for the current batch and the quantities {ĥ KS ϕ i (r)} be evaluated on every point in B ν for all basis elements in nnz(B ν ). The construction of {ϕ i (r)}, and {ĥ KS ϕ i (r)} for each point on a batch is executed per point, with relatively small workload compared to the final DGEMMs, but with some thread-divergent branching statements during the construction, i.e. not immediately suitable for GPGPUS. As we will see below, for the integrals, we can overlay this work on the CPU while the GPU works on something else.

69The dense linear algebra phase consists of two subroutine calls for Hamiltonian integration: a matrix multiplication (DSYR2K for the real-space Hamiltonian matrix and DSYMM for the electron density) and a dot product. This step is offloadable to the GPGPU at the cost of communication of the quantities previously calculated during the initial processing phase: the integration weights w(r), basis functions {ϕ i (r)}, and {ĥ KS ϕ i (r)} matrix for the real-space Hamiltonian integration in Eq. (22), and the basis functions ϕ and batch subspace restricted density matrix n ij for the electron density in Eq. (3).

70The final phase for each loop iteration is an indexing phase, where the results from the dense linear algebra phase h uc ij [B ν ] are indexed back into the accumulated matrices h uc ij . The GPGPU acceleration strategy for the realspace Hamiltonian integration diverges based on the choice of indexing for the Hamiltonian matrix h uc ij : (i) The globally-indexed CSR format uses several thread-divergent branching conditionals, complicating GPGPU acceleration of the indexing. The GPGPU-accelerated algorithm thus communicates the results of the dense linear algebra step for each batch back to the CPU, which performs the indexing. In this approach, the CPU is idle while the GPGPU evaluates the dense linear algebra for each batch.

71(ii) Alternatively, when using the locally-indexed dense storage format for h uc ij , indexing is embarrassingly parallelizable, allowing for the usage of custom CUDA kernels to perform the indexing on the GPGPU. After the CPU has communicated {ϕ i (r)} and {ĥ KS ϕ i (r)} to the GPGPU, it is free to begin calculating {ϕ i (r)} and {ĥ KS ϕ i (r)} for the next batch, allowing for effective overlay of computation between the CPU and GPGPU. Communication from the GPGPU back to the CPU occurs only once at the end of the algorithm, when the GPGPU communicates its copy of h uc ij back to the CPU.

72A similar approach to (ii) is employed when calculating the electron density or its derivatives, as the mapping from real-space points r ∈ B ν to the set of all integration points assigned to the present process ∪ Bν on task B ν is trivial. This permits the electron density indexing to be performed via a simple CUDA kernel and stored on the GPGPU locally, similarly avoiding communication from the GPGPU back to the CPU communication for each batch. The electron density stored on the GPGPU is communicated back to the CPU at the end of the algorithm.

Results

73All benchmark calculations were performed with the full-potential, allelectron FHI-aims electronic structure code [30,37] using its productionquality "tight" basis sets and "tight" real-space integration grids and Hartree potential. The PBE functional [101] was used to model exchange-correlation effects. We use a Γ-point-only k-grid in this work, as we focus on real-space operations whose timings are independent of the selected reciprocal-space grid. All timings shown use the locally-indexed dense matrix format (Figure 5b) for the Hamiltonian integration and forces/stress evaluation. The choice of "tight" settings is important since the larger workload associated with denser grids and larger basis sets can dominate the overall effort associated with a particular DFT-based simulation project. By construction, larger workloads of this kind also benefit more from GPGPU acceleration. For progressively lighter settings, smaller but still useful speedups would be expected. The benchmarks below reflect the highest-cost parts of a routine simulation where, it turns out, GPU acceleration will most efficiently take off the edge of a very large workload.

74The time-intensive operations for semi-local DFT in FHI-aims are the real-space Hamiltonian integration (Eq. (10) or (12)), density update (Eq.

75(3)), Hartree potential calculation (Eq. (9)), and the solution of the Kohn-Sham eigenvalue equation (Eq. (13)). Figure 1 shows a schematic for the program flow of a standard KS-DFT calculation with geometry relaxation or molecular dynamics. First, the electronic structure for current geometry is converged by iterative calculation of the Hartree potential (9), Hamiltonian operator (Eq. (1)), Hamiltonian matrix elements (Eq. (10) or 11), and electron density via the Kohn-Sham eigenvalue equation (Eqs. (3) and (13)). We denote a single collective iteration of these operations in which the electronic structure is updated as a "standard" SCF iteration.

76Once self-consistency is reached in the electronic structure, F at and σ λµ may be calculated by Eqs. (14) and (20) respectively. The implementation of Eqs. (14) and (20) in FHI-aims are published in [30,83]; here, it is sufficient to highlight two contributions to F at and σ λµ which contribute appreciably to timings:

77• The Hellmann-Feynman contribution to F at and σ λµ is calculated alongside the Hartree multipole summation, as it relies on the Hartree potential of the system. Thus, the domain decomposition strategy is not used for evaluating this contribution, and GPGPU acceleration is not employed.

78• The Pulay contribution to F at and σ λµ is calculated alongside the density update, as it relies on the density matrix n ij and the energyweighted density matrix q ij . The domain decomposition strategy is used for evaluating this contribution. Its evaluation is GPGPU-accelerated using the strategy outlined in Section 3.4.

79While the calculations of these quantities are computationally expensive, they are ideally evaluated only once per geometry step (outer loop of Figure 1), whereas the SCF iterations will be evaluated multiple times per geometry step (inner loop of Figure 1). In principle, the electronic structure should be further iterated until F at and σ λµ have converged. The production settings for FHI-aims are sufficiently tight that in practice only a single calculation of F at and σ λµ are needed at the end of each self-consistency cycle. The geometry is then updated using F at and σ λµ . Accordingly, we benchmark three different types of SCF iterations in this paper:

80• "SCF": a single iteration of the SCF cycle loop,

81• "SCF + F at ": a single iteration of the SCF cycle loop followed by the computation of forces F at , and

82• "SCF + F at + σ λµ ": a single iteration of the SCF cycle loop followed by the computation of forces F at and stress tensor σ λµ . We emphasize that these timings are per iteration, not per cycle. As outlined in Figure 1, a given system geometry loop will contain multiple iterations of "SCF" but ideally only one iteration of "SCF + F at " or "SCF + F at + σ λµ " per geometry step. We cover a broad range of GPGPU-accelerated architectures by performing benchmarks on four different architectures provided by three different computing clusters: a local cluster ("timewarp") at Duke University, a dedicated testing cluster ("PSG") at NVIDIA Corporation, and the Lassen supercomputer at Lawrence Livermore National Laboratory ("LLNL"). The hardware architectures, which we categorize based on CPU and GPU generations, are IvyBridge/GP100 [timewarp], Haswell/P100 [PSG], Skylake/V100 [PSG], and POWER9/V100 [LLNL]. More information on architectures may be found in Table 1. Full node utilization was employed for all architectures except on IvyBridge/GP100 [timewarp], where 16 MPI tasks were used (out of the 20 physical cores) due to limitations imposed on Pascal GPGPUs by the NVIDIA MPS service, which was used to distribute the computational load to the GPGPU.

83We consider two types of timings for a given operation in this work, the timing t CP U for an operation when employing all available CPU cores on a given node using the Message Passing Interface (MPI), and the timings t GP GP U for an operation when GPGPU acceleration has been employed alongside full CPU node utilization. The GPGPU-accelerated speedup, or simply "speedup", is then defined as

84Using this definition, identical timings for CPU-only and GPGPU-accelerated operations correspond to a speedup of s = 1.0. We note specifically that this is a hard comparison, in that the GPU+CPU timings must be better than a computation using all CPU cores on a given, state-of-the-art node to show a net speedup.

Materials Used

85Two different sets of materials are considered in this work:

86• The first set of materials is a benchmark set comprising 103 different inorganic compounds (bulk solids), proposed in [91] The compounds in this benchmark set span 66 chemical elements in 10 structural prototypes, providing a broad coverage of the structural and chemical diversity found in real-world condensed-matter simulations. 3×3×3 supercells of the primitive cell for each material were used, leading to cell sizes of 27, 54, and 108 atoms. In addition to discussing averaged / aggregated data, we highlight timings for the 54-atom diamond Si supercell calculation as a particular example in the body of this text. The benchmark set is investigated on a single node of three out of the four architectures listed in • The second set of materials consists of a 5×5 supercell of a 2D Bi 2 Se 3 bilayer. A vacuum thickness of 40Å was used. In a standard FHI-aims calculation, the vacuum thickness contributes to timings only through the reciprocal-space contribution of the Ewald summation [102,30] used to evaluate the electrostatic potential to the Hartree potential. Calculations for the Bi 2 Se 3 bilayer were performed on the POWER9/V100

87[LLNL] architecture using 2 to 128 nodes. Table 2 shows a comparison of timings computed on the Skylake/V100 [PSG] architecture for diamond Si. The evaluation of the electron density and its gradients is the dominant contribution to the total time for all SCF iteration types. The relative weight of the density calculation increases for SCF iterations involving F at and σ λµ as the evaluation of the Pulay contribution must also be performed in this step. For an SCF + F at + σ λµ iteration, 95% of the calculation time is spent calculating the density and the Pulay contribution to F at + σ λµ . The timing for Hartree summation weakly increases for SCF cycles involving F at as the Hellmann-Feynman forces must Only t CP U is presented for the Hartree summation and Hellmann-Feynman contributions to F at and σ λµ , as GPGPU acceleration is not employed for these calculations. All timings were taken from a single calculation.

GPGPU Acceleration Across Materials and Architectures

88be calculated, but this is a comparatively small expense relative to the time required to compute the Pulay terms. In contrast, the Hamiltonian integration does not include F at or σ λµ components, leading to consistent timings across iteration types. For all three iteration types, when GPGPU acceleration is enabled, there is a consistent s=6.4 speedup in the Hamiltonian integration on the Skylake/V100 [PSG] architecture. Differences in the GPGPU performance are observed when calculating the density, its gradients,and potentially the Pulay contributions to forces and stress. Speedups of 3.9, 8.4, and 10.4 are observed in the density calculation on the Skylake/V100 [PSG] architecture for the standard SCF, SCF + F at , and SCF + F at + σ λµ iterations, respectively. The differences in speedups arise from the increased workload of dense linear algebra performed when calculating the Pulay contribution to F at and σ λµ . The computationally more demanding iterations with more dense linear algebra exhibit greater GPGPU-accelerated improvements for timings in both relative and absolute terms. Speedups for the total times of an iteration show a similar trend to the density update, with speedups of 3.1, 5.7, and 7.8 observed on the Skylake/V100 [PSG] architecture for the three SCF iteration types. The density update dominates the runtimes for the iterations. While an individual SCF + F at + σ λµ iteration benefits greatly from GPGPU acceleration and takes considerably more time than a standard SCF iteration, it is calculated only when self-consistency is reached and often only needs to be calculated once (Fig. 1). On the other hand, there will be multiple standard SCF iterations, which show a reduced GPGPU speedup. To assess the impact of this difference in speedups on the overall timing of a calculation, Figure 7 shows the timings for complete calculations for diamond Si on IvyBridge/GP100 [timewarp], Haswell/P100 [PSG], and Skylake/V100 [PSG] architectures. Self-consistency is reached after 12 standard SCF iterations and one SCF + F at + σ λµ iteration, leading to speedups between 3.7 and 4.0 for the total time of the calculation.

89We next turn our attention to the 103 material benchmark set. To compare results from different materials, we estimate the expected workload for a given material using a metric

90where |B ν | is the average number of points per batch for a material, nnz(B ν ) is the average number of basis functions with non-zero support per batch for a material, and #B ν is the number of batches for a material. The quantity M M is then a measure of the timing for a hypothetical real-space operation involving a single matrix multiplication, and # ops is a measure of the total time of the real-space operation across all batches. As motivated by Eq. (27), and as we show below, this metric will give an approximate estimate for the expected workload, as it is expected to map particularly the dominant part Figure 7: Overall timings across architectures for the calculation for a 54-atom Si supercell (diamond structure). All calculations contain initialization, 12 SCF iterations, and 1 SCF + F at + σ λµ iteration. Importantly, this also contains all non-GPU accelerated parts of the calculation of the workload associated with dense serial matrix multiplications with high accuracy.

91Shown in Figure 8 are timings for an SCF + F at + σ λµ iteration calculated using Skylake/V100 [PSG]. The proposed metric correlates well to the timings observed for real-space operations in FHI-aims. A strong linear trend for the Hamiltonian integration (Fig. 8a) and density + force + stress evaluation (Fig. 8c) is observed, reflecting the relatively significant workload of dense linear algebra in these operations. The total time for an iteration (Fig. 8a) shows a similar trend, as it is dominated by the density + force + stress evaluation. No such trend is observed in the Hartree multipole summation, which does not rely on dense linear algebra and is also not yet GPU accelerated in the present work.

92Average speedups of 3.7, 9.0, and 6.6 are observed for Hamiltonian integration, density evaluation, and the total time for an SCF + F at + σ λµ iteration for the 103 material benchmark set. These speedups are consistent with the speedups observed for diamond Si. Table 4 shows a comparison across architectures for the speedups calculated for the 103 material benchmark set. These results are analogous to the results in Table 3, indicating that our analysis of trends observed in the diamond Si system extends to other materials and other architectures as well.

Strong Scaling for CPU-Only and GPGPU-Accelerated Calculations

93The calculations in the previous section were performed using a fixed number of MPI tasks on a single node. In the present section, we assess the scaling across nodes using a 375-atom Bi 2 Se 3 bilayer system as a larger example. Strong scaling plots for the POWER9/V100 [LLNL] architecture are shown in Figure 9, with subfigure (a) showing a standard SCF iteration and subfigure (b) showing an SCF + F at + σ λµ iteration. Timings for 80, 160, 320, 640, 1280, 2560, and 5120 MPI tasks are presented, and we reintroduce the timings for the solution of the Kohn-Sham eigenvalue equation. The slab geometry corresponds to a (5×5) supercell, using FHI-aims' "tight" production settings (17,850 basis functions total) and a Γ-point only calculation is performed. The calculations shown correspond to scalar-relativistic self-consistency iterations for this system, i.e., the workload that constitutes the bulk of a typical DFT calculation for such a system. As shown in [91] and others, the energy band structure of such a system is subject to spin-orbit coupling effects that would be essential to include at least at a post-processed second-variational (i.e., perturbative) level for qualitatively correct results. The necessary spin-orbit coupled Hamiltonian matrix integrals follow the exact same algorithms as those of the scalar-relativistic integrations shown in Fig. 9(a) and are therefore not repeated in detail in the plots.

94Timings for the Bi 2 Se 3 bilayer are dominated by the real-space density update and potentially forces and stresses, consistent with the results from the previous section. GPGPU-accelerated speedups of 1.8 -2.1 and 7.8 -9.8 are observed for overall timings in a standard SCF iteration and SCF + F at + σ λµ iterations, respectively. Real-space operations show ideal scaling as a function of the number of MPI tasks, as is expected for the domain decomposition algorithm. The solution of the Kohn-Sham matrix eigenvalue problem using the ELPA library [92,77,79,78] (not GPU-accelerated in Fig. 9) shows reduced scaling due to the still relatively small matrix dimension size, but its diminished weight in these calculations does not meaningfully impact the overall scaling of the calculations. A denser k-space grid (e.g., 2×2×1 or 4×4×1) would increase the eigenvalue solver related workload and could be accelerated, e.g, by the recently published distributed-parallel, GPGPUaccelerated one-stage ELPA solver [79,78] (a computational step that is separate and independent of the real-space operations reported in this work).

Conclusion

95In this paper, we show GPGPU acceleration for real-space operations relevant in semilocal DFT for production-quality materials simulations. We particularly focus on the domain decomposition method used by the fullpotential, all-electron FHI-aims electronic structure code for real-space operations. We show that the time-intensive portions of the domain decomposition method are dense linear algebra operations which are bounded in memory consumption, allowing for efficient offloading to GPGPU resources.

96The performance of the GPGPU acceleration in FHI-aims was assessed using a 103-material benchmark set on three heterogeneous CPU-GPGPU architectures. GPGPU-accelerated speedups ranging from s = 2.4 for SCF iterations to s = 6.6 for SCF iterations including evaluation of forces F at and the stress tensor σ λµ were observed, with an overall estimated speedup of s ≈ 3 − 4 expected for total times for entire calculations.

97Scaling on HPC resources was assessed on LLNL's Lassen calculations involving a 375-atom Bi 2 Se 3 slab supercell. The GPGPU-accelerated implementation shows near-ideal scaling similar to the CPU-only implementation. We find that the evaluation of the density, forces, and stress tensors is the dominant computational workload for the 375-atom bilayer, allowing for overall GPGPU-accelerated speedups of s≈8-10. For significantly larger systems, the well-known cubic bottleneck of the Kohn-Sham DFT equation (the eigenvalue solver, which is not GPGPU-accelerated in this work) would begin to dominate the computational workload. However, a large subset of electronic structure computational needs in the range of small and mid-sized problems (below the range in which the eigenvalue solver dominates, i.e., up to several hundred atoms in this work) becomes accessible to GPGPU acceleration using the localized basis set strategies described above.

Acknowledgements

98This work was supported by the LDRD Program of ORNL managed by UT-Battelle, LLC, for the U.S. DOE and by the Oak Ridge Leadership Computing Facility, which is a DOE Office of Science User Facility supported under Contract DE-AC05-00OR22725. A portion of work was conducted at the Center for Nanophase Materials Sciences, which is a DOE Office of Science User Facility, and supported by the Creative Materials Discovery Program through the National Research Foundation of Korea funded by the Ministry of Science, ICT and Future Planning (NRF-2016M3D1A1919181). We gratefully acknowledge the support of NVIDIA Corporation with the donation of Quadro GP100 and Titan V GPGPUs used for local development, as well as access to their PSG cluster. We thank Dr. Vincenzo Lordi and the Lawrence Livermore National Laboratory (LLNL), a U.S. Department of Energy Facility, for assistance with and access to LLNL's supercomputer Lassen for benchmarks conducted in this work. The work on LLNLs Lassen supercomputer was performed under the auspices of the U.S. Department of Energy at Lawrence Livermore National Laboratory under Contract No. DE-

참고문헌 96건

  1. Density-Functional Theory Elsevier eBooks · Elsevier BV · 2005 10.1016/b0-12-369401-9/00445-9
  2. Parallel Electronic Structure Calculations Using Multiple Graphics Processing Units (GPUs) Lecture notes in computer science · Springer Science+Business Media · 2013 10.1007/978-3-642-36803-5_4
  3. Modern quantum chemistry : introduction to advanced electronic structure theory 1982
  4. <scp>cp2k:</scp> atomistic simulations of condensed matter systems Wiley Interdisciplinary Reviews Computational Molecular Science · Wiley · 2013 10.1002/wcms.1159
  5. NWChem: A comprehensive and scalable open-source solution for large scale molecular simulations Computer Physics Communications · Elsevier BV · 2010 10.1016/j.cpc.2010.04.018
  6. An all-electron numerical method for solving the local density functional for polyatomic molecules The Journal of Chemical Physics · American Institute of Physics · 1990 10.1063/1.458452
  7. Full-potential nonorthogonal local-orbital minimum-basis band-structure scheme Physical review. B, Condensed matter · American Physical Society · 1999 10.1103/physrevb.59.1743
  8. Generalized Gradient Approximation Made Simple Physical Review Letters · American Physical Society · 1996 10.1103/physrevlett.77.3865
  9. phiGEMM: A CPU-GPU Library for Porting Quantum ESPRESSO on Hybrid Systems 2012 10.1109/pdp.2012.72
  10. A multicenter numerical integration scheme for polyatomic molecules The Journal of Chemical Physics · American Institute of Physics · 1988 10.1063/1.454033
  11. Balanced basis sets of split valence, triple zeta valence and quadruple zeta valence quality for H to Rn: Design and assessment of accuracy Physical Chemistry Chemical Physics · Royal Society of Chemistry · 2005 10.1039/b508541a
  12. Speeding up plane-wave electronic-structure calculations using graphics-processing units Computer Physics Communications · Elsevier BV · 2011 10.1016/j.cpc.2011.03.010
  13. Quadratures on a sphere USSR Computational Mathematics and Mathematical Physics · Pergamon Press · 1976 10.1016/0041-5553(76)90100-2
  14. Perspective: Fifty years of density-functional theory in chemical physics The Journal of Chemical Physics · American Institute of Physics · 2014 10.1063/1.4869598
  15. Efficient<b><i>ab initio</i></b>tight binding Physical review. B, Condensed matter · American Physical Society · 1997 10.1103/physrevb.56.6594
  16. Self-consistent numerical-basis-set linear-combination-of-atomic-orbitals model for the study of solids in the local density formalism Physical review. B, Solid state · American Physical Society · 1977 10.1103/physrevb.15.4716
  17. Values of the nodes and weights of ninth to seventeenth order gauss-markov quadrature formulae invariant under the octahedron group with inversion USSR Computational Mathematics and Mathematical Physics · Pergamon Press · 1975 10.1016/0041-5553(75)90133-0
  18. The FFT on a GPU SIGGRAPH/EUROGRAPHICS Conference On Graphics Hardware · 2003 10.5555/844174.844191
  19. Accelerating Correlated Quantum Chemistry Calculations Using Graphical Processing Units and a Mixed Precision Matrix Multiplication Library Journal of Chemical Theory and Computation · American Chemical Society · 2009 10.1021/ct900543q
  20. Advances in molecular quantum chemistry contained in the Q-Chem 4 program package Molecular Physics · Taylor & Francis · 2014 10.1080/00268976.2014.952696
  21. Achieving linear scaling in exchange-correlation density functional quadratures Chemical Physics Letters · Elsevier BV · 1996 10.1016/0009-2614(96)00600-8
  22. Quantum Chemistry on Graphical Processing Units. 2. Direct Self-Consistent-Field Implementation Journal of Chemical Theory and Computation · American Chemical Society · 2009 10.1021/ct800526s
  23. Hybrid functionals for large periodic systems in an all-electron, numeric atom-centered basis framework Computer Physics Communications · Elsevier BV · 2015 10.1016/j.cpc.2015.02.021
  24. Inhomogeneous Electron Gas Physical Review · American Institute of Physics · 1964 10.1103/physrev.136.b864
  25. Gaussian basis sets for use in correlated molecular calculations. VI. Sextuple zeta correlation consistent basis sets for boron through neon Journal of Molecular Structure THEOCHEM · Elsevier BV · 1996 10.1016/s0166-1280(96)80048-0
  26. Porting ONETEP to graphical processing unit‐based coprocessors. 1. FFT box operations Journal of Computational Chemistry · Wiley · 2013 10.1002/jcc.23410
  27. Fast plane wave density functional theory molecular dynamics calculations on multi-GPU machines Journal of Computational Physics · Elsevier BV · 2013 10.1016/j.jcp.2013.05.005
  28. Accelerating Resolution-of-the-Identity Second-Order Møller−Plesset Quantum Chemistry Calculations with Graphical Processing Units The Journal of Physical Chemistry A · American Chemical Society · 2008 10.1021/jp0776762
  29. Self-consistent molecular orbital methods 25. Supplementary functions for Gaussian basis sets The Journal of Chemical Physics · American Institute of Physics · 1984 10.1063/1.447079
  30. High order integration schemes on the unit sphere Journal of Computational Chemistry · Wiley · 1996 10.1002/(sici)1096-987x(19960715)17:9<1152::aid-jcc7>3.0.co;2-r
  31. Atomic Shielding Constants Physical Review · American Institute of Physics · 1930 10.1103/physrev.36.57
  32. Density functional theory calculation on many-cores hybrid central processing unit-graphic processing unit architectures The Journal of Chemical Physics · American Institute of Physics · 2009 10.1063/1.3166140
  33. Thermodynamic Equilibrium Conditions of Graphene Films on SiC Physical Review Letters · American Physical Society · 2013 10.1103/physrevlett.111.065502
  34. Gaussian basis sets for use in correlated molecular calculations. I. The atoms boron through neon and hydrogen The Journal of Chemical Physics · American Institute of Physics · 1989 10.1063/1.456153
  35. Accelerating Density Functional Calculations with Graphics Processing Unit Journal of Chemical Theory and Computation · American Chemical Society · 2008 10.1021/ct8001046
  36. Linear scaling electronic structure methods Reviews of Modern Physics · American Physical Society · 1999 10.1103/revmodphys.71.1085
  37. Linear Scaling Density Functional Calculations with Gaussian Orbitals The Journal of Physical Chemistry A · American Chemical Society · 1999 10.1021/jp990629s
  38. Quantum Chemistry on Graphical Processing Units. 3. Analytical Energy Gradients, Geometry Optimization, and First Principles Molecular Dynamics Journal of Chemical Theory and Computation · American Chemical Society · 2009 10.1021/ct9003004
  39. Graphics Processing Unit acceleration of the Random Phase Approximation in the projector augmented wave method Computer Physics Communications · Elsevier BV · 2013 10.1016/j.cpc.2013.07.014
  40. <i>Ab initio</i>multicenter tight-binding model for molecular-dynamics simulations and other applications in covalent systems Physical review. B, Condensed matter · American Physical Society · 1989 10.1103/physrevb.40.3979
  41. An algorithm for 3D numerical integration that scales linearly with the size of the molecule Chemical Physics Letters · Elsevier BV · 1995 10.1016/0009-2614(95)00665-q
  42. An efficient numerical multicenter basis set for molecular orbital calculations: Application to FeCl4 The Journal of Chemical Physics · American Institute of Physics · 1973 10.1063/1.1680020
  43. Efficient and accurate expansion methods for molecules in local density models The Journal of Chemical Physics · American Institute of Physics · 1982 10.1063/1.443168
  44. Fast Calculation of Electrostatics in Crystals and Large Molecules The Journal of Physical Chemistry · American Chemical Society · 1996 10.1021/jp952713n
  45. All-electron formalism for total energy strain derivatives and stress tensor components for numeric atom-centered orbitals Computer Physics Communications · Elsevier BV · 2015 10.1016/j.cpc.2015.01.003
  46. Real-Space Density Functional Theory on Graphical Processing Units: Computational Approach and Comparison to Gaussian Basis Set Methods Journal of Chemical Theory and Computation · American Chemical Society · 2013 10.1021/ct400520e
  47. Large scale plane wave pseudopotential density functional theory calculations on GPU clusters 2011 10.1145/2063384.2063479
  48. Numeric atom-centered-orbital basis sets with valence-correlation consistency from H to Ar New Journal of Physics · IOP Publishing · 2013 10.1088/1367-2630/15/12/123033
  49. Parallel solution of partial symmetric eigenvalue problems from electronic structure calculations Parallel Computing · Elsevier BV · 2011 10.1016/j.parco.2011.05.002
  50. Optimized Slater‐type basis sets for the elements 1–118 Journal of Computational Chemistry · Wiley · 2003 10.1002/jcc.10255
  51. Fast matrix multiplies using graphics hardware 2001 10.1145/582034.582089
  52. Accelerating VASP electronic structure calculations using graphic processing units Journal of Computational Chemistry · Wiley · 2012 10.1002/jcc.23096
  53. Two‐electron integral evaluation on the graphics processor unit Journal of Computational Chemistry · Wiley · 2007 10.1002/jcc.20779
  54. The SIESTA method for<i>ab initio</i>order-<i>N</i>materials simulation Journal of Physics Condensed Matter · IOP Publishing · 2002 10.1088/0953-8984/14/11/302
  55. Resolution-of-identity approach to Hartree–Fock, hybrid density functionals, RPA, MP2 and<i>GW</i>with numeric atom-centered orbital basis functions New Journal of Physics · IOP Publishing · 2012 10.1088/1367-2630/14/5/053020
  56. VASP on a GPU: Application to exact-exchange calculations of the stability of elemental boron Computer Physics Communications · Elsevier BV · 2012 10.1016/j.cpc.2012.02.017
  57. Accelerating atomic orbital-based electronic structure calculation via pole expansion and selected inversion Journal of Physics Condensed Matter · IOP Publishing · 2013 10.1088/0953-8984/25/29/295501
  58. Ab initio molecular simulations with numeric atom-centered orbitals Computer Physics Communications · Elsevier BV · 2009 10.1016/j.cpc.2009.06.022
  59. The ELPA library: scalable parallel eigenvalue solutions for electronic structure theory and computational science Journal of Physics Condensed Matter · IOP Publishing · 2014 10.1088/0953-8984/26/21/213201
  60. Chemistry with ADF Journal of Computational Chemistry · Wiley · 2001 10.1002/jcc.1056
  61. Towards an order- N DFT method Theoretical Chemistry Accounts · Springer Science+Business Media · 1998 10.1007/s002140050353
  62. The analysis of a plane wave pseudopotential density functional theory code on a GPU machine Computer Physics Communications · Elsevier BV · 2012 10.1016/j.cpc.2012.08.002
  63. Quantum Chemistry on Graphical Processing Units. 1. Strategies for Two-Electron Integral Evaluation Journal of Chemical Theory and Computation · American Chemical Society · 2008 10.1021/ct700268q
  64. Efficient integration for all-electron electronic structure calculation using numeric basis functions Journal of Computational Physics · Elsevier BV · 2009 10.1016/j.jcp.2009.08.008
  65. Time-dependent density-functional theory in massively parallel computer architectures: the octopus project Journal of Physics Condensed Matter · IOP Publishing · 2012 10.1088/0953-8984/24/23/233202
  66. Towards dense linear algebra for hybrid GPU accelerated manycore systems Parallel Computing · Elsevier BV · 2009 10.1016/j.parco.2009.12.005
  67. Dense linear algebra solvers for multicore with GPU accelerators 2010 10.1109/ipdpsw.2010.5470941
  68. Accurate localized resolution of identity approach for linear-scaling hybrid density functionals and for many-body perturbation theory New Journal of Physics · IOP Publishing · 2015 10.1088/1367-2630/17/9/093020
  69. Scaling the RMG quantum mechanics code 2012
  70. Self-Consistent Equations Including Exchange and Correlation Effects Physical Review · American Institute of Physics · 1965 10.1103/physrev.140.a1133
  71. Numerical Computations with GPUs Springer eBooks · Springer Nature · 2014 10.1007/978-3-319-06548-9
  72. <i>GW</i>100: Benchmarking <i>G</i><sub>0</sub><i>W</i><sub>0</sub> for Molecular Systems Journal of Chemical Theory and Computation · American Chemical Society · 2015 10.1021/acs.jctc.5b00453
  73. Wavelet‐Based Density Functional Theory on Massively Parallel Hybrid Architectures 2016 10.1002/9781118670712.ch6
  74. Reproducibility in density functional theory calculations of solids Science · American Association for the Advancement of Science · 2016 10.1126/science.aad3000
  75. Efficient projector expansion for the<i>ab initio</i>LCAO method Physical Review B · American Physical Society · 2005 10.1103/physrevb.72.045121
  76. Application of Graphics Processing Units to Accelerate Real‐Space Density Functional Theory and Time‐Dependent Density Functional Theory Calculations 2016 10.1002/9781118670712.ch10
  77. GPU Acceleration for Density Functional Theory with Slater‐Type Orbitals 2016 10.1002/9781118670712.ch5
  78. Recent developments in the ABINIT software package Computer Physics Communications · Elsevier BV · 2016 10.1016/j.cpc.2016.04.003
  79. Gaussian Basis Set Hartree–Fock, Density Functional Theory, and Beyond on GPUs 2016 10.1002/9781118670712.ch4
  80. GPU implementation of the linear scaling three dimensional fragment method for large scale electronic structure calculations Computer Physics Communications · Elsevier BV · 2016 10.1016/j.cpc.2016.07.003
  81. GPU‐Accelerated Sparse Matrix–Matrix Multiplication for Linear Scaling Density Functional Theory 2016 10.1002/9781118670712.ch8
  82. Plane‐Wave Density Functional Theory 2016 10.1002/9781118670712.ch7
  83. The Elephant in the Room of Density Functional Theory Calculations The Journal of Physical Chemistry Letters · American Chemical Society · 2017 10.1021/acs.jpclett.7b00255
  84. ELSI: A unified software interface for Kohn–Sham electronic structure solvers Computer Physics Communications · Elsevier BV · 2017 10.1016/j.cpc.2017.09.007
  85. Computational predictions of energy materials using density functional theory Nature Reviews Materials · Nature Portfolio · 2016 10.1038/natrevmats.2015.4
  86. A Performance Study of Quantum ESPRESSO’s PWscf Code on Multi-core and GPU Systems Lecture notes in computer science · Springer Science+Business Media · 2017 10.1007/978-3-319-72971-8_4
  87. GPU Optimization of Large-Scale Eigenvalue Solver Lecture notes in computational science and engineering · Springer Nature · 2019 10.1007/978-3-319-96415-7_9
  88. \mathcal{O}(N) methods in electronic structure calculations Reports on Progress in Physics · IOP Publishing · 2012 10.1088/0034-4885/75/3/036503
  89. GPU-acceleration of the ELPA2 distributed eigensolver for dense symmetric and hermitian eigenproblems Computer Physics Communications · Elsevier BV · 2020 10.1016/j.cpc.2020.107808
  90. One-hundred-three compound band-structure benchmark of post-self-consistent spin-orbit coupling treatments in density functional theory Physical Review Materials · American Physical Society · 2017 10.1103/physrevmaterials.1.033803
  91. Perspective on density functional theory The Journal of Chemical Physics · American Institute of Physics · 2012 10.1063/1.4704546
  92. Optimizations of the eigensolvers in the ELPA library Parallel Computing · Elsevier BV · 2019 10.1016/j.parco.2019.04.003
  93. Turbomole Wiley Interdisciplinary Reviews Computational Molecular Science · Wiley · 2013 10.1002/wcms.1162
  94. Accelerating Numerical Dense Linear Algebra Calculations with GPUs Springer eBooks · Springer Nature · 2014 10.1007/978-3-319-06548-9_1
  95. Quantum Chemistry on Graphical Processing Units. 2. Direct Self-Consistent-Field (SCF) Implementation Journal of Chemical Theory and Computation · American Chemical Society · 2009 10.1021/ct900433g
  96. Deleted Work 1955