News for hackers. Stuff that matters.
Re:DeepSeek's multi-head latent attention and other KV cache... by t55 on Tuesday January 28, 2025 @09:11PM (#42860693)
It’s mostly a convention. In many deep learning frameworks (PyTorch, TensorFlow, etc.), inputs are stored with the “batch × length × hidden-dim” shape, effectively making the token embeddings row vectors. Multiplying “xW” is then the natural shape-wise operation. On the other hand, classical linear algebra references often treat vectors as column vectors and write “Wx.”
Re:DeepSeek's multi-head latent attention and other KV cache... by anvuong on Tuesday January 28, 2025 @09:49PM (#42860938)
Isn't batch-first a Pytorch thing? I started with Tensorflow and it's batch-last.
Re:DeepSeek's multi-head latent attention and other KV cache... by t55 on Wednesday January 29, 2025 @05:34AM (#42863501)
TFv1 or TFv2? AFAIK it's batch-first in TFv2