[6/N][KV-Cache Layout Refactor] Standardize KV cache layout (#51718)
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
This commit is contained in:
@@ -310,18 +310,23 @@ def test_aiter_mha_backend_contract():
|
||||
|
||||
|
||||
def test_aiter_mha_backend_validates_kv_cache_block_size():
|
||||
"""The backend should reject KV cache shapes that cannot be gathered
|
||||
"""The backend should reject KV cache specs that cannot be gathered
|
||||
correctly by the ROCm kernel."""
|
||||
from vllm.v1.attention.backends.rocm_aiter_fa import AiterFlashAttentionBackend
|
||||
from vllm.v1.kv_cache_interface import FullAttentionSpec
|
||||
|
||||
assert AiterFlashAttentionBackend.get_kv_cache_shape(8, 16, 8, 128) == (
|
||||
8,
|
||||
8,
|
||||
16,
|
||||
256,
|
||||
)
|
||||
with pytest.raises(ValueError, match="Block size must be a multiple of 16"):
|
||||
AiterFlashAttentionBackend.get_kv_cache_shape(8, 15, 8, 128)
|
||||
AiterFlashAttentionBackend.customize_spec(
|
||||
FullAttentionSpec(
|
||||
block_size=15, num_kv_heads=8, head_size=128, dtype=torch.bfloat16
|
||||
)
|
||||
)
|
||||
# block_size == 1 is the per-token page-size probe and must pass through.
|
||||
AiterFlashAttentionBackend.customize_spec(
|
||||
FullAttentionSpec(
|
||||
block_size=1, num_kv_heads=8, head_size=128, dtype=torch.bfloat16
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def test_aiter_mha_backend_supports_compute_capability_matches_mi3xx_probe():
|
||||
|
||||
Reference in New Issue
Block a user