[CI][Bugfix] Fix ROCm FP8 KV cache dtype in attention backend test (#49380)
Signed-off-by: pei.zhang <pei.zhang@amd.com> Co-authored-by: Claude <noreply@anthropic.com>
peizhang56 committed
Jul 21, 2026 at 18:34 UTC
0500ca6a589b8b85390278ba9d8040663c312760
1 file changed
+5
-2
tests/v1/attention/test_attention_backends.py
+5
-2
@@ -46,9 +46,12 @@ BACKENDS_TO_TEST = [
46
47
DEVICE_TYPE = current_platform.device_type
48
49
+# Use the platform's preferred FP8 type so the stored cache matches what the
50
+# backends reinterpret at runtime. On ROCm gfx94x this is e4m3fnuz, not e4m3fn;
51
+# storing e4m3fn bytes there would be re-read as fnuz and produce NaNs.
52
FP8_KV_CACHE_DTYPES = {
50
- "fp8": torch.float8_e4m3fn,
51
- "fp8_e4m3": torch.float8_e4m3fn,
53
+ "fp8": current_platform.fp8_dtype(),
54
+ "fp8_e4m3": current_platform.fp8_dtype(),
55
}
56
57
# Remove flashinfer from the list if it's not available