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
@@ -116,6 +116,7 @@ def fwht128_quant_fp8(q: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
Returns:
(q_fp8 ``[rows, 128]`` float8_e4m3fn, scale ``[rows, 1]`` float32).
"""
assert q.ndim == 2 and q.shape[1] == 128, q.shape
assert q.dtype == torch.bfloat16
@@ -162,7 +163,8 @@ def _kpool_softmax_rotate_write_cache_kernel(
BLOCK_D: tl.constexpr,
):
"""One program per pool. softmax(slot_score+ape)-weighted sum of slot_k ->
Hadamard-128 -> per-vector fp8 absmax quant -> write to cache at ``loc``."""
Hadamard-128 -> per-vector fp8 absmax quant -> write to cache at ``loc``.
"""
row = tl.program_id(0)
do_write = True
if HAS_WRITE_MASK:
@@ -276,6 +278,13 @@ def kpool_compress_and_write_cache(
slot_score: ``[n_pools, pool_size, head_dim]`` — per-token gate score.
ape: ``[pool_size, head_dim]`` fp32 — per-slot position bias.
loc: ``[n_pools]`` int64 — flat physical slot per pool.
pool_size: Number of tokens compressed into one cache entry.
head_dim: Indexer head dimension.
write_mask: ``[n_pools]`` bool — pools to write, or None for all.
round_scale: Round each fp8 scale down to a power of two.
return_compressed: Also return the compressed K and scales.
write_cache: Write the compressed result into ``kv_cache``.
"""
assert slot_k.ndim == 3
assert slot_score.shape == slot_k.shape
@@ -642,6 +651,10 @@ def kpool_decode_update_and_maybe_write_cache_batched(
ape: ``[pool_size, head_dim]`` fp32.
slot_mapping: ``[num_requests, next_n]`` int32.
positions: ``[num_requests, next_n]`` int32.
pool_size: Number of tokens compressed into one cache entry.
head_dim: Indexer head dimension.
round_scale: Round each fp8 scale down to a power of two.
"""
num_requests, next_n = key.shape[0], key.shape[1]
if num_requests == 0 or next_n == 0: