pastri: a novel data compression algorithm for two ......

3
PaSTRI: A Novel Data Compression Algorithm for Two-Electron Integrals in antum Chemistry Extended Abstract Ali Murat Gok Northwestern University Argonne National Labs IL, USA [email protected] Dingwen Tao University of California Riverside, CA, USA [email protected] Sheng Di Argonne National Labs IL, USA [email protected] Vladimir Mironov Lomonosov Moscow State University Russia Yuri Alexeev Leadership Computing Facility, Argonne National Labs IL, USA Franck Cappello Argonne National Labs IL, USA ABSTRACT Integral computations for two-electron repulsion energies are very frequently used applications in quantum chemistry. Computational complexity, energy consumption and the size of the output data generated by these computations scales with O(N4), where N is the number of atoms simulated in the system. In many applications, the same integrals are required to be calculated multiple times. Storing these values and reusing them requires impractical amounts of storage space; whereas recalculating them requires a lot of com- putations. On the other hand, generated data typically requires much less precision than the built-in floating point data types. We propose PaSTRI (Pattern Scaling for Two-electron Repulsion Inte- grals), a fast novel compression algorithm which makes it possible to calculate these integrals only once, store them, and reuse them at much smaller computational cost then recalculation. PaSTRI is lossy compared to floating point numbers, but still maintains the precision level required by the integral computations. PaSTRI is an extension to SZ[1] compressor package as a part of ECP-EZ. We have evaluated our compressor using GAMESS[4] dataset, and achieved 17.5:1 compression ratio whereas compression ratios for original SZ was 8.0:1 and ZFP[3] was 7.1:1. KEYWORDS Floating point lossy compression, integer compression, two-electron repulsion energy Acknowledgments This research was supported by the Exascale Computing Project (17-SC-20-SC), a collaborative effort of the U.S. Department of Energy Office of Science and the National Nuclear Security Administration. This work was supported by the U.S. Department of Energy, Office of Science, Advanced Scientific Computing Research Program, under Contract DE-AC02-06CH11357. Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for third-party components of this work must be honored. For all other uses, contact the owner/author(s). SC’17, November 2017, Denver, CO, USA © 2017 Copyright held by the owner/author(s). ACM ISBN 123-4567-24-567/08/06. https://doi.org/10.475/123_4 1 EXASCALE COMPUTING PROJECT FOR DATA COMPRESSION (ECP-EZ) The ECP EZ project aims at significantly improving the compression factors and the usability of SZ. Our goal is to produce a production- quality lossy compressor responding to the needs of exascale appli- cation users. PaSTRI is a part of ECP-EZ project, implemented as one of the compression algorithms in the SZ compressor. 2 INTRODUCTION All properties of the quantum mechanical system are determined by the wave functions which are obtained by solving the Schrodinger Equation. These wave functions define the molecular orbitals, and they can be represented as finite sets of Linear Combination of Atomic Orbitals (LCAO approximation). Solving the Schrodinger Equation requires constructing and solving Fock matrix, where the most time-consuming step is computation of two-electron repul- sion integrals. Number of integrals scale with N 4 , where N is the number of atomic orbitals(basis functions). Typically, the integrals cannot fit into memory and iterative solution of Schrodinger equa- tion requires these integrals to be recalculated for every iteration, which is typically 20-30 times. A much better strategy is to compute electron repulsion integrals (ERIs) once, compress and store them in memory, and read ERIs from memory every time we need them. Consequently, we can potentially speed up calculations by 20-30 times. 3 TWO-ELECTRON INTEGRALS Two-electron repulsion integral calculation involve two couples of atoms, where each couple is sharing one electron. Each one of the four atoms are represented by an index, leading each output data point to include four 16-bit integers as indexes, and a 64-bit double precision floating point number for the resulting integral value. Although electrons are shared by two atoms, they are represented by a single Gaussian function during calculations. This results in periodic behavior in the output data, where the periodicity is defined by the shell types in atom couples. There are different block types ((sp|df), (df|pd), (dd|ff), (ff|ff), etc.) which are represented by orbital shell types of each atom.

Upload: others

Post on 28-May-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PaSTRI: A Novel Data Compression Algorithm for Two ... Archive/tech_poster/poster_files/post234s2-file3.pdf∗Acknowledgments This research was supported by the Exascale Computing

PaSTRI: A Novel Data Compression Algorithm for Two-ElectronIntegrals inQuantum Chemistry∗

Extended Abstract

Ali Murat GokNorthwestern UniversityArgonne National Labs

IL, [email protected]

Dingwen TaoUniversity of CaliforniaRiverside, CA, USA

[email protected]

Sheng DiArgonne National Labs

IL, [email protected]

Vladimir MironovLomonosov Moscow State University

Russia

Yuri AlexeevLeadership Computing Facility,

Argonne National LabsIL, USA

Franck CappelloArgonne National Labs

IL, USA

ABSTRACTIntegral computations for two-electron repulsion energies are veryfrequently used applications in quantum chemistry. Computationalcomplexity, energy consumption and the size of the output datagenerated by these computations scales with O(N4), where N is thenumber of atoms simulated in the system. In many applications, thesame integrals are required to be calculated multiple times. Storingthese values and reusing them requires impractical amounts ofstorage space; whereas recalculating them requires a lot of com-putations. On the other hand, generated data typically requiresmuch less precision than the built-in floating point data types. Wepropose PaSTRI (Pattern Scaling for Two-electron Repulsion Inte-grals), a fast novel compression algorithm which makes it possibleto calculate these integrals only once, store them, and reuse themat much smaller computational cost then recalculation. PaSTRI islossy compared to floating point numbers, but still maintains theprecision level required by the integral computations. PaSTRI isan extension to SZ[1] compressor package as a part of ECP-EZ.We have evaluated our compressor using GAMESS[4] dataset, andachieved 17.5:1 compression ratio whereas compression ratios fororiginal SZ was 8.0:1 and ZFP[3] was 7.1:1.

KEYWORDSFloating point lossy compression, integer compression, two-electronrepulsion energy

∗Acknowledgments This research was supported by the Exascale Computing Project(17-SC-20-SC), a collaborative effort of the U.S. Department of Energy Office of Scienceand the National Nuclear Security Administration. This work was supported by theU.S. Department of Energy, Office of Science, Advanced Scientific Computing ResearchProgram, under Contract DE-AC02-06CH11357.

Permission to make digital or hard copies of part or all of this work for personal orclassroom use is granted without fee provided that copies are not made or distributedfor profit or commercial advantage and that copies bear this notice and the full citationon the first page. Copyrights for third-party components of this work must be honored.For all other uses, contact the owner/author(s).SC’17, November 2017, Denver, CO, USA© 2017 Copyright held by the owner/author(s).ACM ISBN 123-4567-24-567/08/06.https://doi.org/10.475/123_4

1 EXASCALE COMPUTING PROJECT FORDATA COMPRESSION (ECP-EZ)

The ECP EZ project aims at significantly improving the compressionfactors and the usability of SZ. Our goal is to produce a production-quality lossy compressor responding to the needs of exascale appli-cation users. PaSTRI is a part of ECP-EZ project, implemented asone of the compression algorithms in the SZ compressor.

2 INTRODUCTIONAll properties of the quantummechanical system are determined bythe wave functions which are obtained by solving the SchrodingerEquation. These wave functions define the molecular orbitals, andthey can be represented as finite sets of Linear Combination ofAtomic Orbitals (LCAO approximation). Solving the SchrodingerEquation requires constructing and solving Fock matrix, where themost time-consuming step is computation of two-electron repul-sion integrals. Number of integrals scale with N4, where N is thenumber of atomic orbitals(basis functions). Typically, the integralscannot fit into memory and iterative solution of Schrodinger equa-tion requires these integrals to be recalculated for every iteration,which is typically 20-30 times. A much better strategy is to computeelectron repulsion integrals (ERIs) once, compress and store themin memory, and read ERIs from memory every time we need them.Consequently, we can potentially speed up calculations by 20-30times.

3 TWO-ELECTRON INTEGRALSTwo-electron repulsion integral calculation involve two couples ofatoms, where each couple is sharing one electron. Each one of thefour atoms are represented by an index, leading each output datapoint to include four 16-bit integers as indexes, and a 64-bit doubleprecision floating point number for the resulting integral value.Although electrons are shared by two atoms, they are representedby a single Gaussian function during calculations. This resultsin periodic behavior in the output data, where the periodicity isdefined by the shell types in atom couples. There are different blocktypes ((sp|df), (df|pd), (dd|ff), (ff|ff), etc.) which are represented byorbital shell types of each atom.

Page 2: PaSTRI: A Novel Data Compression Algorithm for Two ... Archive/tech_poster/poster_files/post234s2-file3.pdf∗Acknowledgments This research was supported by the Exascale Computing

SC’17, November 2017, Denver, CO, USA A. M. Gok et al.

Sub-Blocks

-25

-15

-5

5

15

25

-25

-15

-5

5

15

25

Lexicographical Order(According to the 4 indexes)

Inte

gral

Val

ues

Pattern Scaled Patterns and the Original DataOriginal Data

(a) (b) (c)

Figure 1: Original data has a pattern that repeats itself atdifferent scales, with small deviations

FR (Ratio of Firsts)

ER(Ratio of Extremums)

AR (Ratio of Averages)

|Sub-Block|

AAR(Ratio of Abs. Averages)

IS(Interval Scaling)

Requires Sign Correction

a b a aa

ab

b

bb

|Pattern| Sub-Block PatternSub-Block PatternSub-Block Pattern Sub-Block Pattern

Figure 2: Different scale calculation methods. Scale is calcu-lated as a/b (Sign correction may also be applied)

It should also be noted that integral values typically require lessprecision than the double precision floats, leading the original datato be unnecessarily large. Maximum tolerable error is called ErrorBound(EB), which is 10-10 by default in GAMESS. PaSTRI alwayssatisfy the specified error bound in our decompressed values.

4 ALGORITHMIn order to observe the periodicity, we have a non-sparse represen-tation of the integral values in a single block (Fig1a). All possibleindex combinations are included in the lexicographical order, and ifthe original block has sparse representation the skipped values cansimply be replaced by zeros. In this representation, we observe aperiodic behavior within each block. Although there are some rela-tively small deviations, the general behavior is observed as there isa Pattern(P)(Fig1b) that repeats itself in different scales. We nameeach one of these repetitions as a Sub-Block(SB) (Fig1c). SB lengthis fixed, and determined by the multiplication of the number of thelast 2 orbital's shells. We choose one of these sub-blocks to be thepattern.

For each SB, one scale value is calculated. We evaluated severalmethods to calculate the scales (Fig2), Where Sign Correction is 1or -1. AAR and IS methods require Sign Correction because theycan only produce positive values without it, whereas the scalevalues can be positive or negative. Reliable sign correction methodsincrease computational costs.

A data point whose values is not within EB distance to the scaledpattern is called an Outlier.We only store the difference between thevalue of each outlier point and the scaled pattern, and name it ErrorCorrection(EC). This difference is typically much smaller than theoutlier values, consequently contributing to a higher compressionratio. EC representation also employs quantization, always usingbin size of 2*EB, which guarantees all decompressed values to bewithin EB distance to the original data values. Outliers are encoded

12131415161718192021

ER AR AAR IS ER AR AAR IS ER AR AAR IS

EB= 1E-9 EB = 1E-10 EB = 1E-11

Co

mp

ress

ion

Rat

io

Scale Calculation Method and Error Bound

Comparison of Scale Calculation Methods

Figure 3: Compression ratios for different scale calculationmethods

(a)

0

4

8

12

16

20

24

1E-9 1E-10 1E-11

Co

mp

ress

ion

Rat

io

Error Bound

PaSTRI

SZ+GZIP

ZFP+GZIP

0

1

2

3

4

5

1E-9 1E-10 1E-11

Avg

. Co

mp

ress

ion

Tim

e

Error Bound

0

1

2

3

4

5

1E-9 1E-10 1E-11

Avg

. Dec

om

pre

ssio

n T

ime

Error Bound

(b) (c)

Figure 4: PaSTRI in comparison with other compressors

by using a variable length encoding where the values 0, 1 and -1 areencoded by using fewer bits than other values since they constitutethe vast majority of cases.

During encoding phase, firstly the quantized pattern and scalevalues are written to the output file. Then our algorithm chooses theoutput format with the smallest size of the following: UncompressedSparse, Compressed Non-Sparse, Compressed Sparse.

5 EVALUATIONDue to their computational complexity and output data size, wehave focused on d and f orbitals during our evaluations. We presentcompression ratios for (dd|dd), (dd|ff), (ff|dd), (ff|ff) configurationsusing different scale calculationmethods in Fig3.We choose ER(Ratiosof Extremums) in the implementation of PaSTRI because it hasslightly better compression ratios, and also requiring the smallestamount of computations. We then compare PaSTRI with vanilla SZand ZFP compressors in Fig4, where integer indexes are compressedusing GZIP[2] in the latter two.

PaSTRI achieves 2.5x better compression ratio while maintainingthe lowest execution time.

6 CONCLUSIONWe propose PaSTRI, a fast, novel compression algorithm for two-electron repulsion integrals which is a frequent application in quan-tum chemistry. Our algorithm consist of determining the pattern,calculating the scales, calculating error corrections and then encod-ing the whole block. All the steps have O(N) complexity, where N isthe points per block. PaSTRI achieves 2.5 times better compressionratios at lower computational costs. We have evaluated our resultson GAMESS dataset, but also expect to have similar results for otherERI applications because the way integrals are calculated would besimilar.

Page 3: PaSTRI: A Novel Data Compression Algorithm for Two ... Archive/tech_poster/poster_files/post234s2-file3.pdf∗Acknowledgments This research was supported by the Exascale Computing

PaSTRI: A Novel Data Compression Algorithm for Two-Electron Integrals inQuantum ChemistrySC’17, November 2017, Denver, CO, USA

REFERENCES[1] Z. Chen D. Tao, S. Di and F. Cappello. 2017. Significantly Improving Lossy

Compression for Scientific Data Sets Based on Multidimensional Prediction andError-Controlled Quantization. In IEEE International Parallel and DistributedProcessing Symposium (IPDPS). 1129–1139.

[2] Marc Adler Jean-loup Gailly. [n. d.]. Gzip compression. ([n. d.]). http://www.gzip.org

[3] P. Lindstromo. 2014. Fixed-Rate Compressed Floating-Point Arrays. In IEEETransactions on Visualization and Computer Graphics. 2674–2683.

[4] J. A. Boatz M. W. Schmidt, K. K. Baldridge et al. 1993. General atomic andmolecular electronic structure system. In J. Comput. Chem, Vol. 14. 1347–1363.