Skip to content

Commit f08eefd

Browse files
authored
fix gemma3 results all zero
1 parent 97cc872 commit f08eefd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vllm/model_executor/layers/layernorm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ def forward_static(
241241
"""PyTorch-native implementation equivalent to forward()."""
242242
orig_dtype = x.dtype
243243
if residual is not None:
244-
x = x + residual
244+
if orig_dtype == torch.float16:
245+
x = x + residual.float()
246+
else:
247+
x = x + residual
245248
residual = x
246249

247250
x = x.float()

0 commit comments

Comments
 (0)