[Model] Support Qwen3.8-Flash-Next (#53896)
Signed-off-by: huanghaoyan.hhy <huanghaoyan.hhy@alibaba-inc.com> Signed-off-by: andyluo7 <andy.luo@amd.com> Signed-off-by: lishunyang12 <lishunyang03@gmail.com> Signed-off-by: Harry Huang <huanghaoyan.hhy@alibaba-inc.com> Signed-off-by: Thien Tran <gau.nernst@yahoo.com.sg> Signed-off-by: Isotr0py <Isotr0py@outlook.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Signed-off-by: Yifan Qiao <yifanqiao@inferact.ai> Signed-off-by: zjy0516 <riverclouds.zhu@qq.com> Co-authored-by: zjy0516 <riverclouds.zhu@qq.com> Co-authored-by: KungYork <firelikest@163.com> Co-authored-by: Thien Tran <gau.nernst@yahoo.com.sg> Co-authored-by: Yifan Qiao <yifanqiao@inferact.ai> Co-authored-by: andyluo7 <43718156+andyluo7@users.noreply.github.com> Co-authored-by: Isotr0py <mozf@inferact.ai> Co-authored-by: andyluo7 <andy.luo@amd.com> Co-authored-by: OpenAI Codex <noreply@openai.com> Co-authored-by: lishunyang12 <lishunyang03@gmail.com> Co-authored-by: Vadim Gimpelson <156319763+vadiklyutiy@users.noreply.github.com> Co-authored-by: Isotr0py <Isotr0py@outlook.com> Co-authored-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
co-authored by
zjy0516
KungYork
Thien Tran
Yifan Qiao
andyluo7
Isotr0py
andyluo7
OpenAI Codex
lishunyang12
Vadim Gimpelson
Isotr0py
Lucas Wilkinson
Claude Opus 5
OpenAI Codex
parent
687db59744
commit
e126687a9a
@@ -7,6 +7,7 @@ from enum import Enum
|
||||
import pytest
|
||||
|
||||
from vllm.config.cache import CacheConfig
|
||||
from vllm.config.scheduler import SchedulerConfig
|
||||
from vllm.config.utils import get_hash_factors, hash_factors, normalize_value
|
||||
|
||||
# Helpers
|
||||
@@ -216,6 +217,24 @@ def test_cache_config_hash_ignores_kv_cache_sizing_knobs():
|
||||
assert CacheConfig(gpu_memory_utilization=0.5).compute_hash() == base_hash
|
||||
|
||||
|
||||
def test_scheduler_config_hash_includes_max_num_seqs():
|
||||
"""Per-request workspace sizes must invalidate compiled graphs."""
|
||||
base_hash = SchedulerConfig(
|
||||
max_model_len=8192,
|
||||
is_encoder_decoder=False,
|
||||
max_num_batched_tokens=8192,
|
||||
max_num_seqs=128,
|
||||
).compute_hash()
|
||||
larger_batch_hash = SchedulerConfig(
|
||||
max_model_len=8192,
|
||||
is_encoder_decoder=False,
|
||||
max_num_batched_tokens=8192,
|
||||
max_num_seqs=1024,
|
||||
).compute_hash()
|
||||
|
||||
assert larger_batch_hash != base_hash
|
||||
|
||||
|
||||
def test_cache_config_hash_ignores_prefix_cache_retention_interval():
|
||||
base_hash = CacheConfig().compute_hash()
|
||||
assert CacheConfig(prefix_cache_retention_interval=64).compute_hash() == base_hash
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
"""Tests for SpeculativeConfig.compose_draft_hf_overrides.
|
||||
"""Tests for draft config overrides used by SpeculativeConfig.
|
||||
|
||||
Callable ``hf_overrides`` on the target model config (e.g. the
|
||||
``dummy_hf_overrides`` shrink used by ``tests/models/test_initialization.py``)
|
||||
@@ -12,10 +12,12 @@ when the target itself is shrunk — which is what kept spec-decode archs like
|
||||
"""
|
||||
|
||||
import functools
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
from transformers import PretrainedConfig
|
||||
|
||||
from vllm.config.parallel import ParallelConfig
|
||||
from vllm.config.speculative import SpeculativeConfig
|
||||
|
||||
|
||||
@@ -134,3 +136,52 @@ def test_composed_override_is_picklable():
|
||||
|
||||
out = composed(_make_hf_config())
|
||||
assert out.num_hidden_layers == 1
|
||||
|
||||
|
||||
def _make_mtp_speculative_config(
|
||||
override: bool | None,
|
||||
checkpoint_value: bool,
|
||||
) -> SpeculativeConfig:
|
||||
draft_hf_config = _make_hf_config(
|
||||
architectures=["Qwen4ExpMTP"],
|
||||
model_type="qwen4_exp_mtp",
|
||||
n_predict=1,
|
||||
index_share_for_mtp_iteration=checkpoint_value,
|
||||
)
|
||||
draft_model_config = MagicMock(
|
||||
model="draft",
|
||||
hf_config=draft_hf_config,
|
||||
architectures=draft_hf_config.architectures,
|
||||
max_model_len=128,
|
||||
)
|
||||
target_model_config = MagicMock(
|
||||
model="target",
|
||||
max_model_len=128,
|
||||
quantization=None,
|
||||
hf_overrides={},
|
||||
)
|
||||
|
||||
with patch("vllm.config.speculative.ModelConfig", return_value=draft_model_config):
|
||||
return SpeculativeConfig(
|
||||
model="draft",
|
||||
method="mtp",
|
||||
num_speculative_tokens=1,
|
||||
index_share_for_mtp_iteration=override,
|
||||
target_model_config=target_model_config,
|
||||
target_parallel_config=ParallelConfig(),
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.cpu_test
|
||||
@pytest.mark.parametrize(
|
||||
("override", "checkpoint_value", "expected"),
|
||||
[(None, True, True), (False, True, False), (True, False, True)],
|
||||
)
|
||||
def test_mtp_index_share_override(
|
||||
override: bool | None, checkpoint_value: bool, expected: bool
|
||||
):
|
||||
speculative_config = _make_mtp_speculative_config(override, checkpoint_value)
|
||||
assert (
|
||||
speculative_config.draft_model_config.hf_config.index_share_for_mtp_iteration
|
||||
is expected
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user