more system independent usage of ... - r-ccs.riken.jp · pic [on] true, false build position...

25
More system independent usage of numerical verification algorithms written in high-level programming languages OHLHUS, Kai Torben Graduate School of Science Tokyo Woman’s Christian University Workshop on Large-scale Parallel Numerical Computing Technology (LSPANC) RIKEN Center for Computational Science (R-CCS), Kobe, Japan January 29 – 30, 2020 Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 1 / 22

Upload: others

Post on 19-Mar-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

More system independent usage of numerical verification algorithmswritten in high-level programming languages

OHLHUS, Kai Torben

Graduate School of ScienceTokyo Woman’s Christian University

Workshop on Large-scale Parallel Numerical Computing Technology (LSPANC)RIKEN Center for Computational Science (R-CCS), Kobe, Japan

January 29 – 30, 2020

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 1 / 22

1 Introduction and system dependency problem

2 Solution 1: Spack

3 Solution 2: Singularity

4 Summary and future work

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 2 / 22

Introduction

Verification methods / algorithms:I "Mathematical theorems are formulated whose assumptions are verified with the aid of a

computer." (Rump [7])

High-level programming language:I Providing abstractions (e.g. no data types, memory management)

I Less error prone, more expressive, faster development of algorithms.

I Compiled or interpreted.

I Not necessarily limited or slow. Depending on the purpose / computation.

I But: Code / tools / libraries providing the abstraction become dependencies.

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 3 / 22

IntroductionIn my PhD thesis and before [6, 1] we computed rigorous error bounds for conic linearprograms with up to 19 million variables and 27 thousand constraints.

The following simplified software stack (mostly high-level, interpreted code) was used1:Define a conic problemP = (A, b, c,K) in eitherprimal (P ) or dual (D)standard form.

min 〈c, x〉(P ) s.t. Ax = b,

x ∈ K ⊂ Rn.

max 〈b, y〉(D) s.t. z := c−A∗y,

z ∈ K∗ ⊂ Rn,

y ∈ Rm.

Compute an approximate solution(x, y, z) of P using a conic solver of yourchoice.

Compute rigorous bounds for the unknownoptimal solution (x∗, y∗):

〈c, x∗〉 ≥ rigorous lower bound (P, y)

〈b, y∗〉 ≤ rigorous upper bound (P, x)

Optional a priori known upper bounds (x, y) on

the optimal solution speed up the computation.

VSDPINTLAB CSDP / MOSEK / SDPA / SeDuMi / SDPT3, ...

Matlab / GNU Octave"Linux"

For larger problem instances the current "Linux" system was insufficient.→ Move to another "Linux" system, but...

1https://vsdp.github.io/Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 4 / 22

There is not just "Linux"...

First release Distribution Kernel GCC2 Scilab Octave ...5.5 9.2 6.0.2 5.1

2019 RHEL/CentOS 8.1 4.18 8.3 - -2018 SLES 15.1 4.12 7.2 - -2018 Ubuntu 18.04.3 4.15 7.3 6.0.1 4.22016 Ubuntu 16.04.6 4.4 5.4 5.5 4.02014 SLES 12.4 4.12 4.8 - -2014 RHEL/CentOS 7.7 3.10 4.8 - 3.82010 RHEL/CentOS 6.10 2.6 4.43 - 3.4

2MATLAB R©requires GCC 6.3https://www.mathworks.com/support/requirements/supported-compilers.html

3No C11/C++11 support https://gcc.gnu.org/projects/cxx-status.htmlKai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 5 / 22

What to expect from "Linux-clusters" today?Many free and open source high-level programming languages and libraries (e.g. Scilab,Octave, OpenBLAS, ...) are not suitable/not good performing:

I outdated versions or missingF system dependent approaches (packages)

(RedHat: devtoolsets, EPEL, ...; Ubuntu Backports)F system independent approaches

(Anaconda [Python], flatpak, snap, ...)I configured for general purpose systems

F linked against reference implementations

Mostly proprietary pendants (e.g. MATLAB R©, CUDA R©, Intel R©MKL, ...) are available inmore recent versions on these "old" systems.

Compiling missing software from source?I Dependencies often outdated too. In case of Octave: OpenBLAS, SuiteSparse, Arpack, ...I Space quotas, installation permissions, ...

Reproducibility of previous results?Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 6 / 22

Sometimes things are even worse...Kashiwagi described a problem4 for Linux + OpenBLAS (multiple threads) + Octave andswitching of the directed rounding mode. It occurs in the following short example:

N = 5000 ;A = rand (N) ; % c r e a t e random 5000 x5000 mat r i xB = rand (N) ; % element s i n (0 , 1 )s e t r ound (−1); % round ing downwards modeC1 = A ∗ B; % lowe r bound f o r A∗Bs e t r ound (+1); % round ing upwards modeC2 = A ∗ B; % upper bound f o r A∗Bmin (min (C2 − C1 ) ) % shou ld not be z e r o !

The default OpenBLAS package of most Linux distributions is compiled usingCONSISTENT_FPCSR=0, which means that the floating-point control and statusregister is not synchronized within multiple threads.The software stack relies on a version and a configuration.

4http://verifiedby.me/adiary/060Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 7 / 22

How to ensure complicated software stacks?

VSDP@2018

INTLAB@[email protected] / [email protected] /[email protected] / [email protected] /

[email protected], ...GNU [email protected]

linked against [email protected] with CONSISTENT_FPCSR=1

...

Similar problem investigated by Shudler et al. [8] forSENSEI, presented on SC’19 in Denver.

Image: https://commons.wikimedia.org/wiki/File:Rock_balancing_(Counter_Balance).jpg

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 8 / 22

1 Introduction and system dependency problem

2 Solution 1: Spack

3 Solution 2: Singularity

4 Summary and future work

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 9 / 22

Supercomputing package manager6 (1/5)Very actively developed since 2013 (started by members of the Lawrence LivermoreNational Laboratory).

Contains currently 3838 packages (812 Python, 782 R).

Addresses several problems with current Linux software distribution models:I Packages and (some!) dependencies are build from source. ( 6= ArchLinux).

I Define target architecture, compiler (incl. icc), version, configuration (variants), ...→ Reproducibility!

I Packages peacefully coexist on the same machine.→ Maintenance!

Will be the default package manager for Fugaku5.5https://postk-web.r-ccs.riken.jp/oss/public/6https://spack.io and [2].

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 10 / 22

Spack (2/5)$ spack info openblasSafe versions :

0.3.7 h t t p s : // g i t hub . com/ x i a n y i /OpenBLAS/ a r c h i v e /v0 . 3 . 7 . t a r . gz. . .Variants:

Name [ De f au l t ] A l lowed v a l u e s D e s c r i p t i o n============== ==================== ==============================

ilp64 [ o f f ] True , F a l s e Force 64− b i t Fo r t r an n a t i v ei n t e g e r s

p i c [ on ] True , F a l s e Bu i l d p o s i t i o n i ndependen tcode

sha r ed [ on ] True , F a l s e Bu i l d sha r ed l i b r a r i e sthreads [ none ] p th reads , openmp , Mu l t i t h r e a d i n g suppo r t

none

$ spack install [email protected] ˆ[email protected]+ilp64 threads=openmpCONSISTENT_FPCSR=1

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 11 / 22

Spack (3/5)Spack grammar in extended Backus-Naur form [2]:

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 12 / 22

Spack (4/5)Example Spack package definition written in Python [2]:

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 13 / 22

Spack (5/5) summarySpack allows to obtain more customized packages than classical Linux package managers.It addresses the resulting combinatorial configuration space by building only requestedcombinations.Build receipts are maintained and tested by several HPC facilities.

OpenBLAS

[email protected]

[email protected]

[email protected]

[email protected]

threads=none

[email protected]

threads=pthreads

[email protected]

threads=openmp

...

...

...

...

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 14 / 22

1 Introduction and system dependency problem

2 Solution 1: Spack

3 Solution 2: Singularity

4 Summary and future work

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 15 / 22

Singularity [4] - Container for HPC?

Initial version created by Gregory M. Kurtzer about 2015 at the Berkeley National Lab.

Still free software developed by Sylabs Inc.

Lightweight container solution:I Container overhead negligible [3, 5, 9, 8].

I Singularity images are a single self-contained file. Distribution by copy&paste, noDockerHub, ...

I Native MPI, Ininiband, and GPU support.

I No root daemon for the execution of Singularity images necessary. Runs with the privileges ofthe user. → Security.

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 16 / 22

Singularity definition files (1/3)

Boot s t r ap : docke rFrom : c en to s

%pos t

# I n s t a l l some deve lopment t o o l s to b u i l d our codeyum i n s t a l l −y \

cmake \env i ronment−modules \gcc−g f o r t r a n \gnup lo t \python3 \t e x i n f o \wget

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 17 / 22

Singularity definition files (2/3)%pos t

. . .

# Setup Spackcd /wget h t t p s : // g i t hub . com/ spack / spack / a r c h i v e / deve l op . t a r . gzt a r −x f d ev e l op . t a r . gzmv spack−deve l op spacksou r c e / spack / sha r e / spack / setup−env . sh

spack i n s t a l l octave@5 . 1 . 0 \^ openb las@0 .3 .7+ i l p 6 4 t h r e ad s=openmp \

CONSISTENT_FPCSR=1

# Tidy up , s h r i n k c o n t a i n e r s i z e ~710 MB −−> ~590 MB

rm −Rf / deve l op . t a r . gz / spack / va r / spack / cache /yum c l e a n a l l

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 18 / 22

Singularity definition files (3/3)

%r u n s c r i p t

# Commands to be executed , when c o n t a i n e r s t a r t sspack l oad oc taveoc tave

%env i ronment

e xpo r t LC_ALL=en_US .UTF−8sou r c e / u s r / sha r e /Modules / i n i t / shsou r c e / spack / sha r e / spack / setup−env . sh

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 19 / 22

Build and run Singularity Image Files (SIF)

Build SIF with root privilegessudo singularity build octave.sif octave.def

I Reduce image size, avoid unnecessary tools.

I Reduce build time, trade-off install via Spack or guest Linux package manager.yum in this case.

Run with user privilegessingularity run octave.sif

I Access to user’s /home directory.

I Other host system directories by default not accessible, but "--bind" possible.

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 20 / 22

SummaryI High-level programming languages provide useful abstractions for faster and less error prone

development of verification methods.

I To provide these abstractions sometimes nontrivial software stacks are required.

I Spack can be used to uniquely specify and build these software stacks more independent ofthe underlying Linux distribution.

I Singularity containers further increase independence of the underlying system withoutsacrificing security, InfiniBand, MPI, or CUDA support.

Future workI Improve Spack receipts to support all required variations for VSDP.

I More performance tests with Singularity containers and large scale linear conic programs.

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 21 / 22

Thank you for your attention!

Questions?

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 22 / 22

D. Chaykin et al. “Rigorous results in electronic structure calculations”. In: (2016). url:http://www.optimization-online.org/DB_HTML/2016/11/5730.html.Todd Gamblin et al. “The Spack Package Manager: Bringing Order to HPC SoftwareChaos”. In: Proceedings of the International Conference for High PerformanceComputing, Networking, Storage and Analysis. SC ’15. Austin, Texas: Association forComputing Machinery, Nov. 15, 2015, pp. 1–12. doi: 10.1145/2807591.2807623.Stephen Herbein et al. “Resource Management for Running HPC Applications inContainer Clouds”. In: High Performance Computing. Ed. by Julian M. Kunkel,Pavan Balaji, and Jack Dongarra. Lecture Notes in Computer Science. Cham: SpringerInternational Publishing, 2016, pp. 261–278. isbn: 978-3-319-41321-1. doi:10.1007/978-3-319-41321-1_14.Gregory M. Kurtzer, Vanessa Sochat, and Michael W. Bauer. “Singularity: ScientificContainers for Mobility of Compute”. In: PLOS ONE 12.5 (May 11, 2017), e0177459.issn: 1932-6203. doi: 10.1371/journal.pone.0177459.

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 23 / 22

Emily Le and David Paz. “Performance Analysis of Applications Using SingularityContainer on SDSC Comet”. In: Proceedings of the Practice and Experience in AdvancedResearch Computing 2017 on Sustainability, Success and Impact. PEARC17. NewOrleans, LA, USA: Association for Computing Machinery, July 9, 2017, pp. 1–4. isbn:978-1-4503-5272-7. doi: 10.1145/3093338.3106737. url:https://doi.org/10.1145/3093338.3106737.Kai Torben Ohlhus. “Rigorose Fehlerschranken für das Elektronenstrukturproblem”.Thesis. Technische Universität Hamburg, 2019. doi: 10.15480/882.2227.Siegfried M. Rump. “Verification methods: Rigorous results using floating-pointarithmetic”. In: Acta Numerica 19 (May 2010), pp. 287–449. issn: 1474-0508,0962-4929. doi: 10.1017/S096249291000005X.Sergei Shudler et al. “Spack Meets Singularity: Creating Movable In-Situ Analysis Stackswith Ease”. In: Proceedings of the Workshop on In Situ Infrastructures for EnablingExtreme-Scale Analysis and Visualization. ISAV ’19. Denver, Colorado: ACM, 2019,pp. 34–38. isbn: 978-1-4503-7723-2. doi: 10.1145/3364228.3364682. url:http://doi.acm.org/10.1145/3364228.3364682.

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 24 / 22

Andrew J. Younge et al. “A Tale of Two Systems: Using Containers to Deploy HPCApplications on Supercomputers and Clouds”. In: 2017 IEEE International Conference onCloud Computing Technology and Science (CloudCom). Dec. 2017, pp. 74–81. doi:10.1109/CloudCom.2017.40.

Kai T. Ohlhus (TWCU) Numerical verification in high-level languages January 30, 2020 25 / 22