[Model Runner v2] Oracle for model runner v2 - qwen3 dense model by default [1/N] (#39337)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: Nick Hill <nickhill123@gmail.com>
Signed-off-by: Wentao Ye <44945378+yewentao256@users.noreply.github.com>
Co-authored-by: Nick Hill <nickhill123@gmail.com>
This commit is contained in:
Wentao Ye
2026-05-14 10:02:33 -07:00
committed by GitHub
co-authored by Nick Hill
parent f3d5360591
commit ae4f59f0ec
6 changed files with 208 additions and 20 deletions
+99
View File
@@ -12,6 +12,7 @@ import pytest
from pydantic import ValidationError
import vllm.config.vllm as vllm_config_module
import vllm.envs as envs
from vllm.compilation.backends import VllmBackend
from vllm.config import (
CompilationConfig,
@@ -49,6 +50,104 @@ def test_compile_config_repr_succeeds():
assert "inductor_passes" in val
@pytest.mark.parametrize(
("env_value", "expected"),
[
(None, None),
("0", False),
("1", True),
],
)
def test_v2_model_runner_env_tri_state(monkeypatch, env_value, expected):
if env_value is None:
monkeypatch.delenv("VLLM_USE_V2_MODEL_RUNNER", raising=False)
else:
monkeypatch.setenv("VLLM_USE_V2_MODEL_RUNNER", env_value)
assert envs.VLLM_USE_V2_MODEL_RUNNER is expected
@pytest.mark.parametrize(
("model_config", "expected"),
[
(
SimpleNamespace(
model="Qwen/Qwen3-1.7B-Base",
architectures=["Qwen3ForCausalLM"],
runner_type="generate",
is_moe=False,
is_quantized=False,
),
True,
),
(
SimpleNamespace(
model="Qwen/Qwen3-32B",
architectures=["Qwen3ForCausalLM"],
runner_type="generate",
is_moe=False,
is_quantized=False,
),
True,
),
(
SimpleNamespace(
model="facebook/opt-125m",
architectures=["OPTForCausalLM"],
runner_type="generate",
is_moe=False,
is_quantized=False,
),
False,
),
(
SimpleNamespace(
model="Qwen/Qwen3-30B-A3B",
architectures=["Qwen3MoeForCausalLM"],
runner_type="generate",
is_moe=True,
is_quantized=False,
),
False,
),
(
SimpleNamespace(
model="Qwen/Qwen3-1.7B-FP8",
architectures=["Qwen3ForCausalLM"],
runner_type="generate",
is_moe=False,
is_quantized=True,
),
False,
),
(
SimpleNamespace(
model="Qwen/Qwen3.5-4B",
architectures=["Qwen3_5ForConditionalGeneration"],
runner_type="generate",
is_moe=False,
is_quantized=False,
),
False,
),
(
SimpleNamespace(
model="Qwen/Qwen3-Embedding-0.6B",
architectures=["Qwen3ForCausalLM"],
runner_type="pooling",
is_moe=False,
is_quantized=False,
),
False,
),
],
)
def test_is_default_v2_model_runner_model(model_config, expected):
config = SimpleNamespace(model_config=model_config)
assert VllmConfig._is_default_v2_model_runner_model(config) is expected
@pytest.mark.skip_global_cleanup
def test_with_hf_config_populates_missing_architectures_from_causal_lm_mapping(
monkeypatch,