• No results found

Guided Performance Analysis with the NVIDIA Visual Profiler

N/A
N/A
Protected

Academic year: 2021

Share "Guided Performance Analysis with the NVIDIA Visual Profiler"

Copied!
32
0
0

Loading.... (view fulltext now)

Full text

(1)

Guided Performance Analysis with the

NVIDIA Visual Profiler

(2)

Identifying Performance Opportunities

 NVIDIA® Nsight™ Eclipse Edition (nsight)  NVIDIA® Visual Profiler (nvvp)

(3)

Guided Performance Analysis

(4)

Improved Analysis Visualization

(5)
(6)

Guided Analysis: Kernel Optimization

 Overall application optimization strategy

— Based on identifying primary performance limiter

 Common optimization opportunities  How to use CUDA profiling tools

— Execute optimization strategy

(7)

Identifying Candidate Kernels

 Analysis system estimates which kernels are best candidates for speedup

(8)

Primary Performance Limiter

 Most likely limiter to performance for a kernel

— Memory bandwidth — Compute resources

— Instruction and memory latency

 Primary limiter should be addressed first

(9)

Calculating Performance Limiter

 Memory bandwidth utilization  Compute resource utilization

 High utilization value  likely performance limiter

 Low utilization value  likely not performance limiter

(10)

Memory Bandwidth Utilization

 Traffic to/from each memory subsystem, relative to peak  Maximum utilization of any memory subsystem

— L1/Shared Memory — L2 Cache

— Texture Cache — Device Memory

— System Memory (via PCIe)

(11)

Compute Resource Utilization

 Number of instructions issued, relative to peak capabilities of GPU

— Some resources shared across all instructions

— Some resources specific to instruction “classes”: integer, FP, control-flow, etc.

(12)

Calculating Performance Limiter

 Utilizations

— Both high  compute and memory highly utilized

(13)

Calculating Performance Limiter

 Utilizations

— Memory high, compute low  memory bandwidth limited

(14)

Calculating Performance Limiter

 Utilizations

— Compute high, memory low  compute resource limited

(15)

Calculating Performance Limiter

 Utilizations

— Both low  latency limited

(16)
(17)

Limiter-Specific Optimization Analysis

 Memory Bandwidth Limited  Compute Limited

(18)

Memory Bandwidth Limited

 Global Memory Load/Store

— Access pattern inefficiencies — Misaligned

 Memory Bandwidth Limits  Local Memory Overhead

— Register spilling

(19)

Compute Resource Limited

 Divergent Branches

 Low Warp Execution Efficiency

— Due to divergent branches

 Over-subscribed function units

— Load/Store — Arithmetric — Control-Flow — Texture

(20)

Latency Limited

 Low Theoretical Occupancy

— Block Size — Registers

— Shared Memory

 Low Achieved Occupancy  Too Few Blocks

(21)
(22)

Summary

 Visual Profiler Guided Analysis gives step-by-step optimization advice

 Kernel Analysis strategy based on identifying primary limiter

— Memory bandwidth — Compute resources

— Instruction and memory latency

(23)

Upcoming GTC Express Webinars

Register at www.gputechconf.com/gtcexpress

September 17 - ArrayFire: A Productive GPU Software Library for Defense and Intelligence Applications

September 19 - Learn How to Debug OpenGL 4.2 with NVIDIA® Nsight™ Visual Studio Edition 3.1

September 24 - Pythonic Parallel Patterns for the GPU with NumbaPro

September 25 - An Introduction to GPU Programming

September 26 - Learn How to Profile OpenGL 4.2 with NVIDIA® Nsight™ Visual Studio Edition 3.1

(24)

GTC 2014 Call for Submissions

Looking for submissions in the fields of

 Science and research  Professional graphics  Mobile computing

 Automotive applications  Game development

 Cloud computing

(25)
(26)

Understanding Latency

 Memory load : delay from when load instruction executed until data returns

 Arithmetic : delay from when instruction starts until result produced

(27)

Hiding Latency

 SM can do many things at once…

 Can “hide” latency as long as there are enough

Warp 0 Warp 6 Warp 1 Warp 2 Warp 3 Warp 4 Warp 5 Warp 0 Warp 2 Warp 0 waiting SM still busy Time

(28)

Occupancy

 Theoretical occupancy, upper bound based on:

— Threads / block

— Shared memory usage / block — Register usage / thread

 Achieved occupancy

— Actual measured occupancy of running kernel

— (active_warps / active_cycles) / MAX_WARPS_PER_SM Occupancy is the ratio of the number of active warps per

(29)

Low Theoretical Occupancy

 # warps on SM = # blocks on SM × # warps per block

 If low…

— Not enough blocks in kernel

— # blocks on SM limited by threads, shared memory, registers

 CUDA Best Practices Guide has

extensive discussion on improving occupancy

(30)

Low Achieved Occupancy

 In theory… kernel allows enough warps on each SM

SM 1 Time Block 0 SM0 Block 6 Block 1 Block 7 Block 2 Block 8 Block 3 Block 9 Block 4 Block 10 Block 5 Block 11

(31)

Low Achieved Occupancy

 In theory… kernel allows enough warps on each SM  In practice… have low achieved occupancy

 Likely cause is that all SMs do not remain equally busy over duration of kernel execution

SM 1 Time Block 0 Block 1 Block 2 Block 6 Block 7 Block 8 SM0 Block 3 Block 4 Block 5 Block 9 Block 10 Block 11

(32)

Lots Of Warps, Not Enough Can Execute

 SM can do many things at once…

 No “ready” warp… Warp Idle Warp Idle Time

References

Related documents

Significant improvements (p<0.05) to river water quality were observed for the filtrate collected from the Eucalyptus biochar filter columns, with significantly

Distinguished from all other known Crocodyli- formes by the following unique set of traits (autapomorphies marked with asterisks): nasal with dorsal midline crest*, frontal

Furthermore, we performed a series of experiments on the double transform formula for large values of stock and strike prices using the Talbot method and the results are com- pared

Refer to D.98B.FORD Data Element Dictionary for acceptable code values. X 1131 Code list qualifier C

Facial attractiveness as captured by our symmetry data, adds to player salaries over and above performance, player characteristics and co-worker effects.. We note that when we use

BNZ EQUITY INVESTMENTS NO.2 LIMITED BNZ FACILITIES MANAGEMENT LIMITED BNZ INCOME MANAGEMENT LIMITED BNZ INCOME SECURITIES 2 LIMITED BNZ INCOME SECURITIES LIMITED BNZ

ABSTRACT: The objective of this study was to determine the clinical pregnancy rate with 2 inseminations compared to a single intrauterine insemination (IUI) in a given cycle

An investigation was conducted to determine the low-speed yawing stability deriv- atives of a twin-jet fighter airplane model at high angles of attack.. Tests