SIMD, GPUs Chapter 6 — Parallel Processors from Client to Cloud — 1 SIMD Vector Processors are SIMD processors. SIMD processors mainly try to exploit Data-level Parallelism. SIMD used to be done by Vector Processors which were used in Supercomputers but such machines are not available. Modern SIMD processing is mostly done by GPUs. It is also supported by CPUs using SIMD ISA extensions and by adding additional sub components. Chapter 6 — Parallel Processors from Client to Cloud — 2 SIMD Chapter 6 — Parallel Processors from Client to Cloud — 3 SIMD SIMD MIMD Chapter 6 — Parallel Processors from Client to Cloud — 4 Some Applications of SIMD Characteristics of SIMD operations include Multimedia, Communication applications ,graphics and image processing ,video and audio processing ,speech recognition. Can also be used for other data-intensive scientific computations which usually involve 2D array Matrices or more dimensional arrays. Applications can benefit from SIMD processing if they have the following characteristics : floating-point data types Highly repetitive loops frequent additions, multiplications or other simple operations compute-intense algorithms data-parallelism, can operate on independent values in parallel Chapter 6 — Parallel Processors from Client to Cloud — 5 Some Applications of SIMD Chapter 6 — Parallel Processors from Client to Cloud — 6 Some Applications of SIMD Chapter 6 — Parallel Processors from Client to Cloud — 7 History of SIMD : Vector Processors Chapter 6 — Parallel Processors from Client to Cloud — 8 History of SIMD : Vector Processors Chapter 6 — Parallel Processors from Client to Cloud — 9 History of SIMD : Vector Processors Highly pipelined function units Stream data from/to vector registers to units Data collected from memory into registers (Gather) Results stored from registers to memory (Scatter) Example: Vector extension to MIPS 32 × 64-element registers (with 64-bit elements) Vector instructions lv, sv: load/store vector addv.d: add vectors of double addvs.d: add scalar to each element of vector of double Significantly reduces instruction-fetch bandwidth Chapter 6 — Parallel Processors from Client to Cloud — 10 1 1 History of SIMD : Vector Processors •Basic idea: • Read sets of data elements into “vector registers” (Gather) • Operate on those registers • Disperse the results back into memory (Scatter) •Registers are controlled by compiler • Register files act as compiler controlled buffers • Used to hide memory latency • Leverage memory bandwidth •Vector loads/stores deeply pipelined • pay for memory latency once per vector ld/st! •Regular loads/stores • pay for memory latency for each vector element 1 2 Vector Instructions Example Example: DAXPY (Y = a × X + Y) Y=(a × X) + Y where X and Y are vectors of 64 double precision floating-point numbers, initially resident in memory, and a is a scalar double precision variable. (This example is the so-called DAXPY loop that forms the inner loop of the Linpack benchmark; DAXPY stands for double precision a ×X plus Y.). Assume that the starting addresses of X and Y are in $s0 and $s1, respectively. Chapter 6 — Parallel Processors from Client to Cloud — 13 Example: DAXPY (Y = a × X + Y) Conventional MIPS code l.d $f0,a($sp) ;load scalar a addiu r4,$s0,#512 ;upper bound of what to load loop: l.d $f2,0($s0) ;load x(i) mul.d $f2,$f2,$f0 ;a × x(i) l.d $f4,0($s1) ;load y(i) add.d $f4,$f4,$f2 ;a × x(i) + y(i) s.d $f4,0($s1) ;store into y(i) addiu $s0,$s0,#8 ;increment index to x addiu $s1,$s1,#8 ;increment index to y subu $t0,r4,$s0 ;compute bound bne $t0,$zero,loop ;check if done Vector MIPS code l.d $f0,a($sp) ;load scalar a lv $v1,0($s0) ;load vector x mulvs.d $v2,$v1,$f0 ;vector-scalar multiply lv $v3,0($s1) ;load vector y addv.d $v4,$v2,$v3 ;add y to product sv $v4,0($s1) ;store the result Chapter 6 — Parallel Processors from Client to Cloud — 14 Example: DAXPY (Y = a × X + Y) There are some interesting comparisons between the two code segments in this example. The most dramatic is that the vector processor greatly reduces the dynamic instruction bandwidth, executing only 6 instructions versus almost 600 for the traditional MIPS architecture. Chapter 6 — Parallel Processors from Client to Cloud — 15 History of SIMD : Vector Processors Four Vector Lanes Vector vs. Multimedia Extensions Vector units can be combination of pipelined and arrayed functional units. Chapter 6 — Parallel Processors from Client to Cloud — 17 Vector Optimizations Performance Optimizations Increase Memory Bandwidth Memory banks are used to reduce load/store latency Allow multiple simultaneous outstanding memory requests Strip Mining Generates code to allow vector operands whose size is less than or greater than size of vector registers Vector Chaining Equivalent to data forwarding in vector processors, Results of one pipeline are fed into operand registers of another pipeline Chapter 6 — Parallel Processors from Client to Cloud — 18 Vector Optimizations Performance Optimizations Scatter and Gather Retrieves data elements scattered throughout memory and packs them into sequential vectors in vector registers. Promotes data locality. Multiple Parallel Lanes, or Pipes Allows vector operation to be performed in parallel on multiple elements of the vector Chapter 6 — Parallel Processors from Client to Cloud — 19 Vector vs. Scalar Vector architectures and compilers Simplify data-parallel programming Elements within a vector are independent of each other , so don’t need to check for data hazards within a vector. Explicit statement of absence of loop-carried dependences Reduced checking in hardware Regular access patterns benefit from interleaved and burst memory Avoid control hazards by avoiding loops Reduced Code size Require Lower Instruction Bandwith (Reduced by fewer fetches and decodes) More general than ad-hoc media extensions (such as MMX, SSE, AVX,AVX2,AVX512) Chapter 6 — Parallel Processors from Client to Cloud — 20 SIMD Extensions Many MIMD processors today provide the functionality of SIMD processing by adding a few additional hardware units and adding vector extensions to the ISA. Examples are Intel , AMD and ARM processors. ARM NEON is an SIMD co-processor included in Cortex-A8 and Cortex-A9 processors. Chapter 6 — Parallel Processors from Client to Cloud — 21 2 2 SIMD Extensions Floating Point numbers are used extensively for scientific applications. (32 bit, 64 bit) • Also Media applications operate on data types narrower than the native word size: Graphics systems use 8 bits per primary color Audio samples use 8-16 bits 2 3 SIMD Extensions Usually to add SIMD support to standard processors a few more units are added. Vector registers, Floating point units and ALUs that operate on these vector registers are added. 256-bit adder 4 simultaneous operations on 64 bits 8 simultaneous operations on 32 bits 16 simultaneous operations on 16 bits 32 simultaneous operations on 8 bits SIMD Extensions The Intel,AMD x86 has SIMD extensions such as MMX, SSE, AVX,AVX2,AVX512 . The AVX2 has 256 bit vector registers. The latest one is the AVX-512 extension which has 512 bit vector registers. Chapter 6 — Parallel Processors from Client to Cloud — 24 SIMD Extensions SSE instructions: 128-bit operations: 4x32 bits or 2x64 bits (4-wide float vectors) AVX2 instructions: 256 bit operations: 8x32 bits or 4x64 bits (8-wide float vectors) AVX512 instruction: 512 bit operations: 16x32 bits Chapter 6 — Parallel Processors from Client to Cloud — 25 SIMD Extensions Software Programming (Intel,AMD) and ARM both have vectorizing compilers which will compile code using SIMD instructions Many audio/video SIMD libraries available To achieve best performance, custom coding at the assembly level should be used Chapter 6 — Parallel Processors from Client to Cloud — 26 SIMD Extensions Chapter 6 — Parallel Processors from Client to Cloud — 27 SIMD Extensions Instructions are generated by the compiler Parallelism explicitly requested by programmer using intrinsics. Parallelism can be conveyed using parallel language semantics. (Parallel Library support like Intel ISPC (simd compiler)) Parallelism inferred by dependency analysis of loops (hard problem, even best compilers are not great on arbitrary C/C++ code) Terminology: “explicit SIMD”: SIMD parallelization is performed at compile time - Can inspect program binary and see instructions (vstoreps, vmulps, etc.). Chapter 6 — Parallel Processors from Client to Cloud — 28 2 9 SIMD Extensions 3 0 SIMD Extensions 3 1 SIMD Extensions 3 2 SIMD Extensions 3 3 SIMD Extensions : DAXPY •Example DAXPY: L.D F0,a MOV F1, F0 MOV F2, F0 MOV F3, F0 DADDIU R4,Rx,#512 Loop: L.4D F4,0[Rx] MUL.4D F4,F4,F0 L.4D F8,0[Ry] ADD.4D F8,F8,F4 S.4D 0[Ry],F8 DADDIU Rx,Rx,#32 DADDIU Ry,Ry,#32 DSUBU R20,R4,Rx BNEZ R20,Loop ;load scalar a ;copy a into F1 for SIMD MUL ;copy a into F2 for SIMD MUL ;copy a into F3 for SIMD MUL ;last address to load ;load X[i], X[i+1], X[i+2], X[i+3] ;a×X[i],a×X[i+1],a×X[i+2],a×X[i+3] ;load Y[i], Y[i+1], Y[i+2], Y[i+3] ;a×X[i]+Y[i], ..., a×X[i+3]+Y[i+3] ;store into Y[i], Y[i+1], Y[i+2], Y[i+3] ;increment index to X ;increment index to Y ;compute bound ;check if done Vector vs. Multimedia/SIMD Extensions Vector instructions have a variable vector width, multimedia extensions have a fixed width. Vector instructions support strided access, multimedia extensions need all the data to be contiguous but now the AVX 512 extensions has scatter and gather instructions but was introduced with the 2017 intel processors line. As exemplified in the x86, multimedia extensions can be thought of as a vector architecture with short vectors that mostly support only contiguous vector data transfers. Chapter 6 — Parallel Processors from Client to Cloud — 34 Vector vs. Multimedia/SIMD Extensions Unlike multimedia extensions, the number of elements in a vector operation is not in the opcode but in a separate register. In contrast, a new large set of opcodes is added each time the vector length changes in the multimedia extension architecture of the x86: MMX, SSE, SSE2, AVX, AVX2 etc A advantage of multimedia extensions is that it is relatively easy to extend a scalar instruction set architecture with these instructions to improve performance of data parallel operations. Chapter 6 — Parallel Processors from Client to Cloud — 35 3 6 SIMD vs MIMD for x86 Processors •For x86 processors: • Expect two additional cores per chip per year • SIMD width to double every four years GPU Chapter 6 — Parallel Processors from Client to Cloud — 37 Early video cards Frame buffer memory with address generation for video output 3D graphics processing Originally high-end computers (e.g., SGI) Moore’s Law lower cost, higher density 3D graphics cards for PCs and game consoles Graphics Processing Units §6.6 Introduction to Graphics Processing Units History of GPUs Processors oriented to 3D graphics tasks Vertex/pixel processing, shading, texture mapping, rasterization Chapter 6 — Parallel Processors from Client to Cloud — 38 Graphics processors, originally designed to accelerate 3D games, have evolved into highly parallel compute engines for a broad class of applications (mostly SIMD) like: deep learning computer vision scientific computing §6.6 Introduction to Graphics Processing Units History of GPUs Chapter 6 — Parallel Processors from Client to Cloud — 39 GPU: 3D Rendering Chapter 6 — Parallel Processors from Client to Cloud — 40 GPU: 3D Rendering Chapter 6 — Parallel Processors from Client to Cloud — 41 GPU: 3D Rendering Chapter 6 — Parallel Processors from Client to Cloud — 42 GPU: 3D Rendering Chapter 6 — Parallel Processors from Client to Cloud — 43 GPU: 3D Rendering Chapter 6 — Parallel Processors from Client to Cloud — 44 Given the hardware invested to do graphics well, how can be supplement it to improve performance of a wider range of applications? Basic idea: Heterogeneous execution model CPU is the host, GPU is the device Develop a C-like programming language for GPU Unify all forms of GPU parallelism as CUDA thread Programming model is “Single Instruction Multiple Thread” Graphical Processing Units Graphical Processing Units Copyright © 2012, Elsevier Inc. All rights reserved. GPU Architectures Processing is highly data-parallel (SIMD model) GPUs are highly multithreaded Use thread switching to hide memory latency Less reliance on multi-level caches Graphics memory is wide and high-bandwidth Trend toward general purpose GPUs Heterogeneous CPU/GPU systems CPU for sequential code, GPU for parallel code Programming languages/APIs DirectX, OpenGL C for Graphics (Cg), High Level Shader Language (HLSL) Compute Unified Device Architecture (CUDA) for Normal Computation Non-Graphical Applications. Chapter 6 — Parallel Processors from Client to Cloud — 46 GPU Memory Chapter 6 — Parallel Processors from Client to Cloud — 47 GPU SIMD Execution “Implicit SIMD” Compiler generates a scalar binary (scalar instructions) But N instances of the program are *always run* together on the processor, (e.g execute(my_function, N) // execute my_function N times). In other words, the interface to the hardware itself is dataparallel. Hardware (not compiler) is responsible for simultaneously executing the same instruction from multiple instances on different data on SIMD ALUs SIMD width (Vector width) of most modern GPUs ranges from 8 to 32 Branch Divergence can be a big issue (poorly written code might execute at 1/32 the peak capability of the machine!) Chapter 6 — Parallel Processors from Client to Cloud — 48 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 49 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 50 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 51 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 52 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 53 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 54 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 55 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 56 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 57 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 58 GPU Multithreading Chapter 6 — Parallel Processors from Client to Cloud — 59 GPU Multithreading Hardware-supported multi-threading ▪ Core manages execution contexts for multiple threads - Runs instructions from runnable threads (processor makes decision about which thread to run each clock, not the operating system) - Core still has the same number of ALU resources: multithreading only helps use them more efficiently in the face of high-latency operations like memory access Chapter 6 — Parallel Processors from Client to Cloud — 60 GPU used in these slides The main GPU used as a reference for hardware specifications on thread count, register count , simd lanes etc in these slides is the Nvidia Fermi architecture. Chapter 6 — Parallel Processors from Client to Cloud — 61 Nvidia Fermi Architecture Chapter 6 — Parallel Processors from Client to Cloud — 62 Graphical Processing Units Fermi Multithreaded SIMD Processor (SM processor) Copyright © 2012, Elsevier Inc. All rights reserved. This is using Nvidia’s Terminology Graphical Processing Units Fermi Multithreaded SIMD Processor (SM processor) Copyright © 2012, Elsevier Inc. All rights reserved. Each SIMD processor has Graphical Processing Units Fermi Architecture Two SIMD thread schedulers, two instruction dispatch units 16 SIMD lanes per SIMD thread (SIMD width=32, time=2 cycles), 16 load-store units, 4 special function units Thus, two threads of SIMD instructions are scheduled every two clock cycles Fast double precision Caches for GPU memory 64-bit addressing and unified address space Error correcting codes Faster context switching Faster atomic instructions Copyright © 2012, Elsevier Inc. All rights reserved. Fermi SM has 32,768 registers Divided into lanes Each SIMD thread is limited to 64 registers SIMD thread has up to: Graphical Processing Units Multithreaded SIMD Processor (SM): Register count 64 vector registers of 32 32-bit elements 32 vector registers of 32 64-bit elements Fermi has 16 physical SIMD lanes, each containing 2048 registers Copyright © 2012, Elsevier Inc. All rights reserved. A SIMD thread is associated with each vector. SIMD Threads/warps are organized into Thread blocks. Thread Blocks are organized into a Grid GPU hardware handles thread management, not applications or OS Graphical Processing Units Threads and Blocks Copyright © 2012, Elsevier Inc. All rights reserved. Threads of SIMD instructions Each has its own PC Thread scheduler uses scoreboard to dispatch No data dependencies between threads! Keeps track of up to 48 (depending on the GPU architecture) threads of SIMD instructions Hides memory latency Within each SIMD processor: 32 SIMD lanes , Wide and shallow compared to vector processors Graphical Processing Units Threads and Blocks Copyright © 2012, Elsevier Inc. All rights reserved. GPU Schedulers The GPU hardware has two levels of hardware schedulers: 1. The Thread Block Scheduler that assigns blocks of threads to multithreaded SIMD processors (Nvidia Gigathread). 2. The SIMD Thread Scheduler within a SIMD processor (SM), which schedules when SIMD threads (Warp) should run (Warp scheduler). The SIMD instructions of these threads are 32 wide, so each thread of SIMD instructions(called a Warp) would compute 32 of the elements of the computation. Chapter 6 — Parallel Processors from Client to Cloud — 69 Grid, Threadblocks Chapter 6 — Parallel Processors from Client to Cloud — 70 Multithreaded SIMD Processor Simpler Design to illustrate how a SIMD processor layout is Chapter 6 — Parallel Processors from Client to Cloud — 71 SIMD thread scheduler(Warp Scheduler) Fermi SM dual warp schedulers Chapter 6 — Parallel Processors from Client to Cloud — 72 Example The mapping of a Grid (vectorizable loop), Thread Blocks (SIMD basic blocks, also bodys of the loop), and threads of SIMD instructions to a vector to vector multiply, with each vector being 8192 elements long. Each thread of SIMD instructions calculates 32 elements per instruction: 8192/32= 256 SIMD threads (256 Warps) The Fermi has 16 Multithreaded SIMD processors (SMs) : In this example each Thread Block contains 16 threads of SIMD instructions and the Grid contains 16 Thread Blocks. Chapter 6 — Parallel Processors from Client to Cloud — 73 Example The hardware Thread Block Scheduler assigns Thread Blocks to multithreaded SIMD Processors. And the hardware Thread Scheduler picks which thread of SIMD instructions to run each clock cycle within a SIMD Processor. Only SIMD Threads in the same Thread Block can communicate via Local Memory. (The maximum number of SIMD Threads that can execute simultaneously at the same time per Thread Block is 16 for Tesla generation GPUs and 32 for the later Fermi-generation GPUs.) Chapter 6 — Parallel Processors from Client to Cloud — 74 SIMD Thread time (Warp time) The number of lanes per SIMD processor varies across GPU generations. With Fermi, each 32-wide thread of SIMD instructions is mapped to 16 SIMD Lanes, so each SIMD instruction in a thread of SIMD instructions takes two clock cycles to complete. Each thread of SIMD instructions is executed in lock step. Staying with the analogy of a SIMD processor as a vector processor, you could say that it has 16 lanes, and the vector length would be 32. Chapter 6 — Parallel Processors from Client to Cloud — 75 Nvidia Warp Implementation of an SIMD thread = Nvidia Warp. Remember that an SIMD thread works on 32 Vector elements. Nvidia calls this a Warp. Warp: group of 32 CUDA threads executed in parallel, SIMD style called SIMT (Single Instruction, Multiple Thread). Chapter 6 — Parallel Processors from Client to Cloud — 76 Each SIMD Lane(Cuda thread,Core) has private section of off-chip DRAM “Private memory” Contains stack frame, spilling registers, and private variables Each multithreaded SIMD processor also has local memory Shared by SIMD lanes / threads within a block Memory shared by SIMD processors is GPU Memory Host can read and write GPU memory Graphical Processing Units NVIDIA GPU Memory Structures Copyright © 2012, Elsevier Inc. All rights reserved. GPU Memory Structures Book calls it SIMD lane Caches are now available between GPU memory Chapter 6 — Parallel Processors from Client to Cloud — 78 GPU Conditional Branch Chapter 6 — Parallel Processors from Client to Cloud — 79 GPU Conditional Branch Chapter 6 — Parallel Processors from Client to Cloud — 80 GPU Conditional Branch Chapter 6 — Parallel Processors from Client to Cloud — 81 GPU Conditional Branch Chapter 6 — Parallel Processors from Client to Cloud — 82 GPU Conditional Branch Divergence : Depending on the mask values , runs less of the full instruction stream. Convergence : Going back to normal Instruction stream flow. Chapter 6 — Parallel Processors from Client to Cloud — 83 Similarities to vector machines: Works well with data-level parallel problems Scatter-gather transfers Mask registers Large register files Differences: No scalar processor Uses multithreading to hide memory latency Has many functional units, as opposed to a few deeply pipelined units like a vector processor Graphical Processing Units Vector vs GPU Architecture Copyright © 2012, Elsevier Inc. All rights reserved. 8 5 Vector Processors vs. GPU • Loops: • Both rely on independent loop iterations • GPU: • Each iteration becomes a thread on the GPU • Programmer specifies parallelism • grid dimensions and threads/block • Hardware handles parallel execution and thread management • Trick: have 32 threads/block, create many more threads per SIMD multi-processor to hide memory latency 8 6 Vector Processors vs. GPU Conditional Statements • Vector: • mask register part of the architecture • Rely on compiler to manipulate mask register • GPU: • Use hardware to manipulate internal mask registers • Mask register not visible to software • Both spend time to execute masking Gather-Scatter • GPU: • all loads are gathers and stores are scatters • Programmer should make sure that all addresses in a gather or scatter are adjacent locations 8 7 Vector Processors vs. GPU • Multithreading • GPU: yes • Vector: no • Lanes • GPU: 16-32 • A SIMD thread of 32 element wide: 1-2 cycles • Vector 2-8 • Vector length of 32: 4 to 16 cycles •Registers: • GPU (Each SIMD thread): 64 registers with 32 elements • Vector: 8 vector registers with 64 elements • Latency • Vector: deeply pipelined, once per vector load/store • GPU: hides latency with multithreading Putting GPUs into Perspective Feature Multicore with SIMD GPU SIMD processors 4 to 8 8 to 16 SIMD lanes/processor 2 to 4 8 to 16 Multithreading hardware support for SIMD threads 2 to 4 16 to 32 Typical ratio of single precision to double-precision performance 2:1 2:1 Largest cache size 8 MB 0.75 MB Size of memory address 64-bit 64-bit Size of main memory 8 GB to 256 GB 4 GB to 6 GB Memory protection at level of page Yes Yes Demand paging Yes No Integrated scalar processor/SIMD processor Yes No Cache coherent Yes No Chapter 6 — Parallel Processors from Client to Cloud — 88 Guide to GPU Terms We need these to understand the Nvidia GPU diagrams. SIMD Multiprocessor = SM processor (Streaming Multiprocessor). SIMD Lane= SP processor (Streaming Processor, also called thread processor). They also call this the CUDA core. SIMD thread = Warp (Group of 32 threads) run in SIMT. CUDA thread= A Warp is a group of 32 Cuda threads, each cuda thread runs on a SP processor (SIMD lane). Gigathread (Thread block scheduler)= Schedules Thread blocks to run on SM processors. Warp Scheduler (SIMD Thread scheduler) = Schedules Warps to run in the SM processors (SIMD multiprocessor) Chapter 6 — Parallel Processors from Client to Cloud — 89 Guide to GPU Terms Chapter 6 — Parallel Processors from Client to Cloud — 90 ISA is an abstraction of the hardware instruction set “Parallel Thread Execution (PTX)” Uses virtual registers Translation to machine code is performed in software Example: shl.s32 R8, blockIdx, 9 ; Thread Block ID * Block size (512 or 29) add.s32 R8, R8, threadIdx ; R8 = i = my CUDA thread ID ld.global.f64 RD0, [X+R8] ; RD0 = X[i] ld.global.f64 RD2, [Y+R8] ; RD2 = Y[i] mul.f64 R0D, RD0, RD4 ; Product in RD0 = RD0 * RD4 (scalar a) add.f64 R0D, RD0, RD2 ; Sum in RD0 = RD0 + RD2 (Y[i]) st.global.f64 [Y+R8], RD0 ; Y[i] = sum (X[i]*a + Y[i]) Graphical Processing Units NVIDIA Instruction Set Arch. Copyright © 2012, Elsevier Inc. All rights reserved. Nvida GPU Architectures Tesla (2006) Fermi (2010) Kepler (2012) Maxwell (2014) Pascal (2016) Volta (2017) Chapter 6 — Parallel Processors from Client to Cloud — 92 §6.11 Real Stuff: Benchmarking and Rooflines i7 vs. Tesla i7-960 vs. NVIDIA Tesla 280/Fermi 480 Chapter 6 — Parallel Processors from Client to Cloud — 93 Chapter 6 — Parallel Processors from Client to Cloud — 94 Chapter 6 — Parallel Processors from Client to Cloud — 95 Chapter 6 — Parallel Processors from Client to Cloud — 96 Nvidia Volta GV100 Full GPU with 84 SM Units Chapter 6 — Parallel Processors from Client to Cloud — 97 Nvidia Volta 2017 A full GV100 GPU consists of six GPCs, 84 Volta SMs, 42 TPCs (each including two SMs), and eight 512-bit memory controllers (4096 bits total). Each SM has 64 FP32 Cores, 64 INT32 Cores, 32 FP64 Cores, and 8 new Tensor Cores. Each SM also includes four texture units. Chapter 6 — Parallel Processors from Client to Cloud — 98 Nvidia Volta GV100 Streaming Multiprocessor (SM) Chapter 6 — Parallel Processors from Client to Cloud — 99 Nvidia Tesla (CUDA cards) Chapter 6 — Parallel Processors from Client to Cloud — 100 Chapter 6 — Parallel Processors from Client to Cloud — 101 Deep Learning AI Neural Networks Chapter 6 — Parallel Processors from Client to Cloud — 102 Summary : Parallel Execution Chapter 6 — Parallel Processors from Client to Cloud — 103 Additional Topics CUDA Programming Language Chapter 6 — Parallel Processors from Client to Cloud — 104 CUDA Programming language Chapter 6 — Parallel Processors from Client to Cloud — 105 CUDA Programming language Introduced in 2007 with NVIDIA Tesla architecture “C-like” language to express programs that run on GPUs using the compute-mode hardware interface Relatively low-level: CUDA’s abstractions closely match the capabilities/performance characteristics of modern GPUs (design goal: maintain low abstraction distance) OpenCL is an open standards version of CUDA CUDA only runs on NVIDIA GPUs OpenCL runs on CPUs and GPUs from many vendors Almost everything I say about CUDA also holds for OpenCL CUDA is better documented. Chapter 6 — Parallel Processors from Client to Cloud — 106 Cuda Thread Hierarchy Thread – Distributed by the CUDA runtime (identified by threadIdx) Warp – A scheduling unit of up to 32 threads Block – A user defined group of 1 to 512 threads. (identified by blockIdx) Grid – A group of one or more blocks. A grid is created for each CUDA kernel function Chapter 6 — Parallel Processors from Client to Cloud — 108 Chapter 6 — Parallel Processors from Client to Cloud — 109 Chapter 6 — Parallel Processors from Client to Cloud — 110 Chapter 6 — Parallel Processors from Client to Cloud — 111 Chapter 6 — Parallel Processors from Client to Cloud — 112 Chapter 6 — Parallel Processors from Client to Cloud — 113 Chapter 6 — Parallel Processors from Client to Cloud — 114 Chapter 6 — Parallel Processors from Client to Cloud — 115 Chapter 6 — Parallel Processors from Client to Cloud — 116 Chapter 6 — Parallel Processors from Client to Cloud — 117 DAXPY Chapter 6 — Parallel Processors from Client to Cloud — 118 DAXPY Chapter 6 — Parallel Processors from Client to Cloud — 119 Ai Accelerators NPU , TENSOR CORES Chapter 6 — Parallel Processors from Client to Cloud — 120 Difference Between an NPU and a Tensor Core NPUs: Full dedicated processors for neural network inference. Tensor Cores: Specialized units inside NVIDIA GPUs. NPUs focus on low-power, on-device AI tasks. Tensor Cores focus on high-performance AI training and inference. What is an NPU? Neural Processing Unit — entire processor block for AI workloads. Found in smartphones, laptops, IoT, and edge devices. Extremely power-efficient; optimized for real-time tasks. Examples: Apple Neural Engine, Snapdragon Hexagon NPU, Intel VPU, AMD Ryzen AI. What is a Tensor Core? Hardware blocks inside NVIDIA GPUs for tensor/matrix math. Accelerate AI training and inference through fused multiply-accumulate ops. Used in GeForce, RTX, and data-center GPUs. Automatically used by TensorFlow, PyTorch, CUDA libraries. Aspect NPU Tensor Core Type A complete processor A unit inside a GPU Purpose Efficient on-device AI inference High-performance AI training & inference Power Use Very low (milliwatts) High (tens–hundreds of watts) Where Used Phones, laptops, embedded devices Cloud, workstations, gaming GPUs Scalability Limited by device hardware Highly scalable across many GPUs What is a Google TPU? TPU: Tensor Processing Unit — Google's custom AI accelerator. Designed for large-scale deep-learning workloads in cloud data centers. Uses systolic arrays and HBM memory for extreme throughput. Supports TensorFlow natively; PyTorch via PyTorch/XLA. TPU Types and Use Cases Cloud TPU: Used for large model training and massive inference workloads. Edge TPU: Runs TensorFlow Lite INT8 models on embedded devices. Cloud TPUs power models like Gemini, PaLM, and many Google services. Highly scalable through TPU Pods containing thousands of chips. Feature Google TPU Nvidia Tensor Core What it is A complete AI processor A special functional unit inside an NVIDIA GPU Inference strength Excellent for largescale, heavy inference Excellent for general purpose & GPU-based inference Best for Massive cloud workloads Flexible training + inference Deployment Google Cloud datacenters PCs, workstations, data centers
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )