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 14, 05:30 UTC
[Bug] Dynamo Unsupported due to `BasevLLMParameter.torch_function` calling disabled super() (#25613)
Signed-off-by: yewentao256 <zhyanwentao@126.com> Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Wentao Ye committed
Sep 24, 2025 at 21:52 UTC
4492e3a55428e161ca8db381edc28263e5da4c8d
1 file changed
+10
vllm/model_executor/parameter.py
+10
@@ -12,6 +12,7 @@ from torch.nn import Parameter
12
from vllm.distributed import (get_tensor_model_parallel_rank,
13
get_tensor_model_parallel_world_size)
14
from vllm.logger import init_logger
15
+from vllm.utils import is_torch_equal_or_newer
16
17
__all__ = [
18
"BasevLLMParameter", "PackedvLLMParameter", "PerTensorScaleParameter",
@@ -114,6 +115,15 @@ class BasevLLMParameter(Parameter):
115
116
@classmethod
117
def __torch_function__(cls, func, types, args=(), kwargs=None):
118
+ if not is_torch_equal_or_newer("2.8.0"):
119
+ logger.warning_once(
120
+ "Torch %s detected (<2.8.0): returning NotImplemented in "
121
+ "BasevLLMParameter.__torch_function__ to avoid potential "
122
+ "TorchDynamo issues.",
123
+ torch.__version__,
124
+ )
125
+ return NotImplemented
126
+
127
if kwargs is None:
128
kwargs = {}
129
return super().__torch_function__(func, types, args, kwargs)