by southp · 1y ago · 0 comments
I find the model to be extremely simple, you can write the attention equation on a napkin.
This is the core idea:
Attention(Q, K, V) = softmax(Q * K^T / sqrt(d_k)) * V
The attention process itself is based on all-to-all similarity calculation Q * K
Having said it's interesting to point out that the modules are what allow CPU offload. It's fairly common to run some parts on the CPU and others on the GPU/NPU/TPU depending on your configuration. This has some performance costs but allows more flexibility.
Its already possible to run an LLM off chips, of course depending on the LLM and the chip.