Unverified Commit 4492e3a5 authored by Wentao Ye's avatar Wentao Ye Committed by GitHub
Browse files

[Bug] Dynamo Unsupported due to `BasevLLMParameter.torch_function` calling...


[Bug] Dynamo Unsupported due to `BasevLLMParameter.torch_function` calling disabled super() (#25613)
Signed-off-by: default avataryewentao256 <zhyanwentao@126.com>
Signed-off-by: default avatarWentao Ye <44945378+yewentao256@users.noreply.github.com>
Co-authored-by: default avatargemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent 05c19485
...@@ -12,6 +12,7 @@ from torch.nn import Parameter ...@@ -12,6 +12,7 @@ from torch.nn import Parameter
from vllm.distributed import (get_tensor_model_parallel_rank, from vllm.distributed import (get_tensor_model_parallel_rank,
get_tensor_model_parallel_world_size) get_tensor_model_parallel_world_size)
from vllm.logger import init_logger from vllm.logger import init_logger
from vllm.utils import is_torch_equal_or_newer
__all__ = [ __all__ = [
"BasevLLMParameter", "PackedvLLMParameter", "PerTensorScaleParameter", "BasevLLMParameter", "PackedvLLMParameter", "PerTensorScaleParameter",
...@@ -114,6 +115,15 @@ class BasevLLMParameter(Parameter): ...@@ -114,6 +115,15 @@ class BasevLLMParameter(Parameter):
@classmethod @classmethod
def __torch_function__(cls, func, types, args=(), kwargs=None): def __torch_function__(cls, func, types, args=(), kwargs=None):
if not is_torch_equal_or_newer("2.8.0"):
logger.warning_once(
"Torch %s detected (<2.8.0): returning NotImplemented in "
"BasevLLMParameter.__torch_function__ to avoid potential "
"TorchDynamo issues.",
torch.__version__,
)
return NotImplemented
if kwargs is None: if kwargs is None:
kwargs = {} kwargs = {}
return super().__torch_function__(func, types, args, kwargs) return super().__torch_function__(func, types, args, kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment