From e1eefa4c40fc5b28bd7e83b6596bb5d2f420fd92 Mon Sep 17 00:00:00 2001 From: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Date: Thu, 20 Nov 2025 20:54:59 -0500 Subject: [PATCH] [Bug] Fix torch warning of tf32 usage (#29112) Signed-off-by: yewentao256 --- vllm/model_executor/layers/batch_invariant.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vllm/model_executor/layers/batch_invariant.py b/vllm/model_executor/layers/batch_invariant.py index 69fa6bdffd43f..bec7af0286345 100644 --- a/vllm/model_executor/layers/batch_invariant.py +++ b/vllm/model_executor/layers/batch_invariant.py @@ -852,5 +852,6 @@ def init_batch_invariance(): enable_batch_invariant_mode() # Disable TF32 for batch invariance - it causes non-deterministic rounding - torch.backends.cuda.matmul.allow_tf32 = False - torch.backends.cudnn.allow_tf32 = False + torch.backends.cuda.matmul.fp32_precision = "ieee" + torch.backends.cudnn.conv.fp32_precision = "ieee" + torch.backends.cudnn.rnn.fp32_precision = "ieee"