Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
92f0db57
Unverified
Commit
92f0db57
authored
Mar 29, 2026
by
Roger Wang
Committed by
GitHub
Mar 30, 2026
Browse files
[Misc] Always use `forward_mulmat` for `Conv3d` on newer versions of torch. (#38487)
parent
bea23536
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
vllm/model_executor/layers/conv.py
vllm/model_executor/layers/conv.py
+4
-3
No files found.
vllm/model_executor/layers/conv.py
View file @
92f0db57
...
@@ -10,7 +10,7 @@ import torch.nn as nn
...
@@ -10,7 +10,7 @@ import torch.nn as nn
import
torch.nn.functional
as
F
import
torch.nn.functional
as
F
from
vllm.model_executor.custom_op
import
CustomOp
from
vllm.model_executor.custom_op
import
CustomOp
from
vllm.utils.torch_utils
import
is_torch_equal
from
vllm.utils.torch_utils
import
is_torch_equal
_or_newer
class
ConvLayerBase
(
CustomOp
):
class
ConvLayerBase
(
CustomOp
):
...
@@ -252,11 +252,12 @@ class Conv3dLayer(ConvLayerBase):
...
@@ -252,11 +252,12 @@ class Conv3dLayer(ConvLayerBase):
return
self
.
_forward_conv
(
x
)
return
self
.
_forward_conv
(
x
)
def
forward_cuda
(
self
,
x
:
torch
.
Tensor
)
->
torch
.
Tensor
:
def
forward_cuda
(
self
,
x
:
torch
.
Tensor
)
->
torch
.
Tensor
:
# PyTorch2.9.0 disabled CUDNN's Conv3D, which caused a
# PyTorch
2.9.0
+
disabled CUDNN's Conv3D, which caused a
# significant performance regression.
# significant performance regression.
# See: https://github.com/vllm-project/vllm/issues/27406
# See: https://github.com/vllm-project/vllm/issues/27406
# and https://github.com/pytorch/pytorch/issues/166122
# and https://github.com/pytorch/pytorch/issues/166122
# and https://github.com/huggingface/transformers/pull/45041
# By default, we use CUDNN's convolution ops with optimization.
# By default, we use CUDNN's convolution ops with optimization.
if
self
.
enable_linear
and
(
is_torch_equal
(
"2.9.0"
)
or
is_torch_equal
(
"2.9.
1"
)
):
if
self
.
enable_linear
and
is_torch_equal
_or_newer
(
"2.9.
0"
):
return
self
.
_forward_mulmat
(
x
)
return
self
.
_forward_mulmat
(
x
)
return
self
.
_forward_conv
(
x
)
return
self
.
_forward_conv
(
x
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment