4 ms·
Why are GPUs well-suited for deep learning? (2016)
- extasia 3y agoBecause DL is 90% Matrix multiplication?
- blowski 3y agoWhich begs the question… why are GPUs good at matrix multiplication?
- NikkiA 3y agoBecause 3d graphics are mostly matrix multiplications.
- vorticalbox 3y agoThis is like saying "cars are fast because cars are good at going fast"
- blowski 3y agoI guess it's like "cars are fast because they use similar engines to motorbikes, which also go fast". Technically correct, but doesn't really provide any useful information we can learn from.
- flohofwoe 3y agoGPUs haven't been developed in a vacuum, they were mostly created to accelerate rendering for 3D games, and 3D rendering is mostly about vector operations in up to 4 dimensions (to process points and vectors in 3D space, and pixels in an RGB+transparency 'color space'). The other interesting property of 3D rendering is that it is an 'embarrassingly parallel' problem. Vertices or pixels (mostly) don't depend on each other, so the GPU can process them in parallel. That's how GPUs turned over time into big arrays of very simple cores which are good at running a huge number of vector operations in parallel.
- throwawaymaths 3y agoThey're actually kind of not, but they're good at vector multiplication. Matrix multiplication is just stacked vector multiplication, so GPUs are okay at matrix multiplication (but not as good as one could imagine they could be). I think TPUs were the first thing really designed to do matrix multiplication
- dragontamer 3y agoBecause matrix multiplication parallelizes easily. 1. Matrix Multiplication caches easily: you can program the data-fetches to occur in blocks and recycle your memory-fetches across a huge number of operations. 2. Matrix Multiplication is innately parallel, with every square of the output matrix possibly computed in parallel. ----------- That being said: GPUs are not the best at this. Systolic processors are the best matrix multipliers and that's where NVidia Tensor Cores and/or Google TPUs come in. ------------ GPU / SIMD architecture was chosen for GPUs because video games have a large number of 4x4 matrix multiplications per frame. Every single vertex, of which a typical video game could have ~100 million vertexes, needs to be 4x4 matrix multiplied to determine where on the screen it has moved. GPUs need to perform this operation at 60 FPS for video gamers to be pleased, though some video gamers demand 120 FPS or even 200+ FPS. 4x4 is the operation of an affine transformation in 3d space (translation, rotation, scaling, etc. etc.). Most commonly for 'camera movement'. (Player moved to the right 5 ticks and then looked to the north-west by 27 degrees, where should all the objects in the screen move to? This is solved by matrix-multiplying all 100-million verticies with the camera-position matrix) 4x4 Matrix Multiplication isn't quite big enough to "deserve" a systolic processor yet.
- ThemalSpan 3y agoFirst paragraph of the article: "As many have said GPUs are so fast because they are so efficient for matrix multiplication and convolution, but nobody gave a real explanation for why this is so. The real reason for this is memory bandwidth and not necessarily parallelism."
- colordrops 3y agoPerhaps the deeper question is why both visual representation and deep learning both rely heavily on matrix multiplication.
- pazimzadeh 3y agoWhat part of visual representation is the most graphics intensive? The least?
- flohofwoe 3y agoOne part is vertex transformation which transforms 3D points into the 2D screen space, the other is computing the per-pixel colors. Both work on 4D vector data though. Early GPUs had different processing units for vertex and pixel "shading", but over time those have merged into generic cores which can be dynamically assigned to vertex-, pixel- or 'compute'-tasks.
- throwawaymaths 3y agoMatrices are just tabulated numbers dude.
- dragontamer 3y agoBecause 4x4 Matrixes are a linear transformation of 3 dimensional space. Deep Learning chose TPUs / Tensors because GPUs (and other computers) are faster at matrix multiplication than any other operation. Many many other representations of neural networks have existed over the decades, its the matrix-based "Tensor" that performed the best and took off.
- casualscience 3y agoYes, and graphics cards are optimized to do matrix multiplications because most of what they do is projective geometry.
- tracerbulletx 3y agoThe top answer is very good, it's a shame it's entombed in the eternally dank and odorous depths of Quora.
- dang 3y agoThe submitter linked to the top comment but our software changed the URL to the canonical URL listed there (see https://news.ycombinator.com/item?id=37368412 https://news.ycombinator.com/item?id=37368412 for a similar case). I thought I'd modified the code to stop doing that in these cases but maybe this submission preceded that.
- rdedev 3y agoIs there a place where I can learn more about GPU hardware and programming? I've not been able to find a good introductory course in it yet
- GaryNumanVevo 3y ago"The CUDA Handbook" does a great job introducing GPU programming and explaining the hardware capabilities of GPUs
- dang 3y agoAnybody know how to figure out the year?
- Waterluvian 3y agoThe oldest “share” is listed as “3y”. Gracious. Put a stamp on posts, Quora!
- gabereiser 3y ago5y actually
- Waterluvian 3y agoI went back to check and it won’t even load for me now XD.
- dang 3y agoBetween that and blocking archive.org, they're...up there on a list of baddies.
- banana_giraffe 3y agoThere's some metadata on the page of "creationTime": 1460051640789448, or Thursday, April 7, 2016 5:54:00.789 PM
- dang 3y agoWell done! Let's use that.
- slowhadoken 3y agoBecause they’re expensive. Jk
- deleted 3y ago[deleted]
- blowski 3y agoThis is how I've understood it - and I'm clueless at both processor architecture and deep learning, so assume I'm wrong. If you ask "why are GPUs better suited than CPU s?" then it's because CPUs are more general purpose, and need to handle branching, task-switching, IO. For rendering graphics, GPUs need to apply the same set of instructions to multiple pixels and vectors, so they use a "single instruction, multiple threads" architecture. They apply the same operation to different data, which allows them to do this in parallel, so they can have a lot of ALUs. And this SIMT architecture is also really good for matrix multiplication. Many of the features that make CPUs fast - caching, pipelining - wouldn't work with SIMT.
- SilverBirch 3y agoJust a nit pick, generally we refer to it as SIMD - Single instruction multiple data[1]. In reality today most CPUs have vector processing instructions and GPUs have lots of groups of SIMD units so both CPUs and GPUs are MIMD, GPUs are just much further along on the Instruction:Data ratio. [1]:https://en.wikipedia.org/wiki/Flynn%27s_taxonomy https://en.wikipedia.org/wiki/Flynn%27s_taxonomy
- dragontamer 3y agoI'm pretty sure modern GPUs are pipelined and cached. The important tidbit is that CPUs find parallelism where the programmers didn't specify any. CPUs are "out of order" machines, spending a fair amount of energy and internal storage (the ROB / reorder buffer) to execute out-of-order, and then place all the results back in order before the programmer notices. GPUs, instead of being configured to find parallelism, innately assume that the programmer laid out parallelism for it ahead of time. GPUs can only work with a massively parallel language (OpenCL, DirectX HLSL, or CUDA) specifying thousands of parallel work units per line.