From 0500ca6a589b8b85390278ba9d8040663c312760 Mon Sep 17 00:00:00 2001 From: peizhang56 Date: Tue, 21 Jul 2026 18:34:49 -0700 Subject: [PATCH] [CI][Bugfix] Fix ROCm FP8 KV cache dtype in attention backend test (#49380) Signed-off-by: pei.zhang Co-authored-by: Claude --- tests/v1/attention/test_attention_backends.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/v1/attention/test_attention_backends.py b/tests/v1/attention/test_attention_backends.py index b190433b25..87a9c80942 100644 --- a/tests/v1/attention/test_attention_backends.py +++ b/tests/v1/attention/test_attention_backends.py @@ -46,9 +46,12 @@ BACKENDS_TO_TEST = [ DEVICE_TYPE = current_platform.device_type +# Use the platform's preferred FP8 type so the stored cache matches what the +# backends reinterpret at runtime. On ROCm gfx94x this is e4m3fnuz, not e4m3fn; +# storing e4m3fn bytes there would be re-read as fnuz and produce NaNs. FP8_KV_CACHE_DTYPES = { - "fp8": torch.float8_e4m3fn, - "fp8_e4m3": torch.float8_e4m3fn, + "fp8": current_platform.fp8_dtype(), + "fp8_e4m3": current_platform.fp8_dtype(), } # Remove flashinfer from the list if it's not available