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:
Harry Mellor
2026-09-16 16:44:29 +00:00
committed by GitHub
co-authored by Claude Opus 5
parent 804e5377aa
commit 8c1557a79c
2002 changed files with 15024 additions and 14269 deletions
+9 -7
View File
@@ -493,7 +493,6 @@ async def test_dp_pause_abort(expert_parallel: bool):
@pytest.mark.parametrize("expert_parallel", [False, True])
async def test_dp_pause_keep_then_resume(expert_parallel: bool):
"""Start generation, pause after a few tokens (keep mode), resume; verify gap."""
pause_duration = 2.0
min_tokens_before_pause = 3
@@ -548,7 +547,8 @@ async def test_dp_pause_keep_then_resume(expert_parallel: bool):
async def test_dp_pause_keep_race_staggered_engines():
"""Race: send pause(keep) to engine 0, then add two requests,
then pause(keep) to engine 1. Ensures no deadlock when pause
requests are staggered and requests arrive in between."""
requests are staggered and requests arrive in between.
"""
if DP_SIZE != 2:
pytest.skip("test_dp_pause_keep_race_staggered_engines requires DP_SIZE=2")
@@ -607,8 +607,7 @@ async def test_dp_pause_keep_race_staggered_engines():
@pytest.mark.asyncio
async def test_dp_pause_barrier_request_deadlock():
"""
Test that start_dp_wave is ignored while paused.
"""Test that start_dp_wave is ignored while paused.
Sequence:
1. Pause all engines (PAUSED_ALL).
@@ -719,7 +718,8 @@ async def test_dp_pause_barrier_request_deadlock():
async def test_dp_pause_wait_mode_drains_in_flight():
"""mode="wait" through the DP consensus path: the pause lets the
in-flight request run to completion while the consensus is pending,
resolves only once drained, and the engine generates again on resume."""
resolves only once drained, and the engine generates again on resume.
"""
with ExitStack() as after:
engine = AsyncLLM.from_engine_args(_get_dp_pause_engine_args(True))
after.callback(engine.shutdown)
@@ -750,7 +750,8 @@ async def test_dp_pause_wait_mode_drains_in_flight():
async def test_dp_pause_while_asleep():
"""Pausing a sleeping DP engine: sleeping ranks skip dummy batches yet
must still reach the pause consensus, and the completion barrier must
be harmless on workers whose memory is unmapped."""
be harmless on workers whose memory is unmapped.
"""
with ExitStack() as after:
engine = AsyncLLM.from_engine_args(_get_dp_pause_engine_args(True))
after.callback(engine.shutdown)
@@ -786,7 +787,8 @@ async def test_dp_pause_completion_implies_device_idle(
"""A resolved pause future promises an idle device. Inflate the dummy
batches the pause consensus manufactures so any work the pause fails to
wait on stays visible, then require a quiet worker stream the moment
pause_generation() returns."""
pause_generation() returns.
"""
with ExitStack() as after:
# The probes below ship functions through collective_rpc.
monkeypatch.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
+2 -5
View File
@@ -1,7 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
"""
Test Dual Batch Overlap (DBO) with Data Parallelism + Expert Parallelism.
"""Test Dual Batch Overlap (DBO) with Data Parallelism + Expert Parallelism.
DBO is specifically designed for DP+EP scenarios to hide communication latency
by overlapping computation of two batches. This test validates that DBO works
@@ -54,9 +53,7 @@ DEEPEP_BACKENDS = [
),
)
def test_dbo_dp_ep_gsm8k(all2all_backend: str, num_gpus_available):
"""
Test DBO with DP+EP using GSM8K evaluation.
"""
"""Test DBO with DP+EP using GSM8K evaluation."""
lm_eval = pytest.importorskip("lm_eval")
required_gpus = DP_SIZE
+2 -1
View File
@@ -24,7 +24,8 @@ TP_SIZE = int(os.getenv("TP_SIZE", "1"))
class ExternalLBServerManager:
"""Manages data parallel vLLM server instances for external
load balancer testing."""
load balancer testing.
"""
def __init__(
self,
+2 -1
View File
@@ -30,7 +30,8 @@ DP_SIZE_LOCAL = DP_SIZE // NUM_NODES # 2 ranks per node
class HybridLBServerManager:
"""Manages hybrid data parallel vLLM server instances where each node
runs a single logical API server that balances requests only to the
DP engines running on that same node."""
DP engines running on that same node.
"""
def __init__(
self,
+6 -5
View File
@@ -107,7 +107,8 @@ async def _run_request_bursts(
class MultinodeInternalLBServerManager:
"""Manages multi-node data parallel vLLM server instances for internal
load balancer testing using --headless mode."""
load balancer testing using --headless mode.
"""
def __init__(
self,
@@ -241,7 +242,8 @@ class MultinodeInternalLBServerManager:
class APIOnlyServerManager:
"""Manages API-only server (Node 0) and headless engines server (Node 1)
for testing separated API server and engine configuration."""
for testing separated API server and engine configuration.
"""
def __init__(
self,
@@ -261,7 +263,6 @@ class APIOnlyServerManager:
def __enter__(self) -> list[tuple[RemoteOpenAIServer, list[str]]]:
"""Start API-only server and headless engines server."""
# Start API-only server (Node 0) - no engines, only API server
api_server_args = self.base_server_args.copy()
api_server_args.extend(
@@ -607,7 +608,6 @@ async def test_api_only_multinode_dp_completion(
model_name: str,
) -> None:
"""Test API-only server with all engines on separate headless server."""
# Test single request
result = await _make_completion_request(api_only_client, model_name)
assert result is not None
@@ -645,7 +645,8 @@ async def test_api_only_multinode_dp_completion_streaming(
model_name: str,
) -> None:
"""Test API-only server streaming with all engines on separate
headless server."""
headless server.
"""
prompt = "What is an LLM?"
async def make_streaming_request():
+8 -6
View File
@@ -82,7 +82,8 @@ async def _generate(engine: AsyncLLM, prompt: str, max_tokens: int) -> int:
@pytest.mark.parametrize("async_scheduling", [True, False])
async def test_pp_dp_v2_low_concurrency(async_scheduling: bool):
"""A single in-flight request at a time, repeated, to exercise the
PP slot ring under empty batches between decodes."""
PP slot ring under empty batches between decodes.
"""
with ExitStack() as after:
engine = AsyncLLM.from_engine_args(_engine_args(async_scheduling))
after.callback(engine.shutdown)
@@ -96,7 +97,8 @@ async def test_pp_dp_v2_low_concurrency(async_scheduling: bool):
@pytest.mark.parametrize("async_scheduling", [True, False])
async def test_pp_dp_v2_mid_concurrency(async_scheduling: bool):
"""64 concurrent requests, staggered, to exercise the steady-state
DP all-reduce + PP slot-ring path."""
DP all-reduce + PP slot-ring path.
"""
with ExitStack() as after:
engine = AsyncLLM.from_engine_args(_engine_args(async_scheduling))
after.callback(engine.shutdown)
@@ -112,8 +114,8 @@ async def test_pp_dp_v2_mid_concurrency(async_scheduling: bool):
@pytest.mark.asyncio
async def test_pp_dp_v2_abort_mid_decode():
"""Cancel half the in-flight requests mid-stream and confirm the
engine survives the abort storm."""
engine survives the abort storm.
"""
with ExitStack() as after:
engine = AsyncLLM.from_engine_args(_engine_args(async_scheduling=True))
after.callback(engine.shutdown)
@@ -153,8 +155,8 @@ async def test_pp_dp_v2_abort_mid_decode():
@pytest.mark.asyncio
async def test_pp_dp_v2_pause_resume():
"""Pause an engine with a request in flight, then resume and confirm
new requests still work."""
new requests still work.
"""
with ExitStack() as after:
engine = AsyncLLM.from_engine_args(_engine_args(async_scheduling=True))
after.callback(engine.shutdown)