179 questions
No questions match those filters.
Why is a 7B model slower per token at batch size 32 tha...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansAt batch size 1, generation is primarily memory-bandwidth-bound because each step requires loading model weights and performing a single matrix-vector multiplication. As the batch size increases to 32, the cost of loading weights is amortized across multiple sequences, which is efficient. However, KV cache loading scales linearly with both batch size and sequence length. At large sequence lengths, KV cache reads become the dominant bottleneck, shifting the memory-bound constraint from weight traffic to KV traffic. Furthermore, at high batch sizes with long sequences, the effective arithmetic intensity of the attention operation grows only sublinearly, while the total data movement grows linearly, leading to lower efficiency per token.