[ROCM][CI] Attention test speedup (#52763)

Signed-off-by: Stefan Koncarevic <stefan.koncarevic@amd.com>
This commit is contained in:
stefankoncarevic
2026-08-18 16:40:30 -05:00
committed by GitHub
parent 5d8a4cf976
commit 6066bb3d50
9 changed files with 24 additions and 6 deletions
@@ -14,6 +14,8 @@ from vllm.platforms import current_platform
from vllm.utils.mem_utils import get_max_shared_memory_bytes
from vllm.utils.torch_utils import set_random_seed
pytestmark = pytest.mark.skip_global_cleanup
FLOAT32_BYTES = torch.finfo(torch.float).bits // 8
# This will change depending on the compute capability.
# - 512 as a buffer
+2
View File
@@ -12,6 +12,8 @@ from vllm.model_executor.layers.quantization.utils.quant_utils import scaled_deq
from vllm.platforms import current_platform
from vllm.utils.torch_utils import nvfp4_split_data_scale, set_random_seed
pytestmark = pytest.mark.skip_global_cleanup
COPYING_DIRECTION = [("cuda", "cpu"), ("cuda", "cuda"), ("cpu", "cuda")]
DTYPES = [torch.bfloat16, torch.float]
NUM_TOKENS = [42] # Arbitrary values for testing
@@ -11,6 +11,8 @@ from vllm.platforms import current_platform
from vllm.triton_utils import triton
from vllm.utils.platform_utils import num_compute_units
pytestmark = pytest.mark.skip_global_cleanup
def cal_diff(
x: torch.Tensor,
+2
View File
@@ -16,6 +16,8 @@ from vllm.v1.attention.ops.flashmla import (
is_flashmla_dense_supported,
)
pytestmark = pytest.mark.skip_global_cleanup
def cal_diff(
x: torch.Tensor, y: torch.Tensor, name: str, use_fp8: bool = False
@@ -15,6 +15,14 @@ from vllm.v1.attention.ops.triton_merge_attn_states import (
merge_attn_states as merge_attn_states_triton,
)
pytestmark = [
pytest.mark.skip_global_cleanup,
pytest.mark.skipif(
not current_platform.is_cuda_alike(),
reason="merge_attn_states kernels require CUDA or ROCm.",
),
]
# Naive PyTorch Implements section 2.2 of https://www.arxiv.org/pdf/2501.01005
# can be used to combine partial attention results (in the split-KV case)
@@ -153,12 +161,6 @@ def test_merge_attn_states(
input_dtype: torch.dtype,
use_fp8: bool,
):
if not current_platform.is_cuda():
pytest.skip(
"Currently only support compare triton merge_attn_states "
"with custom cuda merge_attn_states kernel"
)
NUM_TOKENS = num_tokens
NUM_HEADS = num_query_heads
HEAD_SIZE = head_size
@@ -17,6 +17,8 @@ from vllm.v1.attention.ops.chunked_prefill_paged_decode import (
)
from vllm.v1.attention.ops.prefix_prefill import context_attention_fwd
pytestmark = pytest.mark.skip_global_cleanup
NUM_HEADS = [64]
NUM_QUERIES_PER_KV = [1, 64]
HEAD_SIZES = [24, 128]
@@ -8,6 +8,8 @@ from vllm.platforms import current_platform
from vllm.utils.math_utils import cdiv
from vllm.v1.attention.ops.triton_decode_attention import decode_attention_fwd
pytestmark = pytest.mark.skip_global_cleanup
DEVICE_TYPE = current_platform.device_type
@@ -11,6 +11,8 @@ from vllm.utils.torch_utils import set_random_seed
from vllm.v1.attention.ops.triton_unified_attention import unified_attention
from vllm.v1.kv_cache_interface import KVQuantMode
pytestmark = pytest.mark.skip_global_cleanup
DEVICE_TYPE = current_platform.device_type
NUM_HEADS = [(4, 4), (8, 2), (5, 1)]
@@ -21,6 +21,8 @@ from vllm.v1.attention.ops.triton_unified_attention_diffkv import (
unified_attention_diffkv,
)
pytestmark = pytest.mark.skip_global_cleanup
DEVICE_TYPE = current_platform.device_type
# (num_query_heads, num_kv_heads): MHA, GQA, and the num_kv_heads==1