Merge remote-tracking branch 'origin/main' into lesj/qwen4exp-bugfixes
Both sides edited the same import block in the Qwen4Exp NVIDIA and AMD
models and nothing else collided. This branch adds
`from ..common.mtp import make_mtp_hidden_buffer`, the helper the MTP
buffer extraction calls; upstream ec4a3a5370 widened the `..config`
import to `ATTENTION_LAYER_TYPES, QSA_LAYER_TYPE, Qwen4ExpConfig` for the
layer-type constants it introduced. The two changes are independent, so
the resolution keeps both lines. Every symbol still has a use outside the
import in both files.
Signed-off-by: lesj0610 <lesj0610@users.noreply.github.com>
This commit is contained in:
@@ -808,7 +808,6 @@ def test_models_fse_init(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
"""Model construction resolves FSE consistently with Quark quantization."""
|
||||
|
||||
quantization_config: dict[str, Any] = (
|
||||
get_deepseek_v4_quark_config(["layers.0.ffn.shared_experts"] if exclude else [])
|
||||
if model_type == "deepseek_v4"
|
||||
|
||||
@@ -71,7 +71,7 @@ def test_unstamped_and_mismatched_block_layers_are_skipped(monkeypatch) -> None:
|
||||
|
||||
@pytest.mark.parametrize("is_bmm", [False, True])
|
||||
def test_kernel_registers_itself_as_warmup_provider(is_bmm) -> None:
|
||||
"""bmm layers bypass the kernel at runtime, so they must not be warmed."""
|
||||
"""Bmm layers bypass the kernel at runtime, so they must not be warmed."""
|
||||
kernel = object.__new__(DeepGemmFp8BlockScaledMMKernel)
|
||||
kernel.is_deep_gemm_supported = False
|
||||
layer = torch.nn.Module()
|
||||
|
||||
@@ -23,9 +23,7 @@ REVISION_ROBERTA = os.environ.get("REVISION", "main")
|
||||
current_platform.is_rocm(), reason="Xformers backend is not supported on ROCm."
|
||||
)
|
||||
def test_model_loading_with_params(vllm_runner, monkeypatch):
|
||||
"""
|
||||
Test parameter weight loading with tp>1.
|
||||
"""
|
||||
"""Test parameter weight loading with tp>1."""
|
||||
# to use apply_model
|
||||
monkeypatch.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
|
||||
with vllm_runner(
|
||||
@@ -68,9 +66,7 @@ def test_model_loading_with_params(vllm_runner, monkeypatch):
|
||||
current_platform.is_rocm(), reason="Xformers backend is not supported on ROCm."
|
||||
)
|
||||
def test_roberta_model_loading_with_params(vllm_runner, monkeypatch):
|
||||
"""
|
||||
Test parameter weight loading with tp>1.
|
||||
"""
|
||||
"""Test parameter weight loading with tp>1."""
|
||||
# to use apply_model
|
||||
monkeypatch.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
|
||||
with vllm_runner(
|
||||
@@ -113,9 +109,7 @@ def test_roberta_model_loading_with_params(vllm_runner, monkeypatch):
|
||||
current_platform.is_rocm(), reason="Xformers backend is not supported on ROCm."
|
||||
)
|
||||
def test_facebook_roberta_model_loading_with_params(vllm_runner, monkeypatch):
|
||||
"""
|
||||
Test loading roberta-base model with no lm_head.
|
||||
"""
|
||||
"""Test loading roberta-base model with no lm_head."""
|
||||
# to use apply_model
|
||||
monkeypatch.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
|
||||
model_name = "FacebookAI/roberta-base"
|
||||
|
||||
@@ -62,7 +62,6 @@ def test_oink_availability_checks(
|
||||
expected_fused: bool,
|
||||
):
|
||||
"""Test OINK support detection with clean import state for each parameter set."""
|
||||
|
||||
# Use spawn to run function in fresh process with clean imports
|
||||
# TODO migrate to spawn utility:
|
||||
# https://github.com/vllm-project/vllm/issues/41415
|
||||
|
||||
@@ -16,8 +16,7 @@ from vllm.multimodal.processing import InputProcessingContext
|
||||
|
||||
# Helper function to print input IDs with coalesced audio/video tokens.
|
||||
def print_input_ids(input_ids):
|
||||
"""
|
||||
Print input IDs, compressing consecutive special tokens.
|
||||
"""Print input IDs, compressing consecutive special tokens.
|
||||
- 151675: <|audio_pad|>
|
||||
- 151656: <|video_pad|>
|
||||
"""
|
||||
@@ -137,7 +136,6 @@ def test_qwen3_omni_get_updates_use_audio_in_video(
|
||||
mock_image_processor,
|
||||
):
|
||||
"""Test the get_updates_use_audio_in_video method directly."""
|
||||
|
||||
from vllm.model_executor.models.qwen3_omni_moe_thinker import (
|
||||
Qwen3OmniMoeThinkerMultiModalProcessor,
|
||||
Qwen3OmniMoeThinkerProcessingInfo,
|
||||
|
||||
@@ -51,8 +51,7 @@ class DummyConfig:
|
||||
def make_video_embedding(
|
||||
t, h, w, interleave_text_tokens: tuple[int, int], video_pruning_rate: float = 0.0
|
||||
):
|
||||
"""
|
||||
Helper function to make a video embedding for a given video size and pruning rate.
|
||||
"""Make a video embedding for a given video size and pruning rate.
|
||||
|
||||
Args:
|
||||
t: Number of frames.
|
||||
@@ -64,6 +63,7 @@ def make_video_embedding(
|
||||
|
||||
Returns:
|
||||
Tuple of (unpruned_tokens_sequence, pruned_tokens_sequence, retention_mask)
|
||||
|
||||
"""
|
||||
unpruned_tokens_sequence = []
|
||||
population = list(range(1, 100))
|
||||
|
||||
@@ -278,7 +278,7 @@ def test_routed_experts_capturer_single_dp_no_metadata():
|
||||
|
||||
|
||||
def test_routed_experts_capturer_dp_naive_concatenated_all_ranks():
|
||||
"""n == sum(num_tokens_dp): slice this rank's segment from concatenated topk."""
|
||||
"""N == sum(num_tokens_dp): slice this rank's segment from concatenated topk."""
|
||||
capturer = _capturer_with_buffer(dp_rank=1)
|
||||
num_tokens_dp = torch.tensor([2, 3], dtype=torch.int32)
|
||||
ctx = SimpleNamespace(
|
||||
@@ -295,7 +295,7 @@ def test_routed_experts_capturer_dp_naive_concatenated_all_ranks():
|
||||
|
||||
|
||||
def test_routed_experts_capturer_dp_modular_local_tokens():
|
||||
"""n == token_num_per_dp: topk is already local to this DP rank."""
|
||||
"""N == token_num_per_dp: topk is already local to this DP rank."""
|
||||
capturer = _capturer_with_buffer(dp_rank=1)
|
||||
num_tokens_dp = torch.tensor([2, 3], dtype=torch.int32)
|
||||
ctx = SimpleNamespace(
|
||||
|
||||
@@ -72,28 +72,28 @@ class TestMaybeRemapKvScaleName:
|
||||
assert result == "model.layers.0.self_attn.attn.v_scale"
|
||||
|
||||
def test_modelopt_k_proj_k_scale(self):
|
||||
"""ModelOpt format: k_proj.k_scale -> attn.k_scale"""
|
||||
"""ModelOpt format: k_proj.k_scale -> attn.k_scale."""
|
||||
result = maybe_remap_kv_scale_name(
|
||||
"model.layers.0.self_attn.k_proj.k_scale", self.PARAMS_DICT
|
||||
)
|
||||
assert result == "model.layers.0.self_attn.attn.k_scale"
|
||||
|
||||
def test_modelopt_v_proj_v_scale(self):
|
||||
"""ModelOpt format: v_proj.v_scale -> attn.v_scale"""
|
||||
"""ModelOpt format: v_proj.v_scale -> attn.v_scale."""
|
||||
result = maybe_remap_kv_scale_name(
|
||||
"model.layers.0.self_attn.v_proj.v_scale", self.PARAMS_DICT
|
||||
)
|
||||
assert result == "model.layers.0.self_attn.attn.v_scale"
|
||||
|
||||
def test_deprecated_kv_scale(self):
|
||||
"""Old format: kv_scale -> attn.k_scale (deprecated)"""
|
||||
"""Old format: kv_scale -> attn.k_scale (deprecated)."""
|
||||
result = maybe_remap_kv_scale_name(
|
||||
"model.layers.0.self_attn.kv_scale", self.PARAMS_DICT
|
||||
)
|
||||
assert result == "model.layers.0.self_attn.attn.k_scale"
|
||||
|
||||
def test_default_bare_k_scale(self):
|
||||
"""Default format: .k_scale -> .attn.k_scale"""
|
||||
"""Default format: .k_scale -> .attn.k_scale."""
|
||||
result = maybe_remap_kv_scale_name(
|
||||
"model.layers.0.self_attn.k_scale", self.PARAMS_DICT
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user