application performance optimizations (part 2) · 2020-01-14 · 3 hpc advisory council hpc center...

33
Application Performance Optimizations (Part 2) Pak Lui

Upload: others

Post on 28-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

Application Performance Optimizations

(Part 2)

Pak Lui

Page 2: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

2

• MILC

• OpenMX

• PARATEC

• PFA

• PFLOTRAN

• Quantum ESPRESSO

• RADIOSS

• SPECFEM3D

• WRF

• LS-DYNA

• miniFE

• MILC

• MSC Nastran

• MR Bayes

• MM5

• MPQC

• NAMD

• Nekbone

• NEMO

• NWChem

• Octopus

• OpenAtom

• OpenFOAM

130 Applications Best Practices Published

• Abaqus

• AcuSolve

• Amber

• AMG

• AMR

• ABySS

• ANSYS CFX

• ANSYS FLUENT

• ANSYS Mechanics

• BQCD

• CCSM

• CESM

• COSMO

• CP2K

• CPMD

• Dacapo

• Desmond

• DL-POLY

• Eclipse

• FLOW-3D

• GADGET-2

• GROMACS

• Himeno

• HOOMD-blue

• HYCOM

• ICON

• Lattice QCD

• LAMMPS

For more information, visit: http://www.hpcadvisorycouncil.com/best_practices.php

Page 3: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

3

HPC Advisory Council HPC Center

Dell™ PowerEdge™

R730 32-node cluster

HP Cluster Platform

3000SL 16-node cluster

HP ProLiant SL230s

Gen8 4-node cluster

Dell™ PowerEdge™

R815 11-node cluster Dell™ PowerEdge™

C6145 6-node cluster

Dell™

PowerEdge™

M610

38-node cluster

Dell™

PowerEdge™

C6100

4-node cluster

Dell™ PowerVault

MD3420 / MD3460

InfiniBand-based

Lustre Storage

Dell™ PowerEdge™

R720/R720xd 32-node cluster

HP Proliant XL230a

Gen9 10-node cluster

Colfax

CX1350s-XK5

4-node cluster

Page 4: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

4

Agenda

• Overview of HPC Applications Performance

• Way to Inspect, Profile, Optimize HPC Applications

– CPU, memory, file I/O, network

• System Configurations and Tuning

• Case Studies, Performance Comparisons, Optimizations and Highlights

• Conclusions

Page 5: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

5

HPC Application Performance Overview

• To achieve scalability performance on HPC applications

– Involves understanding of the workload by performing profile analysis

• Tune for the most time spent (either CPU, Network, IO, etc)

– Underlying implicit requirement: Each node to perform similarly

• Run CPU/memory/network tests or cluster checker to identify bad

node(s)

– Comparing behaviors of using different HW components

• Which pinpoint bottlenecks in different areas of the HPC cluster

• A selection of HPC applications will be shown

– To demonstrate method of profiling and analysis

– To determine the bottleneck in SW/HW

– To determine the effectiveness of tuning to improve on performance

Page 6: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

6

Ways To Inspect and Profile Applications

• Computation (CPU/Accelerators)

– Tools: top, htop, perf top, pstack, Visual Profiler, etc

– Tests and Benchmarks: HPL, STREAM

• File I/O

– Bandwidth and Block Size: iostat, collectl, darshan, etc

– Characterization Tools and Benchmarks: iozone, ior, etc

• Network Interconnect and MPI communications

– Tools and Profilers: perfquery, MPI profilers (IPM, TAU, etc)

– Characterization Tools and Benchmarks:

– Latency and Bandwidth: OSU benchmarks, IMB

Page 7: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

7

Case Study:

ESI Virtual Performance Solution

(VPS)

Page 8: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

8

Note

• The following research was performed under the HPC Advisory Council activities

– Participating vendors: ESI Group, Intel, Dell, Mellanox

– Compute resource - HPC Advisory Council Cluster Center

• The following was done to provide best practices

– VPS performance overview

– Understanding VPS communication patterns

– Ways to increase VPS productivity

– MPI libraries comparisons

• For more info please refer to

– http://virtualperformance.esi-group.com/

– http://www.dell.com

– http://www.intel.com

– http://www.mellanox.com

Page 9: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

9

VPS

• Virtual Performance Solution (VPS)

– Originated from PAM-CRASH

– Software package from ESI Group

– Used for crash simulation

– Design of occupant safety systems

– Primarily used in the automotive industry

– Simulate the performance of a proposed vehicle design

– Evaluate the potential for injury to occupants in multiple crash scenarios

Page 10: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

10

Objectives

• The presented research was done to provide best practices

– VPS performance benchmarking

– Interconnect performance comparisons

– Ways to increase VPS productivity

– Power-efficient simulations

• The presented results will demonstrate

– The scalability of the compute environment

– The scalability of the compute environment/application

– Considerations for higher productivity and efficiency

Page 11: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

11

Test Cluster Configuration

• Dell™ PowerEdge™ R720/R720xd 32-node (640-core) “Jupiter” cluster

– Dual-Socket Hexa-Core Intel E5-2680 V2 @ 2.80 GHz CPUs

– Memory: 64GB memory, DDR3 1600 MHz, Dual Rank

– OS: RHEL 6.2, OFED 2.1-1.0.6 InfiniBand SW stack

– Hard Drives: R720xd: 24x 250GB 7.2 RPM SATA 2.5” on RAID 0. R720: 16x250GB on RAID 0

• Intel Cluster Ready certified cluster

• Mellanox Connect-IB FDR InfiniBand and ConnectX-3 Ethernet adapters

• Mellanox SwitchX 6036 VPI InfiniBand and Ethernet switches

• MPI executables provided: Platform MPI 8.3, Open MPI 1.4

• MPI used: Platform MPI 9.1, Open MPI 1.8 based on Mellanox HPC-X 1.0.0rc4

• Application: VPS 2013.01

• Benchmarks:

– Crash_NEON_FINE_CAR2CAR – Chrysler Neon CAR2CAR 56km/h, 120ms, Single Precision

(unless otherwise stated)

Page 12: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

12

VPS Performance – MPI-OpenMP Hybrid

• Hybrid mode allows higher performance at scale

– 2 OpenMP threads per process provides 8% higher at 32 nodes

– Slightly better performance if OpenMP is not used on smaller node counts

– Hybrid mode expect to provide higher performance at larger scale

Higher is better

8%

FDR InfiniBand

Page 13: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

13

VPS Performance – Network (MPI)

• FDR InfiniBand delivers the best network scalability performance

– Provides up to 701% higher performance than 1GbE at 32 nodes

– Provides up to 98% higher performance than 10GbE at 32 nodes

– FDR IB scales linearly while 10/40GbE has scalability limitation beyond 16 nodes

– Result for 1GbE at 16 nodes was excluded due to error termination at runtime

Higher is better 20 MPI proc/node

701%

98%

Page 14: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

14

VPS Performance – Network (Hybrid)

• Similar scalability seen with 2 OpenMP thread spawn per process

– FDR IB provides up to 564% higher performance vs 1GbE, and 129% vs 10GbE

– FDR IB scales linearly while 10GbE has scalability limitation beyond 16 nodes

– Scalability of 1GbE drops after 4 nodes

Higher is better 10 MPI / 2 OMP

564%

129%

Page 15: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

15

VPS Profiling – User/MPI Time Ratio

• VPS spent more time in computation than communication for FDR IB

– Other network spent more time in communication at 32 nodes

– FDR IB consumes 33% of runtime in comm, vs 10GbE: 71% and 1GbE: 93%

– FDR InfiniBand provides more time for computation, thus the most efficient network

Page 16: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

16

VPS Profiling – MPI Communication Time

• MPI communication time consumption at 32 nodes

– MPI Time: MPI_Allreduce(71%), MPI_Wait(13%), MPI_Recv(12%), MPI_Isend(3%)

– Wall Time: MPI_Allreduce(24%), MPI_Wait(4%), MPI_Recv(4%), MPI_Isend(1%)

– FDR InfiniBand is used

32 Nodes/640 MPI

FDR InfiniBand

Page 17: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

17

VPS Profiling – MPI Communication Time

• Identified MPI overheads by profiling communication time

– VPS uses different MPI communication method extensively

• collective, point-to-point and non-blocking operations

• Ethernet spends more in collective operations

– 10GbE vs FDR IB: Spent longer time in MPI_Allreduce

– 1GbE vs FDR IB: Spent way longer time in MPI_Allreduce, MPI_Barrier

10GbE 1GbE

20 Processes/Node

Page 18: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

18

MPI Profiling with IPM

• IPM (Integrated Performance Monitoring)

– http://ipm-hpc.sourceforge.net (existing)

– http://ipm2.org (new)

• Example to run it:

– Add “module use /opt/hpcx-v1.2.0-xxxxx/modulefiles; module

load hpcx” to ~/.bashrc

– LD_PRELOAD=/opt/hpcx-v1.2.0-xxx/ompi-mellanox-

v1.8/tests/ipm-2.0.2/lib/libipm.so mpirun -x LD_PRELOAD

<rest of the cmd>

• To generate HTML for the report – module load ploticus

– export IPM_KEYFILE=/opt/hpcx-v1.2.0-xxx/ompi-mellanox-

v1.8/tests/ipm-2.0.2/etc/ipm_key_mpi

– export IPM_REPORT=full

– export IPM_LOG=full

– export IPM_LOGWRITER=serial

– ipm_parse -html <username>.<Timestamp>.ipm.xml

Page 19: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

19

VPS Performance – Open MPI or HPC-X

• Setting up PAM-CRASH (VPS) for running Open MPI or HPC-X

– The following details changes needed to make newer Open MPI or HPC-X to

work on PAM-CRASH

– Due to HPC-X is based on the more recent version of OMPI than the version

of OMPI provided in PAM-CRASH executable

• 1. To load HPC-X library for Intel Compilers: – module use /opt/hpcx-v1.2.0-XXX/modulefiles

– module load hpcx

• 2. Soft links to redirect old libraries

– Need to create soft links for libmpi_f77.so.0, libmpi.so.0 and others.

Otherwise you will messages about the see this:

– [MPM] dlopen mpif_openmpi-1.4.o failed: libmpi_f77.so.0: cannot open

shared object file: No such file or directory

Page 20: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

20

VPS Performance – Open MPI/HPC-X

– Create soft links to redirect the new HPC-X libraries for PAM-CRASH

executable :

– # pwd

– # /opt/hpcx-v1.2.0-XXX/ompi-mellanox-v1.8/lib

– # ln -s libopen-rte.so.7 libopen-rte.so.0

– # ln -s libopen-pal.so.6 libopen-pal.so.0

– # ln -s libmpi.so.1 libmpi.so.0

– # ln -s libmpi_mpifh.so libmpi_f77.so.0

• 3. Include HPC-X path when running pamworld

– Need to LD_PRELOAD libmpi.so because Open MPI has an issue with

dlopen and python

– LD_PRELOAD=/opt/hpcx-XXX/ompi-mellanox-

v1.8/lib/libmpi.so.0

/path_to/VPS_2013.01_UNIX/vpsolver/2013.01/pamworld

<…rest of arguments>…

• For more information, visit the HPC|Works:

– http://hpcadvisorycouncil.com/subgroups_hpc_works.php

Page 21: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

21

VPS Performance – Open MPI/HPC-X

• Enabling FCA provides additional speedup for Open MPI

– MPI collective accelerations provide ~9% speedup at 32 nodes

• Runtime flags used:

– Enabling FCA: -mca coll_fca_enable 1 -mca coll_fca_np 0

– Other tuned flags used for FCA, to mitigate node imbalances effect in MPI_Allreduce:

– –map-by slot -x fca_mpi_slow_sleep=0 -x

fca_mpi_slow_num_polls=100000000"

Higher is better 10 MPI/2 OMP/node

9%

Page 22: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

22

VPS Performance – MPI Implementations

• Tuned Open MPI delivers higher performance for VPS

– Open MPI with FCA runs 10% faster than Platform MPI

– Default MPI implementation used in VPS is Platform MPI

– VPS supports OMPI 1.4 but need more recent version to work for network

– Modifications (on pamworld) and run script to make Open MPI 1.8 to work

Higher is better 10 MPI/2 OMP/node

10%

Page 23: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

23

VPS Performance – Turbo Mode

• Enabling Turbo mode results in higher application performance – Up to 8% of the improvement seen by enabling Turbo mode – At a cost of ~11% of higher power utilization per node – Boosting base frequency; consequently resulted in higher power consumption – Power measurement is gathered from the iDRAC management interface on R720

• Using kernel tools called “msr-tools” to adjust Turbo Mode dynamically – Allows dynamically turn off/on Turbo mode in the OS level

Lower is better Higher is better

8% 11%

8%

8%

Page 24: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

24

8% 39%

VPS Performance – CPU Frequencies

• Running at higher CPU clock improves VPS performance

– For example, Running CPU at 2000MHz on all nodes saves 23% of system power

– While performance is improved by 49% when using 2800MHz (Turbo) vs 2000MHz

• Better Power/Performance efficiency is observed

– When clock speed around 2700MHz or 2800MHz with Turbo off

Open MPI 20 MPI proc/node

48%

10% 10% 23% 11%

Page 25: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

25

VPS Performance – Floating Point Precisions

• Running Double Precision takes long than running at Single Precision

– DP takes more time than SP, by 54% on a single node

– Some models require to run in DP to reach convergence, or crash when using SP

• The difference in ratio between DP and SP increases as it scales

– Since DP provides higher precision in calculation, thus requires more data transferred

– With data grows faster for DP as it scales, thus explains DP is slower than SP

Lower is better Higher is better

62%

74%

70%

56% 54%

Page 26: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

26

VPS Profiling – IO Profiling

• Both rank 0 node and other nodes perform similar disk operations

– Disk read occurs mostly at the beginning of a run

– Recurring disk writes takes place throughout the job run

– Could potentially benefit by using parallel file system

FDR InfiniBand

Page 27: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

27

VPS Profiling – MPI Time Spent

• The most time consuming MPI for VPS is MPI_Allreduce – MPI_Allreduce consumes 60% of all MPI time – Majority of MPI_Allreduce takes place at 4B and 224B

FDR InfiniBand 32 Nodes

Page 28: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

28

VPS Profiling – Message Sizes

• Majority of messages are small messages

– Messages are concentrated below 64KB

• Number of messages increases with the number of nodes

Page 29: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

29

VPS Profiling – MPI Data Transfer

• As the cluster grows, same amount of data transfers takes place

– From ~15-30GB per rank at 1 node vs 7-30GB at 8 nodes

– Some node imbalances are seen through the amount of data transfers

Page 30: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

30

VPS Profiling – Aggregated Transfer

• Aggregated data transfer refers to:

– Total amount of data being transferred in the network between all MPI ranks collectively

• Very large data transfer takes place in VPS

– High network throughput is required for delivering the network bandwidth

– 2TB of data transfer takes place between the MPI processes at 8 nodes

Page 31: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

31

VPS Profiling – Point To Point Data Flow

• The point to point data flow shows the communication pattern of VPS

– VPS mainly communicates mainly its neighbors and close ranks

– The pattern stays the same as the cluster scales

32 Nodes – 320 Processes 4 Nodes – 40 Processes

Page 32: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

32

VPS – Summary

• Performance

– FDR InfiniBand delivers the highest network performance for VPS to scale

– FDR IB provides higher performance against other networks

• FDR IB delivers ~162% higher compared to 40GbE, ~178% vs 10GbE on a 32 node run

– MPI-OpenMP Hybrid mode can provide better performance at scale

• About 8% performance increase at 32 nodes with hybrid

– Enabling Turbo mode results in higher application performance

• Up to 8% of the improvement seen by enabling Turbo mode

• At the expense of ~11% in higher power utilization

– The default MPI implementation provides similarly as Open MPI 1.8 in HPC-X

• With FCA enabled, Open MPI runs about 10% faster than Platform MPI at 32 nodes

• MPI Profiling

– Majority of MPI communication time comes from MPI_Allreduce

• About 71% of the time spent in MPI_Allreduce

– Ethernet solutions consumes more time in communications

• Spent 71%-93% of overall time in network due to congestion in Ethernet, while IB spent ~33%

Page 33: Application Performance Optimizations (Part 2) · 2020-01-14 · 3 HPC Advisory Council HPC Center Dell™ PowerEdge™ R730 32-node cluster HP Cluster Platform 3000SL 16-node cluster

33 33

Thank You HPC Advisory Council

All trademarks are property of their respective owners. All information is provided “As-Is” without any kind of warranty. The HPC Advisory Council makes no representation to the accuracy and

completeness of the information contained herein. HPC Advisory Council undertakes no duty and assumes no obligation to update or correct any information presented herein