Modelowanie wydajności i optymalizacja na współczesnych architekturach obliczeniowych. Miłosz Ciżnicki, Piotr Kopta Poznań,

Podobne dokumenty
PROGRAMOWANIE WSPÓŁCZESNYCH ARCHITEKTUR KOMPUTEROWYCH DR INŻ. KRZYSZTOF ROJEK

PROGRAMOWANIE WSPÓŁCZESNYCH ARCHITEKTUR KOMPUTEROWYCH DR INŻ. KRZYSZTOF ROJEK

Tychy, plan miasta: Skala 1: (Polish Edition)

Instruction Set Instruction Set Extensions Embedded Options Available. Recommended Customer Price TRAY: $999.00

Procesory wielordzeniowe (multiprocessor on a chip) Krzysztof Banaś, Obliczenia wysokiej wydajności.

Maciej Sypniewski. lato 2014, Politechnika Warszawska, Wydział Elektroniki i Technik Informacyjnych

Wstęp. Przetwarzanie równoległe. Krzysztof Banaś Obliczenia równoległe 1

Wykorzystanie architektury Intel MIC w obliczeniach typu stencil

Performance Evaluation

Studia II stopnia. studia stacjonarne. wspólny dla kierunku. Zakład Fizyki Jądrowej

Implementacje nowych technologii serwerowych

Obliczenia Wysokiej Wydajności

Wojewodztwo Koszalinskie: Obiekty i walory krajoznawcze (Inwentaryzacja krajoznawcza Polski) (Polish Edition)

Zakopane, plan miasta: Skala ok. 1: = City map (Polish Edition)

Dostęp do europejskich systemów obliczeniowych Tier-0/Tier-1 w ramach PRACE

Proposal of thesis topic for mgr in. (MSE) programme in Telecommunications and Computer Science

Revenue Maximization. Sept. 25, 2018

Wstęp. Przetwarzanie współbieżne, równoległe i rozproszone

Hard-Margin Support Vector Machines

Wojewodztwo Koszalinskie: Obiekty i walory krajoznawcze (Inwentaryzacja krajoznawcza Polski) (Polish Edition)

MaPlan Sp. z O.O. Click here if your download doesn"t start automatically

i3: internet - infrastruktury - innowacje

Dostęp do europejskich systemów obliczeniowych Tier-0 w ramach PRACE

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. Wprowadzenie do systemów wieloprocesorowych

Oprogramowanie na miarę z13

Programowanie procesorów graficznych GPGPU

Programowanie Współbieżne

Obliczenia Wysokiej Wydajności

Karpacz, plan miasta 1:10 000: Panorama Karkonoszy, mapa szlakow turystycznych (Polish Edition)

Tesla. Architektura Fermi

Emilka szuka swojej gwiazdy / Emily Climbs (Emily, #2)

Machine Learning for Data Science (CS4786) Lecture11. Random Projections & Canonical Correlation Analysis


MESco. Testy skalowalności obliczeń mechanicznych w oparciu o licencje HPC oraz kartę GPU nvidia Tesla c2075. Stanisław Wowra

deep learning for NLP (5 lectures)

Technologia Informacyjna Wykład II Jak wygląda komputer?

Network Services for Spatial Data in European Geo-Portals and their Compliance with ISO and OGC Standards

Home Software Hardware Benchmarks Services Store Support Forums About Us

Ankiety Nowe funkcje! Pomoc Twoje konto Wyloguj. BIODIVERSITY OF RIVERS: Survey to teachers

Installation of EuroCert software for qualified electronic signature

Usługi IBM czyli nie taki diabeł straszny


Cracow University of Economics Poland. Overview. Sources of Real GDP per Capita Growth: Polish Regional-Macroeconomic Dimensions

Page 1. Pięcio-krokowy pipeline

MS Visual Studio 2005 Team Suite - Performance Tool

CEE 111/211 Agenda Feb 17

Programowanie GPU jako procesora ogólnego przeznaczenia.

SSW1.1, HFW Fry #20, Zeno #25 Benchmark: Qtr.1. Fry #65, Zeno #67. like

Metodyki projektowania i modelowania systemów Cyganek & Kasperek & Rajda 2013 Katedra Elektroniki AGH

The Overview of Civilian Applications of Airborne SAR Systems

European Crime Prevention Award (ECPA) Annex I - new version 2014

Zegar - układ wysyłający regularne impulsy o stałej szerokości (J) i częstotliwości (f)

Libra.cs.put.poznan.pl/mailman/listinfo/skisrkolo.

Estimation and planing. Marek Majchrzak, Andrzej Bednarz Wroclaw,

Previously on CSCI 4622

System optymalizacji produkcji energii

HPC na biurku. Wojciech De bski

Procesory rodziny x86. Dariusz Chaberski

Effective Governance of Education at the Local Level

Domy inaczej pomyślane A different type of housing CEZARY SANKOWSKI

Architektury komputerów Architektury i wydajność. Tomasz Dziubich

INSTRUKCJE JAK AKTYWOWAĆ SWOJE KONTO PAYLUTION

Few-fermion thermometry

Machine Learning for Data Science (CS4786) Lecture 11. Spectral Embedding + Clustering

Inverse problems - Introduction - Probabilistic approach

XIV International PhD Workshop OWD 2012, October 2012 NOWOCZESNE TECHNIKI WYKONYWANIA ZAAWANSOWANYCH OBLICZEŃ NUMERYCZNYCH

Sprzęt komputerowy 2. Autor prezentacji: 1 prof. dr hab. Maria Hilczer

Blow-Up: Photographs in the Time of Tumult; Black and White Photography Festival Zakopane Warszawa 2002 / Powiekszenie: Fotografie w czasach zgielku

Helena Boguta, klasa 8W, rok szkolny 2018/2019

Stargard Szczecinski i okolice (Polish Edition)

Aktualizacja Oprogramowania Firmowego (Fleszowanie) Microprocessor Firmware Upgrade (Firmware downloading)

CUDA obliczenia ogólnego przeznaczenia na mocno zrównoleglonym sprzęcie. W prezentacji wykorzystano materiały firmy NVIDIA (

Akcja COST FP0902 jako przykład międzynarodowej współpracy w zakresie metodyki badań pozyskiwania biomasy leśnej do celów energetycznych

Macierze All Flash. Czy to jest alternatywa dla macierzy klasy Enterprise? Krzysztof Jamiołkowski HP EG Storage Solutions Architect

Miedzy legenda a historia: Szlakiem piastowskim z Poznania do Gniezna (Biblioteka Kroniki Wielkopolski) (Polish Edition)

Tworzenie programów równoległych. Krzysztof Banaś Obliczenia równoległe 1

Unit of Social Gerontology, Institute of Labour and Social Studies ageing and its consequences for society

JCuda Czy Java i CUDA mogą się polubić? Konrad Szałkowski

Programowanie Rozproszone i Równoległe

ERASMUS + : Trail of extinct and active volcanoes, earthquakes through Europe. SURVEY TO STUDENTS.

No matter how much you have, it matters how much you need

Konsolidacja wysokowydajnych systemów IT. Macierze IBM DS8870 Serwery IBM Power Przykładowe wdrożenia

Wojewodztwo Koszalinskie: Obiekty i walory krajoznawcze (Inwentaryzacja krajoznawcza Polski) (Polish Edition)

Plan wykładu. Architektura systemów komputerowych. Cezary Bolek

Architektura systemów komputerowych

Architektura Systemów Komputerowych. Rozwój architektury komputerów klasy PC

DODATKOWE ĆWICZENIA EGZAMINACYJNE

Rev Źródło:

Zamieszczanie ogłoszenia: obowiązkowe. Ogłoszenie dotyczy: zamówienia publicznego.

Financial support for start-uppres. Where to get money? - Equity. - Credit. - Local Labor Office - Six times the national average wage (22000 zł)

Home Software Hardware Benchmarks Services Store Support Forums About Us

Compatible cameras for NVR-5000 series Main Stream Sub stream Support Firmware ver. 0,2-1Mbit yes yes yes n/d

Organizacja pamięci współczesnych systemów komputerowych : pojedynczy procesor wielopoziomowa pamięć podręczna pamięć wirtualna

Towards Stability Analysis of Data Transport Mechanisms: a Fluid Model and an Application

Wojewodztwo Koszalinskie: Obiekty i walory krajoznawcze (Inwentaryzacja krajoznawcza Polski) (Polish Edition)

OPBOX ver USB 2.0 Mini Ultrasonic Box with Integrated Pulser and Receiver

Najlepsze drukarki 3D

Budowa komputera. Magistrala. Procesor Pamięć Układy I/O

Linear Classification and Logistic Regression. Pascal Fua IC-CVLab

Transkrypt:

Modelowanie wydajności i optymalizacja na współczesnych architekturach obliczeniowych Miłosz Ciżnicki, Piotr Kopta Poznań, 24.05.2017

Outline How fast is CPU? Application characteristic Tools available in PSNC Roofline model Example: EULAG

What determines performance How fast is CPU? How fast data can be moved? Application characteristic (CPU-bound or memory-bound) Performance optimization for one application may not work for the other Running benchmarks helps to understand limitations of the hardware Profiling code helps to understand application performance characteristic (and limitations)

CPU-bound vs Mem-bound Compute-bound time to complete task is determined by the speed/number of CPUs Memory-bound - time to complete task is determined by the memory latency and/or bandwidth Nowadays it is less likely to have just one component being responsible for the time required to complete task However starting from multicore era, the memory latency and bandwidth became important bottleneck

How to run faster - cache Level 1 Level 2 Level 3... Level n Size of memory Increasing distance from CPU = greater access time Example: L1: 32 kb, latency 3 cycles L2: 256 kb, latency 10 cycles L3: 8MB, latency 40 cycles DRAM: 16GB, latency 200 cycles DISK: 1TB, latency 1.000.000 cycles Cache hit data found in cache Cache miss data not found in cache, thus must be copied from lower memory level Capacity miss cache runs out of space for new data Conflict miss more that one item is mapped to the same location in cache

How to run faster cont. Pipelining Multiple steps in one operation: fetch, decode, execute, memory, write back Dependencies and branching may affect the pipeline Instruction level parallelism (superscalar) Multiple instructions executed at the same time Loop unroling Multicore Combines caches, pipelining and superscalars

Fast and slow operations In terms of cost Fast and inexpensive: add, multiply, sub, fma (fused multiply add) Medium: divide, modules, sqrt Slow: trans (support in newer CPUs and GPUs) Very slow: power Use linear algebra (BLAS, LAPACK) and math libraries (Intel MKL)

Code optimization Use math, BLAS, LAPACK libraries (for effcient math routines, to utilize max. of pipelining instructions) Efficient code is often not very portable (performance is decreased among different architectures) Use compilers optimizations (but can t optimize everything) Profile your code Use accelerators (GPUs) and coprocessors (Intel Phi) Write generic code + specialized kernels matrix (2048 x 2048) product Cholesky (4096) decomposition MKL single core vs naive single core speedup 52x 12x MKL (up to 28 cores) vs naive single core speedup 543x 190x

Assesing performance strong vs. weak scaling Strong scaling: fixed problem size, measure speedup with more processors Example: WRF climate modelling application Weak scaling: test for time for fixed problem size per number of processors Example: LINPACK benchmark, more efficient with more memory

Assesing performance time vs FLOPS Does execution time give enough information about application performance? FLOPS/s - how many floating points operation per second can your code do? Peak performance clock rate * number of single/double precision add and or muls per clock or FMA E.g. 2.0GHz * 8 FLOP / clock = 16 GFLOP/s Can never be reach (data load/store) Suistained performance application dependant Does FLOP/s gives enough information about performance?

QPI QPI CORE AVX L1/L2 QPI LLC 2.5 MB CORE AVX L1/L2 QPI LLC 2.5 MB CORE AVX L1/L2 QPI LLC 2.5 MB CORE AVX L1/L2 QPI LLC 2.5 MB CORE AVX L1/L2 QPI LLC 2.5 MB CORE AVX L1/L2 QPI LLC 2.5 MB CORE AVX L1/L2 QPI LLC 2.5 MB CORE AVX L1/L2 QPI LLC 2.5 MB QPI QPI Intel Xeon E5 2697 v3 2.6 GHz (3.6 GHz Turbo) 14 cores Theoretical performance ~650 GFlops Memory bandwidth 68 GB/s AVX 2 LLC 2.5 MB LLC 2.5 MB LLC 2.5 MB LLC 2.5 MB QPI QPI QPI QPI L1/L2 L1/L2 L1/L2 L1/L2 AVX AVX AVX AVX CORE CORE CORE CORE LLC 2.5 MB LLC 2.5 MB QPI QPI L1/L2 L1/L2 AVX AVX CORE CORE Memory Ctrl Memory Ctrl DDR DDR DDR DDR 4 x double 8 x float 32 x byte 0 1 2 3 4 5 6 7 31 2017-05-24 11

Wyzwania współczesnych architektur obliczeniowych 650 Gflops only for FMA (ang. fused multiply-add) d = a b + c 325 Gflops for the other operations ~ 10 flops / B for (single precision float) d = a d + c (a, c constants) - 2 flops, 8 B 68 GB/s, 27 G(single precision float)/s, < 9 G(double precision float)s Vectorization SIMD Multithreading 14 cores 2017-05-24 12

Hardware performance counters Set of special-purpose hardware registers to store counts of hardware-related activities Can help in spotting the application bottlenecks Allow for low-level performance analysis and tuning, though implementation may be somehow difficult Examples Cache misses Branch mispredictions Memory latency and bandwidth

Data access Across nodes and to main memory Data access time is measured in terms of bandwidth and latency Stream benchmark Latency is the startup time for memory, important for short memory transfers Time = latency + lenght/bandwidth Solution cache memory and multithreading

Narzędzia dostępne na zasobach PCSS Intel Parallel Studio XE 2017 (najnowsza dostępna wersja) Kompilatory C++ C++ 11, C99, OpenMP 4.1, automatyczna wektoryzacja Fortran Fortran IV/77/90/95/2003/2008, DO CONCURRENT, OpenMP 4.0 Biblioteki Intel Math Kernel Library (Intel MKL) zestaw zoptymalizowanych funkcji z dziedzin algebry liniowej (BLAS, LAPACK), transformat Fourier a, sieci neuronowych, funkcji statystycznych, zagadnień własnych Rogue Wave IMSL Fortran Numerical Library zestaw zoptymalizowanych komercyjnych bibliotek z dziedziny analizy numerycznej oraz statystyki Intel Data Analytics Acceleration Library (Intel DAAL) biblioteka zawierająca funkcje wykorzystywane w uczeniu maszynowym, realizujące wszystkie etapy analizy danych (preprocessing, transformacje, modelowanie, weryfikację) Intel Integrated Performance Primitives (Intel IPP) zestaw algorytmów do przetwarzania sygnałów, obrazów, kompresji, kryptografii (możliwa integracja z biblioteką OpenCV) Intel Threading Building Blocks model tworzenia programów równoległych w języku C++, dostarcza mechanizmów do allokacji pamięci, zarządzania przepływem danych i operacji synchronizujących w środowisku równoległym na platformach heterogenicznych 2017-05-24 15

Narzędzia dostępne na zasobach PCSS Intel Parallel Studio 2017 XE (najnowsza dostępna wersja) Narzędzia Intel VTune Amplifier XE profiler aplikacji równoległych (CPU/GPU) wyposażony w interfejs GUI dający możliwość analizy aplikacji pod względem wykorzystania CPU, skalowalności, dostępu do pamięci oraz wykorzystania jednostek wektorowych Intel Inspector debugger kodu ułatwiający znajdowanie błędów związanych synchronizacją kodu wielowątkowego oraz dostępem do pamięci Intel Advisor narzędzie wspomagające optymalizację kodu pod kątem wektoryzacji oraz przetwarzania wielowątkowego, wskazuje miejsca oraz metody które pomogą zwiększyć wydajność oraz skalowalność aplikacji Intel Trace Analyzer and Collector profiler dla aplikacji równoległych wykorzystujących wymianę komunikatów (MPI), dostarcza zestawu statystyk pozwalających na analizę komunikacji oraz balansu obciążenia aplikacji, dzięki małemu narzutowi na wydajność oraz możliwości pracy wsadowej umożliwia badanie wielkoskalowych aplikacji (>10k procesów). 2017-05-24 16

Przegląd narzędzi wspomagających programowanie (2017.05.31-06.01) 2-dwu dniowe szkolenie dotyczące narzędzi Intel dostępnych na klastrze Eagle Intel Parallel Studio XE Intel C++ & Fortran Compilers OpenMP 4 Intel MKL Intel Vtune Miejsce: PCSS Zapisy: https://szkolenia.man.poznan.pl 2017-05-24 17

Performance modelling How to measure performance Execution time Energy usage Different models to choose The old way (when data movement was not so expensive) : FLOPS/s how many floating points operation per second Performance may be memory-latency or memory-bandwidth bound rather than compute-bound Performance modelling is used to determine best possible performance on your hardware (does execution time tell it?)

The Roofline Model P max = Applicable peak performance, assuming data comes from L1 cache I = Computational intensity ( work per byte transferred) over the slowest data path utilized ( the bottleneck ) I = W/Q W FLOPs Q - bytes b s = Applicable peak bandwidth of the slowest data path utilized Estimated performance: P = min(p max, I * b s )

The Roofline Model

The Roofline Model

The Roofline Model Methodology To construct roofline plots we need to measure three code specific quantities: W, Q and T Measuring W and Q How to measure it? Code analysis Hardware Performance Counters Instrumentation

Code analysis Methodology Consider the daxpy routine for(j = 0; j < 10; j++) for(i = 0; i < n; i++) c[i] = a[i] + b[i] * scalar Quantities for the double precision W = 2n Qr >= 16n Qw >= 8n Q = Qr + Qw >= 24n I = 2/24 = 1/12 For n = 10 8 W = 2 GFLOP Q >= 24 GB

Intel Xeon CPU E5-2697 v3 Haswell 14 cores 1.2-2.6 GHz (3.2-3.6GHz turbo) 32 kb L1 data cache per core 256 kb L2 cache per core 35 MB L3 cache per chip DDR4 memory interface 256 bit SIMD FP unit - AVX ~325 GFLOP/s DP peak

Nvidia Tesla K20m Kepler GK110 K20m 2496 cores 0.32-0.7 GHz 13 SMX units with 192 cores each 1.25 MB L2 cache 1.17 TFLOP/s DP peak PCI Express 3:1 SP:DP performance

CPU vs GPU Intel Xeon E5-2697 v3 Haswell Nvidia K20m Kepler Process size 22 nm 28 nm Transistor count 5.69 Billion 7.1 Billion Release date Q3 2014 Q1 2013 Cores@Clock 14 @ 2.9GHz AVX 2496 @ 0.7 GHz Performance/core 23.2 GFLOP/s 0.47 GFLOP/s Total performance 324.8 GFLOP/s 1170 GLOP/s Stream BW 68 GB/s 173 GB/s (ECC=0) TDP 145 W 225 W Performance/Watt 2.24 GFLOP/W 5.2 GFLOP/W

Code analysis Methodology On Intel Xeon E5-2697 v3 b s = 68GB/s I = 2/24 = 1/12 P = min(p max, I * b s ) I * b s = 1/12 * 68 = 5.66 GFLOP/s (1.7% of peak performance) P max = 324.8 GLOP/s (14 FP units x 2 x 4 FLOP/cy x 2.9 GHz) P = min(324.8, 5.66) = 5.66 GFLOP/s

Code analysis Methodology On Kepler K20m b s = 173GB/s I = 2/24 = 1/12 P = min(p max, I * b s ) I * b s = 1/12 * 173 = 14.41 GFLOP/s (1.2% of peak performance) P max = 1170 GLOP/s (13 SMX x 64 DP units x 2 FLOP/cy x 0.705 GHz) P = min(1170, 14.41) = 14.41 GFLOP/s

EULAG activities Adaptation to novel hardware architectures Urban modelling Contamination dispersion

Grant of the Polish National Science Center Project description Methods and algorithms for organization of computations in the class of anelastic numerical models for geophysical flows on modem computer architectures with realization in the EULAG model Goal: parallelize GCR solver and 3D MPDATA algorithm on modern hybrid CPU-GPU clusters and NUMA architectures Consortium: Czestochowa University of Technology Institute of Meteorology and Water Management - National Research Institute Poznan Supercomputing and Networking Center

Weak scaling Multi-CPU and multi-gpu performance scaling Project description Architecture Speedup CPU -> opt CPU 1.4 CPU -> GPU 6 CPU -> opt CPU+GPU 7 Strong scaling

Weak scaling Multi-CPU and multi-gpu performance per Watt scaling Project description Architecture opt CPU -> GPU 2.13 opt CPU -> optcpu+gpu Power efficiency 1.88 Strong scaling

Pytania 2017-05-24 33

THANK YOU Poznan Supercomputing and Networking Center affiliated to the Institute of Bioorganic Chemistry of the Polish Academy of Sciences, ul. Noskowskiego 12/14, 61-704 Poznań, POLAND, Office: phone center: (+48 61) 858-20-00, fax: (+48 61) 852-59-54, e-mail: office@man.poznan.pl, http://www.psnc.pl