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 5, 21:00 UTC
[Misc] Always use `forward_mulmat` for `Conv3d` on newer versions of torch. (#38487)
Roger Wang committed
Mar 29, 2026 at 22:39 UTC
92f0db57a88161af6e76728e5f552a24e6955569
1 file changed
+4
-3
vllm/model_executor/layers/conv.py
+4
-3
@@ -10,7 +10,7 @@ import torch.nn as nn
10
import torch.nn.functional as F
11
12
from vllm.model_executor.custom_op import CustomOp
13
-from vllm.utils.torch_utils import is_torch_equal
13
+from vllm.utils.torch_utils import is_torch_equal_or_newer
14
15
16
class ConvLayerBase(CustomOp):
@@ -252,11 +252,12 @@ class Conv3dLayer(ConvLayerBase):
252
return self._forward_conv(x)
253
254
def forward_cuda(self, x: torch.Tensor) -> torch.Tensor:
255
- # PyTorch2.9.0 disabled CUDNN's Conv3D, which caused a
255
+ # PyTorch 2.9.0+ disabled CUDNN's Conv3D, which caused a
256
# significant performance regression.
257
# See: https://github.com/vllm-project/vllm/issues/27406
258
# and https://github.com/pytorch/pytorch/issues/166122
259
+ # and https://github.com/huggingface/transformers/pull/45041
260
# By default, we use CUDNN's convolution ops with optimization.
260
- if self.enable_linear and (is_torch_equal("2.9.0") or is_torch_equal("2.9.1")):
261
+ if self.enable_linear and is_torch_equal_or_newer("2.9.0"):
262
return self._forward_mulmat(x)
263
return self._forward_conv(x)