[CI] Ignore ruff D209, rejoin the docstrings it split, and silence incompatible-rule warnings (#57212)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1085b64425
commit
651a88c09a
@@ -372,8 +372,7 @@ class _HeterogeneousConfig(PretrainedConfig):
|
||||
"""A heterogeneous config with no convertor of its own.
|
||||
|
||||
Mirrors the parts vLLM uses: per-layer configs are shallow copies with the
|
||||
varying attributes applied and heterogeneity stripped, so they do not recurse.
|
||||
"""
|
||||
varying attributes applied and heterogeneity stripped, so they do not recurse."""
|
||||
|
||||
is_heterogeneous = True
|
||||
|
||||
@@ -472,8 +471,7 @@ def test_deepseek_v4_convertor_splits_vision_architecture():
|
||||
"""The vision checkpoint shares model_type/architectures with the
|
||||
text-only DeepSeek-V4; the convertor routes it to the VL wrapper class
|
||||
by rewriting hf_config.architectures (model-class resolution reads the
|
||||
raw attribute).
|
||||
"""
|
||||
raw attribute)."""
|
||||
from vllm.transformers_utils.configs.deepseek_v4 import DeepseekV4Config
|
||||
from vllm.transformers_utils.model_arch_config_convertor import (
|
||||
DeepseekV4ModelArchConfigConvertor,
|
||||
|
||||
@@ -42,8 +42,7 @@ def test_mm_encoder_attn_backend_hash_updates():
|
||||
|
||||
def test_language_model_only_does_not_affect_mm_hash():
|
||||
"""language_model_only does not affect the ViT computation graph,
|
||||
so it should not change the multimodal config hash.
|
||||
"""
|
||||
so it should not change the multimodal config hash."""
|
||||
base_hash = MultiModalConfig().compute_hash()
|
||||
lm_only_hash = MultiModalConfig(language_model_only=True).compute_hash()
|
||||
assert base_hash == lm_only_hash
|
||||
@@ -51,8 +50,7 @@ def test_language_model_only_does_not_affect_mm_hash():
|
||||
|
||||
def test_language_model_only_affects_model_hash():
|
||||
"""language_model_only affects the LM computation graph,
|
||||
so it should change the model config hash.
|
||||
"""
|
||||
so it should change the model config hash."""
|
||||
model = "llava-hf/llava-1.5-7b-hf"
|
||||
base_hash = ModelConfig(model).compute_hash()
|
||||
lm_only_hash = ModelConfig(model, language_model_only=True).compute_hash()
|
||||
@@ -388,8 +386,7 @@ def _resolve_mm_video_decode_device(
|
||||
torchcodec_available: bool = True,
|
||||
) -> dict:
|
||||
"""Run processor-device then video-decode-device resolution and report
|
||||
the resulting video media IO kwargs.
|
||||
"""
|
||||
the resulting video media IO kwargs."""
|
||||
mm_config = MultiModalConfig(
|
||||
mm_processor_kwargs={} if device is None else {"device": device},
|
||||
mm_tensor_ipc=mm_tensor_ipc, # type: ignore[arg-type]
|
||||
@@ -419,8 +416,7 @@ def _resolve_mm_video_decode_device(
|
||||
|
||||
def test_auto_video_decode_uses_nvdec_on_encoder_instance():
|
||||
"""The processor runs on the accelerator there, so decoded frames should
|
||||
stay on-device too.
|
||||
"""
|
||||
stay on-device too."""
|
||||
assert _resolve_mm_video_decode_device(ec_role="ec_producer") == {
|
||||
"backend": "torchcodec",
|
||||
"device": "cuda",
|
||||
@@ -432,8 +428,7 @@ def test_auto_video_decode_stays_on_cpu_off_encoder_instance(
|
||||
ec_role: ECRole | None,
|
||||
):
|
||||
"""The processor stays on CPU off encode-only instances, so video
|
||||
decoding should too.
|
||||
"""
|
||||
decoding should too."""
|
||||
assert _resolve_mm_video_decode_device(ec_role=ec_role) == {}
|
||||
|
||||
|
||||
|
||||
@@ -34,8 +34,7 @@ def _make_hf_config(**kwargs) -> PretrainedConfig:
|
||||
@pytest.mark.cpu_test
|
||||
def test_dict_overrides_are_not_forwarded_to_draft():
|
||||
"""Dict overrides are target-specific key patches; the draft must get
|
||||
only the architecture-mapping override.
|
||||
"""
|
||||
only the architecture-mapping override."""
|
||||
composed = SpeculativeConfig.compose_draft_hf_overrides(
|
||||
{"max_position_embeddings": 1234}
|
||||
)
|
||||
@@ -51,8 +50,7 @@ def test_none_overrides_fall_back_to_arch_mapping():
|
||||
@pytest.mark.cpu_test
|
||||
def test_callable_overrides_reach_the_draft_config():
|
||||
"""A callable override (config-to-config transform) composes with the
|
||||
architecture-mapping override and is applied to the draft config.
|
||||
"""
|
||||
architecture-mapping override and is applied to the draft config."""
|
||||
|
||||
def shrink(hf_config: PretrainedConfig) -> PretrainedConfig:
|
||||
hf_config.num_hidden_layers = 1
|
||||
@@ -69,8 +67,7 @@ def test_callable_overrides_reach_the_draft_config():
|
||||
@pytest.mark.cpu_test
|
||||
def test_arch_mapping_applies_before_callable_override():
|
||||
"""The static arch-mapping override runs first, so the user callable
|
||||
observes (and may adjust) the post-mapping config.
|
||||
"""
|
||||
observes (and may adjust) the post-mapping config."""
|
||||
seen_architectures: list[str] = []
|
||||
|
||||
def record(hf_config: PretrainedConfig) -> PretrainedConfig:
|
||||
@@ -131,8 +128,7 @@ def test_composed_override_is_picklable():
|
||||
the composed override must be picklable. A nested local closure is not
|
||||
(it raised ``Can't get local object`` on DFlashDraftModel); a
|
||||
``functools.partial`` over a module-referenceable static method is.
|
||||
Guard against regressing to a closure.
|
||||
"""
|
||||
Guard against regressing to a closure."""
|
||||
composed = SpeculativeConfig.compose_draft_hf_overrides(_module_level_shrink)
|
||||
|
||||
assert isinstance(composed, functools.partial)
|
||||
|
||||
@@ -99,8 +99,7 @@ def test_independent_draft_model_keeps_its_own_limit(
|
||||
vllm_caplog: pytest.LogCaptureFixture,
|
||||
):
|
||||
"""An independent AR draft may genuinely have a smaller context than the
|
||||
target; its max_position_embeddings must not be resized.
|
||||
"""
|
||||
target; its max_position_embeddings must not be resized."""
|
||||
target_model_config = ModelConfig(
|
||||
AR_MODEL, hf_overrides={"max_position_embeddings": 8192}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user