[ROCm][CI] Fix order-dependent failure in test_flash_attn_accepts_handled_fp8_variants (MI355) (#49329)

Signed-off-by: Stefan Koncarevic <Stefan.Koncarevic@amd.com>

stefankoncarevic committed Jul 22, 2026 at 01:54 UTC 05781e21dd4af5ed042d4cc19e833a3ee333e92f
1 file changed +5 -2
tests/kernels/attention/test_attention_selector.py
+5 -2
@@ -546,8 +546,11 @@ def test_flash_attn_accepts_handled_fp8_variants(
546 ):
547 """FlashAttentionBackend must accept the two fp8 dtypes it can actually
548 handle: 'fp8' (alias for fp8_e4m3fn) and 'fp8_e4m3'."""
549 - import vllm.v1.attention.backends.flash_attn as fa_mod
549 + import vllm.v1.attention.backends.fa_utils as fa_utils_mod
550 from vllm.v1.attention.backends.flash_attn import FlashAttentionBackend
551
552 - monkeypatch.setattr(fa_mod.current_platform, "is_xpu", lambda: True)
552 + # The fp8 decision is made in fa_utils, using its own current_platform
553 + # binding, so patch is_xpu there (not on flash_attn's) to stay robust to
554 + # import order across earlier tests that patch vllm.platforms.current_platform.
555 + monkeypatch.setattr(fa_utils_mod.current_platform, "is_xpu", lambda: True)
556 assert FlashAttentionBackend.supports_kv_cache_dtype(kv_cache_dtype)