Multi-query attention (Shazeer, 2019) shares a single key and value head across all query heads. The query heads still differ, but the cache that decoding must read is much smaller, which speeds up incremental generation.
Implement kv_cache_elems(layers, kv_heads, seq, d_head), counting the cached key and value elements.
kv_heads is 1.Multiply the two (keys and values) by the layers, kv heads, sequence length and head dimension.
No results yet
Run your code to check it against the examples, or submit to run every test.