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
@@ -259,7 +259,8 @@ class SimpleCPUOffloadScheduler:
|
||||
gpu_config: "KVCacheConfig", cpu_capacity_bytes: int
|
||||
) -> "KVCacheConfig":
|
||||
"""Derive a CPU KVCacheConfig from the GPU config.
|
||||
Same kv_cache_groups, num_blocks scaled by CPU/GPU memory ratio."""
|
||||
Same kv_cache_groups, num_blocks scaled by CPU/GPU memory ratio.
|
||||
"""
|
||||
# Import here to avoid potential circular imports
|
||||
from vllm.v1.kv_cache_interface import KVCacheTensor
|
||||
|
||||
@@ -314,14 +315,14 @@ class SimpleCPUOffloadScheduler:
|
||||
|
||||
def bind_gpu_block_pool(self, gpu_block_pool: BlockPool) -> None:
|
||||
"""Bind GPU block pool so that we can touch blocks during stores.
|
||||
Called by Scheduler after kv_cache_manager is ready."""
|
||||
Called by Scheduler after kv_cache_manager is ready.
|
||||
"""
|
||||
self._gpu_block_pool = gpu_block_pool
|
||||
|
||||
def get_num_new_matched_tokens(
|
||||
self, request: "Request", num_computed_tokens: int
|
||||
) -> tuple[int | None, bool]:
|
||||
"""Return (num_new_tokens, is_async) from consecutive CPU cache hits."""
|
||||
|
||||
# Pins found CPU blocks so they survive LRU eviction until
|
||||
# update_state_after_alloc() consumes them. Any pin from an earlier
|
||||
# call on the same request (e.g. retry after a failed allocate_slots)
|
||||
@@ -636,8 +637,8 @@ class SimpleCPUOffloadScheduler:
|
||||
Returns:
|
||||
(gpu_block_ids, cpu_block_ids, req_ids, block_meta) for the store
|
||||
event. ``block_meta`` is None when kv cache events are disabled.
|
||||
"""
|
||||
|
||||
"""
|
||||
merged_gpu_block_ids: list[int] = []
|
||||
merged_cpu_block_ids: list[int] = []
|
||||
req_ids: list[str] = []
|
||||
@@ -1130,7 +1131,8 @@ class SimpleCPUOffloadScheduler:
|
||||
block_ids: list[int],
|
||||
) -> tuple[bool, dict[str, Any] | None]:
|
||||
"""Always returns (False, None). GPU blocks are protected by ref_cnt,
|
||||
so the scheduler can free blocks immediately."""
|
||||
so the scheduler can free blocks immediately.
|
||||
"""
|
||||
req_id = request.request_id
|
||||
|
||||
# Release any temp CPU hit pin from get_num_new_matched_tokens()
|
||||
@@ -1330,7 +1332,6 @@ class SimpleCPUOffloadScheduler:
|
||||
the transfer finished, then release refs without caching abandoned
|
||||
store results.
|
||||
"""
|
||||
|
||||
self._abandoned_store_event_to_blocks.update(self._store_event_to_blocks)
|
||||
for transfer in self._pending_finished_stores:
|
||||
self._release_transfer_refs(transfer)
|
||||
|
||||
Reference in New Issue
Block a user