[ROCm][AMD] Enable preshuffled sparse indexing for 16-token blocks (#51216)
Signed-off-by: jamesETsmith <james.smith9113@gmail.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
co-authored by
Andreas Karatzas
parent
83ded8d839
commit
9b0ab5dd53
@@ -35,6 +35,10 @@ from vllm.utils.mem_constants import GiB_bytes
|
|||||||
from vllm.utils.system_utils import update_environment_variables
|
from vllm.utils.system_utils import update_environment_variables
|
||||||
from vllm.utils.torch_utils import set_random_seed
|
from vllm.utils.torch_utils import set_random_seed
|
||||||
from vllm.v1.attention.backend import MultipleOf
|
from vllm.v1.attention.backend import MultipleOf
|
||||||
|
from vllm.v1.attention.backends.mla.indexer import DeepseekV32IndexerBackend
|
||||||
|
from vllm.v1.attention.backends.mla.rocm_aiter_mla_sparse import (
|
||||||
|
ROCMAiterMLASparseBackend,
|
||||||
|
)
|
||||||
from vllm.v1.attention.backends.registry import AttentionBackendEnum
|
from vllm.v1.attention.backends.registry import AttentionBackendEnum
|
||||||
from vllm.v1.core.kv_cache_utils import estimate_max_model_len, get_kv_cache_configs
|
from vllm.v1.core.kv_cache_utils import estimate_max_model_len, get_kv_cache_configs
|
||||||
from vllm.v1.core.sched.output import CachedRequestData, NewRequestData, SchedulerOutput
|
from vllm.v1.core.sched.output import CachedRequestData, NewRequestData, SchedulerOutput
|
||||||
@@ -291,6 +295,16 @@ def test_select_common_block_size_uses_largest_shared_int():
|
|||||||
assert selected_size == 64
|
assert selected_size == 64
|
||||||
|
|
||||||
|
|
||||||
|
def test_select_common_block_size_accepts_rocm_sparse_block_size_16(monkeypatch):
|
||||||
|
monkeypatch.setattr(current_platform, "is_rocm", lambda: True)
|
||||||
|
|
||||||
|
selected_size = select_common_block_size(
|
||||||
|
16,
|
||||||
|
[DeepseekV32IndexerBackend, ROCMAiterMLASparseBackend],
|
||||||
|
)
|
||||||
|
assert selected_size == 16
|
||||||
|
|
||||||
|
|
||||||
def test_reasoning_config_without_custom_logitsprocs_does_not_need_output_token_ids(
|
def test_reasoning_config_without_custom_logitsprocs_does_not_need_output_token_ids(
|
||||||
dist_init,
|
dist_init,
|
||||||
):
|
):
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class DeepseekV32IndexerBackend(AttentionBackend):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_supported_kernel_block_sizes() -> list[int | MultipleOf]:
|
def get_supported_kernel_block_sizes() -> list[int | MultipleOf]:
|
||||||
return [1, 64] if current_platform.is_rocm() else [64]
|
return [1, MultipleOf(16)] if current_platform.is_rocm() else [64]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_supported_head_sizes(cls) -> list[int]:
|
def get_supported_head_sizes(cls) -> list[int]:
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ class ROCMAiterMLASparseBackend(AttentionBackend):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_supported_kernel_block_sizes() -> list[int | MultipleOf]:
|
def get_supported_kernel_block_sizes() -> list[int | MultipleOf]:
|
||||||
return [1, 64]
|
return [1, MultipleOf(16)]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_name() -> str:
|
def get_name() -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user