[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:
Harry Mellor
2026-09-16 10:57:24 -07:00
committed by GitHub
co-authored by Claude Opus 5
parent 1085b64425
commit 651a88c09a
693 changed files with 2088 additions and 4171 deletions
+5 -10
View File
@@ -382,8 +382,7 @@ def test_inc_get_quant_method_unquantized_layer_with_model_prefix(
layer_factory,
) -> None:
"""``model.``-prefixed extra_config entries trigger early exit for both
LinearBase and ParallelLMHead layers.
"""
LinearBase and ParallelLMHead layers."""
config = make_config(extra_config={"model.layer": {"bits": 16}})
layer = layer_factory()
@@ -396,8 +395,7 @@ def test_inc_get_quant_method_unquantized_routed_experts_with_model_prefix(
monkeypatch,
) -> None:
"""``model.``-prefixed extra_config entries trigger early exit for
RoutedExperts layers, returning UnquantizedFusedMoEMethod.
"""
RoutedExperts layers, returning UnquantizedFusedMoEMethod."""
class DummyUnquantizedFusedMoEMethod:
def __init__(self, moe_config) -> None:
@@ -420,8 +418,7 @@ def test_inc_get_quant_method_unquantized_routed_experts_with_model_prefix(
def test_inc_get_quant_method_unknown_layer_with_model_prefix_returns_none() -> None:
"""``model.``-prefixed extra_config entries return None for unhandled
layer types (non-Linear, non-MoE).
"""
layer types (non-Linear, non-MoE)."""
config = make_config(extra_config={"model.unknown": {"bits": 16}})
method = config.get_quant_method(DummyLayer(), "unknown")
@@ -736,8 +733,7 @@ def test_wna16_cuda_low_bit_moe_routes_to_humming(monkeypatch, bits) -> None:
@pytest.mark.parametrize("bits", [4, 8])
def test_wna16_cuda_high_bit_skips_humming(monkeypatch, bits) -> None:
"""4/8-bit int stays on the Marlin/GPTQ/AWQ path even on CUDA so a single
model can mix high-bit Marlin and low-bit humming layers.
"""
model can mix high-bit Marlin and low-bit humming layers."""
called = {"humming": False}
monkeypatch.setattr(current_platform, "is_cuda", lambda: True)
@@ -1668,8 +1664,7 @@ def test_inc_get_quant_method_unquantized_moe_returns_unquantized(
monkeypatch,
) -> None:
"""Early-exit returns UnquantizedFusedMoEMethod for FusedMoE layers
when extra_config has bits >= 16.
"""
when extra_config has bits >= 16."""
config = make_config(extra_config={"layer": {"bits": 16}})
layer = object.__new__(RoutedExperts)
layer.moe_config = None # UnquantizedFusedMoEMethod accepts moe_config
+1 -2
View File
@@ -213,8 +213,7 @@ def test_deepseek_v41_vl_mapper_routes_linear_scales(
):
"""The VL wrapper must map ``.scale`` keys to the parameter the linear
quant method registers, as the text model does. A hardcoded
``weight_scale_inv`` raised KeyError for native MXFP8 checkpoints.
"""
``weight_scale_inv`` raised KeyError for native MXFP8 checkpoints."""
from vllm.models.deepseek_v41.nvidia import model as model_module
from vllm.models.deepseek_v41.nvidia import vl_model as vl_module
+1 -2
View File
@@ -160,8 +160,7 @@ def test_qwen38_tep8_auto_fallback_respects_explicit_backend(
@pytest.fixture
def mxfp4_oracle_config():
"""Stub the config the oracle reads (``model_config.quantization_config``)
so backend dispatch resolves without a real model / user override.
"""
so backend dispatch resolves without a real model / user override."""
from unittest.mock import patch
with patch(
@@ -85,8 +85,7 @@ def test_block_fp8_activation_quant_config_is_block_quantized():
(FP8 dtype, [1, 128] block, not per-act-token). This is what makes the
DeepEP prepare/finalize step quantize activations to block FP8 *before* the
all-to-all dispatch instead of deferring to Humming -- and what makes
HummingExpertsBase.expects_unquantized_inputs return False.
"""
HummingExpertsBase.expects_unquantized_inputs return False."""
from vllm.model_executor.layers.quantization.utils.humming_utils import (
make_humming_moe_quant_config,
)
@@ -108,8 +107,7 @@ def test_block_fp8_activation_quant_config_is_block_quantized():
def test_default_activation_quant_config_defers_to_humming():
"""Without a block activation shape the config stays per-token (the deferred
path): Humming quantizes internally, preserving pre-existing behavior for
every non-block-FP8 scheme.
"""
every non-block-FP8 scheme."""
from vllm.model_executor.layers.quantization.utils.humming_utils import (
make_humming_moe_quant_config,
)
+1 -2
View File
@@ -70,8 +70,7 @@ def _make_int8_moe_config(moe_backend: str = "auto") -> FusedMoEConfig:
)
def test_int8_dynamic_schemes_dispatch_to_triton(weight_key, activation_key):
"""Both dynamic-activation INT8 MoE schemes (per-channel + per-tensor
weights) select the Triton backend.
"""
weights) select the Triton backend."""
config = _make_int8_moe_config()
backend, experts_cls = select_int8_moe_backend(
config, weight_key=weight_key, activation_key=activation_key
+4 -8
View File
@@ -587,8 +587,7 @@ def test_modelopt_fp8_pb_wo_checkpoint_setup(monkeypatch, dist_init, workspace_i
def test_modelopt_nvfp4_config_dispatches_w4a4_method():
"""``quant_method="NVFP4"`` (W4A4) resolves to a
``(kNvfp4Static, kNvfp4Dynamic)`` QuantSpec under the generic
``ModelOptLinearMethod``.
"""
``ModelOptLinearMethod``."""
from vllm.model_executor.layers.linear import LinearBase
config = ModelOptNvFp4Config(
@@ -637,8 +636,7 @@ def test_modelopt_linear_method_builder_registry_override(monkeypatch):
"""The bespoke-method escape hatch: a format registered in
``LINEAR_METHOD_BUILDERS`` routes that algo to its own method instead of the
generic ``ModelOptLinearMethod``. This is how a format that cannot be a
``(weight, activation)`` key pair plugs into dispatch.
"""
``(weight, activation)`` key pair plugs into dispatch."""
from vllm.model_executor.layers.linear import LinearBase
from vllm.model_executor.layers.quantization import modelopt as m
@@ -669,8 +667,7 @@ def test_modelopt_linear_method_builder_registry_override(monkeypatch):
def test_modelopt_w4a16_respects_linear_backend(linear_backend, kernel_cls):
"""W4A16 (`activation=None`) kernel selection honors ``--linear-backend``:
``use_a16=True`` defaults to Marlin, but an explicit backend wins. The
generic method routes this through ``select_linear_kernel``.
"""
generic method routes this through ``select_linear_kernel``."""
from vllm.config.quantization import QuantSpec
from vllm.model_executor.layers.quantization.modelopt import (
RuntimeDtypes,
@@ -941,8 +938,7 @@ def test_modelopt_fp8_pb_wo_hides_output_padding(monkeypatch):
def test_modelopt_fp8_pb_wo_rejects_non_128_input():
"""Input width must still be a multiple of 128 (same as #53132, which only
pads the output). A partial input block is refused loudly rather than
silently loading wrong scales.
"""
silently loading wrong scales."""
from vllm.model_executor.layers.quantization import modelopt as mo
from vllm.model_executor.layers.quantization.utils.quant_utils import (
kFp8Static128BlockSym,
+1 -2
View File
@@ -411,8 +411,7 @@ def test_online_mxfp4_moe_matches_quark(
) -> tuple[torch.Tensor, torch.Tensor]:
"""Place the source weights into buffers of the padded size, the
way the weight loader writes only the unpadded slice of a larger
allocation.
"""
allocation."""
w13 = torch.full(
(num_experts, 2 * intermediate_size, hidden_size),
padding_value,
@@ -490,8 +490,7 @@ def test_per_token_head_negative_slot_skipped(qcfg: QuantConfig):
)
def test_process_weights_sets_placeholder_scales(kv_cache_dtype: str):
"""Per-token-head should set _k_scale=1.0, _v_scale=1.0
and delete checkpoint attrs.
"""
and delete checkpoint attrs."""
from vllm.model_executor.layers.quantization.kv_cache import (
BaseKVCacheMethod,
)