Quick Fix: fix Qwen3-VL launch failure caused by MRotaryEmbedding arg (#10985)

This commit is contained in:
yhyang201
2025-09-30 22:17:05 -07:00
committed by GitHub
parent a9ce2bcb3c
commit 6130529143
2 changed files with 14 additions and 2 deletions
@@ -1065,6 +1065,7 @@ class MRotaryEmbedding(RotaryEmbedding):
positions: torch.Tensor,
query: torch.Tensor,
key: torch.Tensor,
fused_set_kv_buffer_arg: Optional[FusedSetKVBufferArg] = None,
) -> Tuple[torch.Tensor, torch.Tensor]:
"""PyTorch-native implementation equivalent to forward().
@@ -1075,6 +1076,9 @@ class MRotaryEmbedding(RotaryEmbedding):
query: [num_tokens, num_heads * head_size]
key: [num_tokens, num_kv_heads * head_size]
"""
assert (
fused_set_kv_buffer_arg is None
), "save kv cache is not supported for MRotaryEmbedding."
assert positions.ndim == 1 or positions.ndim == 2
num_tokens = positions.shape[-1]