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 -9
View File
@@ -59,7 +59,8 @@ def ensure_divisibility(numerator, denominator):
def divide(numerator, denominator):
"""Ensure that numerator is divisible by the denominator and return
the division value."""
the division value.
"""
ensure_divisibility(numerator, denominator)
return numerator // denominator
@@ -111,6 +112,7 @@ def split_tensor_along_last_dim(
Returns:
A list of Tensors
"""
# Get the size and dimension.
last_dim = tensor.dim() - 1
@@ -333,7 +335,6 @@ class StatelessProcessGroup:
def barrier(self, timeout: float = 30.0):
"""A robust barrier to synchronize all ranks.
Uses a multi-phase approach to ensure all processes reach the barrier
before proceeding:
@@ -351,6 +352,7 @@ class StatelessProcessGroup:
Raises:
RuntimeError: If coordination fails or times out
"""
# Generate a barrier ID that is globally unique
try:
@@ -549,8 +551,7 @@ def init_gloo_process_group(
group_size: int,
timeout: timedelta,
) -> ProcessGroup:
"""
Stateless init ProcessGroup with gloo backend compatible with
"""Stateless init ProcessGroup with gloo backend compatible with
different torch versions.
"""
with suppress_stdout():
@@ -583,8 +584,7 @@ def stateless_init_torch_distributed_process_group(
return_store: bool = False,
listen_socket: socket.socket | None = None,
) -> ProcessGroup | tuple[ProcessGroup, Store]:
"""
A replacement for `torch.distributed.init_process_group` that does not
"""A replacement for `torch.distributed.init_process_group` that does not
pollute the global state. The created ProcessGroup object can be used for
some operations such as `allreduce`, because it does not depend on the
global rank. However, some operations such as `broadcast` cannot be used
@@ -685,9 +685,8 @@ def stateless_init_torch_distributed_process_group(
def stateless_destroy_torch_distributed_process_group(pg: ProcessGroup) -> None:
"""
Destroy ProcessGroup returned by
stateless_init_torch_distributed_process_group().
"""Destroy ProcessGroup returned by
stateless_init_torch_distributed_process_group().
"""
pg.shutdown()
_unregister_process_group(pg.group_name)
@@ -706,6 +705,7 @@ def get_worker_rank_suffix(global_rank: int | None = None) -> str:
Returns:
A string suffix identifying the worker's position in the
distributed topology.
"""
from vllm.distributed.parallel_state import (
get_dcp_group,