diff --git a/tests/distributed/test_pp_cudagraph.py b/tests/distributed/test_pp_cudagraph.py index 34ae305c2d..2f0fc9a1b5 100644 --- a/tests/distributed/test_pp_cudagraph.py +++ b/tests/distributed/test_pp_cudagraph.py @@ -1,7 +1,8 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project import pytest -from typing_extensions import LiteralString + +from vllm.platforms import current_platform from ..utils import compare_two_settings, create_new_process_for_each_test @@ -14,15 +15,13 @@ from ..utils import compare_two_settings, create_new_process_for_each_test ) @pytest.mark.parametrize( "ATTN_BACKEND", - [ - "FLASH_ATTN", - ], + [None] if current_platform.is_rocm() else ["FLASH_ATTN"], ) @create_new_process_for_each_test() def test_pp_cudagraph( PP_SIZE: int, MODEL_NAME: str, - ATTN_BACKEND: LiteralString, + ATTN_BACKEND: str | None, ): cudagraph_args = [ # use half precision for speed and memory savings in CI environment @@ -32,8 +31,10 @@ def test_pp_cudagraph( str(PP_SIZE), "--distributed-executor-backend", "mp", - f"--attention-backend={ATTN_BACKEND}", ] + # On ROCm, defer to the platform attention selector instead of forcing a backend. + if ATTN_BACKEND is not None: + cudagraph_args.append(f"--attention-backend={ATTN_BACKEND}") eager_args = cudagraph_args + ["--enforce-eager"]