A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 10, 19:00 UTC
[ROCm][CI] Fix language generation test accuracy by disabling HF flash_sdp and mem_efficient_sdp (#31597)
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Andreas Karatzas committed
Jan 4, 2026 at 20:17 UTC
f2b6dfd237b1e9ba931121c6e83b6a4a3eb47680
1 file changed
+28
tests/models/language/generation/conftest.py
new
+28
@@ -0,0 +1,28 @@
1
+# SPDX-License-Identifier: Apache-2.0
2
+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+"""Pytest configuration for vLLM language generation tests."""
4
+
5
+import warnings
6
+
7
+import torch
8
+
9
+from vllm.platforms import current_platform
10
+
11
+
12
+def pytest_sessionstart(session):
13
+ """Configure ROCm-specific settings before test session starts."""
14
+ if not current_platform.is_rocm():
15
+ return
16
+
17
+ # Disable Flash/MemEfficient SDP on ROCm to avoid HF Transformers
18
+ # accuracy issues: https://github.com/vllm-project/vllm/issues/30167
19
+ # TODO: Remove once ROCm SDP accuracy issues are resolved on HuggingFace
20
+ torch.backends.cuda.enable_flash_sdp(False)
21
+ torch.backends.cuda.enable_mem_efficient_sdp(False)
22
+ torch.backends.cuda.enable_math_sdp(True)
23
+ warnings.warn(
24
+ "ROCm: Disabled flash_sdp and mem_efficient_sdp, enabled math_sdp "
25
+ "to avoid HuggingFace Transformers accuracy issues",
26
+ UserWarning,
27
+ stacklevel=1,
28
+ )