Add pydocstyle to the ruff rules (#52136)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Harry Mellor <hej.mellor@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
804e5377aa
commit
8c1557a79c
@@ -232,7 +232,8 @@ class TestShouldSkipWeight:
|
||||
|
||||
class TestSafetensorsWeightsIteratorWithEpFilter:
|
||||
"""Verify that EP filtering produces a strict subset of unfiltered loading
|
||||
and that all expected dense + local expert weights are present."""
|
||||
and that all expected dense + local expert weights are present.
|
||||
"""
|
||||
|
||||
@pytest.fixture(scope="class")
|
||||
def gpt2_files(self):
|
||||
@@ -262,7 +263,8 @@ class TestSafetensorsWeightsIteratorWithEpFilter:
|
||||
|
||||
def test_empty_filter_skips_experts_only(self, gpt2_files):
|
||||
"""GPT-2 has no expert weights, so even an empty local_expert_ids
|
||||
set should return all weights (all are dense)."""
|
||||
set should return all weights (all are dense).
|
||||
"""
|
||||
all_weights = dict(safetensors_weights_iterator(gpt2_files, False))
|
||||
filtered_weights = dict(
|
||||
safetensors_weights_iterator(gpt2_files, False, local_expert_ids=set())
|
||||
@@ -273,7 +275,8 @@ class TestSafetensorsWeightsIteratorWithEpFilter:
|
||||
|
||||
class TestEpFilterOnSyntheticMoeWeights:
|
||||
"""Create synthetic safetensors files with expert-like naming and verify
|
||||
that the filter correctly skips non-local experts."""
|
||||
that the filter correctly skips non-local experts.
|
||||
"""
|
||||
|
||||
@pytest.fixture
|
||||
def synthetic_moe_files(self, tmp_path):
|
||||
|
||||
@@ -350,7 +350,8 @@ def test_marlin_post_load_preserves_runtime_tensor_addresses(monkeypatch, dist_i
|
||||
@pytest.mark.parametrize("variant", ["fp8", "mxfp8", "nvfp4"])
|
||||
def test_marlin_prepare_layer_preserves_workspace_address(monkeypatch, variant):
|
||||
"""The Marlin fallback prepare_* functions rerun on weight reload and must
|
||||
reuse the workspace storage whose address captured CUDA graphs hold."""
|
||||
reuse the workspace storage whose address captured CUDA graphs hold.
|
||||
"""
|
||||
from vllm import _custom_ops as ops
|
||||
from vllm.model_executor.layers.quantization.utils import (
|
||||
marlin_utils,
|
||||
@@ -428,7 +429,8 @@ def test_marlin_prepare_layer_preserves_workspace_address(monkeypatch, variant):
|
||||
|
||||
def test_marlin_make_workspace_new_rejects_incompatible_existing(monkeypatch):
|
||||
"""An incompatible existing workspace means the address captured by CUDA
|
||||
graphs is already unusable; allocating a replacement would hide that."""
|
||||
graphs is already unusable; allocating a replacement would hide that.
|
||||
"""
|
||||
from vllm.model_executor.layers.quantization.utils import marlin_utils
|
||||
|
||||
monkeypatch.setattr(marlin_utils, "num_compute_units", lambda _: 4)
|
||||
@@ -609,7 +611,8 @@ class _RecordingQuantMethod(QuantizeMethodBase):
|
||||
class _LateBiasLayer(torch.nn.Module):
|
||||
"""Mimics an online-quantized linear: `weight` is created on meta by
|
||||
`create_weights()`, which wraps the loaders, and the linear base registers
|
||||
`bias` afterwards."""
|
||||
`bias` afterwards.
|
||||
"""
|
||||
|
||||
def __init__(self, quant_method):
|
||||
super().__init__()
|
||||
|
||||
Reference in New Issue
Block a user