Skip to content

Fix launch error under Pytorch 2.6#595

Merged
tjtanaavllm merged 1 commit into
ROCm:deepseek_085from
lejunzhu-amd:deepseek_085
Jul 16, 2025
Merged

Fix launch error under Pytorch 2.6#595
tjtanaavllm merged 1 commit into
ROCm:deepseek_085from
lejunzhu-amd:deepseek_085

Conversation

@lejunzhu-amd

@lejunzhu-amd lejunzhu-amd commented Jul 16, 2025

Copy link
Copy Markdown

When launching vllm in Pytorch 2.6 environment, the following error occurs:

...
File "/opt/vllm/vllm/utils.py", line 2278, in direct_register_custom_op
  schema_str = torch.library.infer_schema(op_func,
...
ValueError: infer_schema(func): Parameter block_shape has unsupported type typing.Optional[list[int]]. The valid types are: dict_keys([<class 'torch.Tensor'>, typing.Optional[torch.Tensor], typing.Sequence[torch.Tensor], typing.List[torch.Tensor], typing.Sequence[typing.Optional[torch.Tensor]], typing.List[typing.Optional[torch.Tensor]], <class 'int'>, typing.Optional[int], typing.Sequence[int], typing.List[int], typing.Optional[typing.Sequence[int]], typing.Optional[typing.List[int]], <class 'float'>, typing.Optional[float], typing.Sequence[float], typing.List[float], typing.Optional[typing.Sequence[float]], typing.Optional[typing.List[float]], <class 'bool'>, typing.Optional[bool], typing.Sequence[bool], typing.List[bool], typing.Optional[typing.Sequence[bool]], typing.Optional[typing.List[bool]], <class 'str'>, typing.Optional[str], typing.Union[int, float, bool], typing.Union[int, float, bool, NoneType], typing.Sequence[typing.Union[int, float, bool]], typing.List[typing.Union[int, float, bool]], <class 'torch.dtype'>, typing.Optional[torch.dtype], <class 'torch.device'>, typing.Optional[torch.device]]). Got func with signature (hidden_states: torch.Tensor, w1: torch.Tensor, w2: torch.Tensor, topk_weights: torch.Tensor, topk_ids: torch.Tensor, fc1_scale: Optional[torch.Tensor] = None, fc2_scale: Optional[torch.Tensor] = None, fc1_smooth_scale: Optional[torch.Tensor] = None, fc2_smooth_scale: Optional[torch.Tensor] = None, a16: bool = False, per_tensor_quant_scale: Optional[torch.Tensor] = None, block_shape: Optional[list[int]] = None, expert_mask: Optional[torch.Tensor] = None, activation_method: int = 0) -> torch.Tensor)

Fix it by replacing list[int] with typing.List[int] in the custom registered ops.

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@tjtanaavllm tjtanaavllm merged commit 9a3171b into ROCm:deepseek_085 Jul 16, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants