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
@@ -67,7 +67,8 @@ def _make_mixed_kv_cache_config(
|
||||
mamba_block_size: int = BLOCK_SIZE,
|
||||
) -> KVCacheConfig:
|
||||
"""Build a KVCacheConfig with a FullAttention group plus optional
|
||||
SlidingWindow and Mamba groups for per-group metadata tests."""
|
||||
SlidingWindow and Mamba groups for per-group metadata tests.
|
||||
"""
|
||||
register_all_kvcache_specs(vllm_config=None)
|
||||
groups = []
|
||||
tensors = []
|
||||
@@ -238,7 +239,8 @@ def test_events_disabled_no_events() -> None:
|
||||
# ---------------------------------------------------------------------------
|
||||
def test_block_stored_per_group_metadata_full_attention() -> None:
|
||||
"""BlockStored carries medium, group_idx, kind, sliding_window, block_size,
|
||||
and the correct block hash."""
|
||||
and the correct block hash.
|
||||
"""
|
||||
fix = make_events_scheduler()
|
||||
sched = fix.scheduler
|
||||
assert sched.kv_event_medium == MEDIUM_CPU
|
||||
@@ -638,7 +640,8 @@ def test_mamba_block_size_not_scaled() -> None:
|
||||
def test_multi_group_fa_block_stored_group_idx() -> None:
|
||||
"""Two distinct groups (FA + SW): each BlockStored carries its group_idx
|
||||
and kind. HybridKVCacheCoordinator requires >=2 distinct spec groups, so
|
||||
we use FA (group 0) + SlidingWindow (group 1)."""
|
||||
we use FA (group 0) + SlidingWindow (group 1).
|
||||
"""
|
||||
kv_cfg = _make_mixed_kv_cache_config(num_blocks=16, sliding_window=32)
|
||||
fix = make_events_scheduler(
|
||||
num_cpu_blocks=8,
|
||||
|
||||
@@ -250,6 +250,7 @@ def make_scheduler_output(
|
||||
cached_req_new_blocks: For returning (cached) requests, maps
|
||||
req_id -> new_block_ids (incremental) or None.
|
||||
These are placed into ``scheduled_cached_reqs``.
|
||||
|
||||
"""
|
||||
scheduled_new_reqs: list[NewRequestData] = []
|
||||
if new_reqs:
|
||||
@@ -1169,7 +1170,8 @@ def test_touched_blocks_survive_eviction() -> None:
|
||||
# ---------------------------------------------------------------------------
|
||||
def test_preemption_no_cpu_block_leak() -> None:
|
||||
"""request_finished during in-flight load defers cleanup;
|
||||
completes after load done."""
|
||||
completes after load done.
|
||||
"""
|
||||
fix = make_scheduler(num_cpu_blocks=8, num_gpu_blocks=16, lazy=False)
|
||||
sched = fix.scheduler
|
||||
|
||||
@@ -1264,7 +1266,8 @@ def test_eager_store_preemption_cleanup() -> None:
|
||||
# ---------------------------------------------------------------------------
|
||||
def test_inflight_finish_deferred_cleanup() -> None:
|
||||
"""Store, then start a load, request_finished defers,
|
||||
load completion fires cleanup."""
|
||||
load completion fires cleanup.
|
||||
"""
|
||||
fix = make_scheduler(num_cpu_blocks=8, num_gpu_blocks=16, lazy=False)
|
||||
sched = fix.scheduler
|
||||
|
||||
@@ -1398,7 +1401,8 @@ def test_chunked_prefill_reads_live_block_ids() -> None:
|
||||
"""With chunked prefill, block IDs accumulate across scheduler steps.
|
||||
_prepare_eager_store_specs reads block IDs from scheduler_output via
|
||||
yield_req_data, so the store should reflect the updated (larger) block
|
||||
list, not a stale snapshot."""
|
||||
list, not a stale snapshot.
|
||||
"""
|
||||
fix = make_scheduler(num_cpu_blocks=8, num_gpu_blocks=16, lazy=False)
|
||||
sched = fix.scheduler
|
||||
|
||||
@@ -1969,7 +1973,8 @@ def test_cp_eager_store_and_load_roundtrip(
|
||||
) -> None:
|
||||
"""With CP enabled, store blocks to CPU and reload them for a new request
|
||||
with matching tokens. Verifies that hash matching and transfer-pair
|
||||
construction work with the virtual block size."""
|
||||
construction work with the virtual block size.
|
||||
"""
|
||||
fix = _make_cp_scheduler(
|
||||
dcp_world_size=dcp_world_size,
|
||||
pcp_world_size=pcp_world_size,
|
||||
@@ -2113,7 +2118,8 @@ def test_cp_effective_block_size_store_and_load(
|
||||
@pytest.mark.parametrize("cp_world_size", [1, 2, 4])
|
||||
def test_cp_lazy_target_blocks_scaling(cp_world_size: int) -> None:
|
||||
"""_estimate_lazy_target_blocks returns fewer blocks when cp_world_size > 1
|
||||
because each virtual block covers more tokens."""
|
||||
because each virtual block covers more tokens.
|
||||
"""
|
||||
kv_cache_config = _make_kv_cache_config(num_blocks=16)
|
||||
max_batched = 64
|
||||
|
||||
@@ -2805,7 +2811,8 @@ def test_finished_eager_store_recovers_nulled_window_tail() -> None:
|
||||
"""A sliding-window group nulls pages that left the window before the
|
||||
connector sees the finished request's block table, while the GPU keeps
|
||||
them hashed in its free queue. The eager store must copy those pages, or
|
||||
the CPU lookup (which needs the whole window) misses every time."""
|
||||
the CPU lookup (which needs the whole window) misses every time.
|
||||
"""
|
||||
fix = make_scheduler(num_cpu_blocks=16, num_gpu_blocks=32, num_groups=2, lazy=False)
|
||||
sched = fix.scheduler
|
||||
gpu_pool = fix.gpu_block_pool
|
||||
|
||||
Reference in New Issue
Block a user