Comment on

<- View Parent
TehPers@beehaw.org ⁨2⁩ ⁨days⁩ ago

To be more specific here, GPUs are really, really good at linear algebra. They multiply matrices and vectors as single operations. CPUs can often do some SIMD operations, but not nearly as well or as many.

Video games do a lot of LA in order to render scenes. At the bare minimum, each model vertex is being multiplied by matrices to convert from world space to screen space, clip space, NDC, etc which are calculated based on the properties of your camera and projection type.

ML also does a lot of LA. Neural nets, for example. are literally a sequence of matrix multiplications. A very simple neural net works by taking a vector representing an input (or matrix for multiple inputs), multiplies that by a matrix representing a node’s weights, then passes the result to an activation function. Then does that a bunch more times.

Both functions want GPUs, but both need different things from it. AI wants GPUs with huge amounts of memory (for these huge models) which are optimized for data center usage (using cooling designed for racks). Games want GPUs that don’t need to have terabytes of VRAM, but which should be fast at calculating, fast at transferring data between CPU and GPU, and capable of running many shader programs in parallel (so that you can render more pixels at a time, for example).

source
Sort:hotnewtop