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 4, 10:00 UTC
[ROCm][CI] Add ROCm score absolute tolerance floor (#41341)
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Andreas Karatzas committed
Apr 30, 2026 at 20:59 UTC
1adaa5056b0e1b7ce9918d30baa5c7b8b7d86e0d
1 file changed
+17
-3
tests/entrypoints/pooling/scoring/test_cross_encoder_online_vision.py
+17
-3
@@ -38,6 +38,15 @@ BACKEND_TOL: dict[str, float] = {
38
"FLEX_ATTENTION": 0.045, # gfx950:~3.25%, gfx942:~1.10%
39
}
40
41
+# ROCm 7.2/gfx950 shows small absolute drift on the low text-vs-text
42
+# probability even though larger scores remain well inside the relative
43
+# tolerance. Keep the relative tolerances tight and add only a small floor.
44
+BACKEND_ABS_TOL: dict[str, float] = {
45
+ "default": 0.0,
46
+ "ROCM_AITER_FA": 0.005,
47
+ "FLEX_ATTENTION": 0.006,
48
+}
49
+
50
# ROCm: disable skinny GEMM to avoid non-deterministic results from
51
# atomic reductions in wvSplitKrc kernel.
52
# See: https://github.com/vllm-project/vllm/pull/33493#issuecomment-3906083975
@@ -57,18 +66,23 @@ def get_tol(backend: str) -> float:
66
return BACKEND_TOL.get(backend, BACKEND_TOL["default"])
67
68
69
+def get_abs_tol(backend: str) -> float:
70
+ return BACKEND_ABS_TOL.get(backend, BACKEND_ABS_TOL["default"])
71
+
72
+
73
def assert_score(actual: float, expected: float, backend: str, label: str):
74
tol = get_tol(backend)
75
+ abs_tol = get_abs_tol(backend)
76
diff = abs(actual - expected)
77
rel_diff = diff / abs(expected) if expected != 0 else diff
78
print(
79
f"[{backend}] {label}: actual={actual:.6f} expected={expected:.6f} "
66
- f"diff={diff:.6f} rel_diff={rel_diff:.4f} tol={tol}"
80
+ f"diff={diff:.6f} rel_diff={rel_diff:.4f} tol={tol} abs_tol={abs_tol}"
81
)
68
- assert actual == pytest.approx(expected, rel=tol), (
82
+ assert actual == pytest.approx(expected, rel=tol, abs=abs_tol), (
83
f"[{backend}] {label}: score mismatch — "
84
f"actual={actual:.6f}, expected={expected:.6f}, "
71
- f"rel_diff={rel_diff:.4f}, tol={tol}"
85
+ f"rel_diff={rel_diff:.4f}, tol={tol}, abs_tol={abs_tol}"
86
)
87
88