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
-3
View File
@@ -727,7 +727,6 @@ def warmup_qsa_sparse_paged_attention(
selection_width: int,
) -> tuple[tuple[int, int, int], ...]:
"""Compile every production-reachable split-K/merge specialization."""
head_dim = kv_cache.shape[-1] // 2
key_cache, value_cache = kv_cache.transpose(1, 2).split(head_dim, dim=-1)
# An fp8 cache is allocated as uint8 and viewed as e4m3 at attention time.
@@ -870,7 +869,6 @@ def qsa_store_cache_rows(
rows: torch.Tensor,
) -> None:
"""Store fixed-width rows in a QSA cache without boolean indexing."""
if not cache.is_cuda or not HAS_TRITON:
raise RuntimeError("QSA CUDA cache stores require Triton")
if cache.ndim != 4 or cache.shape[2] != 1:
@@ -916,7 +914,6 @@ def qsa_compress_groups_with_ratio(
rope_cache: torch.Tensor | None = None,
) -> tuple[torch.Tensor, torch.Tensor]:
"""Pool completed groups from the compressor-state ring and raw token rows."""
if not raw_keys.is_cuda or not HAS_TRITON:
raise RuntimeError("QSA CUDA compression requires Triton")
rows = token_to_req.numel()
@@ -317,7 +317,6 @@ def warmup_qsa_mqa_paged_decode(
max_num_batched_tokens: int,
) -> tuple[tuple[int, int], ...]:
"""Compile every reachable decode specialization without launching it."""
page_size = k_cache.shape[1]
page_table_width = page_table.shape[1]
columns = page_table_width * page_size
@@ -444,7 +443,6 @@ def expand_qsa_block_indices(
out: torch.Tensor,
) -> None:
"""Expand compressed blocks and compact the causal tail of the open group."""
assert token_topk % compress_ratio == 0
block_topk = token_topk // compress_ratio
output_width = token_topk + compress_ratio - 1
@@ -524,8 +522,8 @@ def qsa_select_paged_decode(
compress_ratio: Number of logical tokens represented by a cache row.
decode_query_len: Number of query tokens per request.
block_indices: Compressed-index output buffer.
"""
"""
assert token_topk % compress_ratio == 0
assert block_indices.shape == (q.shape[0], token_topk // compress_ratio)
assert decode_query_len > 0 and q.shape[0] % decode_query_len == 0
@@ -599,8 +597,8 @@ def qsa_select_paged_prefill(
max_query_len: Maximum number of query tokens in one request.
block_indices: Compressed-index output buffer.
max_seq_len: Longest context length in the batch this step.
"""
"""
assert token_topk % compress_ratio == 0
assert block_indices.shape == (q.shape[0], token_topk // compress_ratio)
assert q.dtype == k_cache.dtype, "Q and the compressed K cache must match"