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
@@ -600,7 +600,6 @@ def qsa_mqa_paged(
|
||||
score_scale: float | None = None,
|
||||
) -> tuple[torch.Tensor, torch.Tensor]:
|
||||
"""Compute QSA scores directly from a paged compressed-key cache."""
|
||||
|
||||
_validate_mqa(q)
|
||||
if not q.is_cuda or not HAS_TRITON:
|
||||
raise RuntimeError("paged QSA scoring requires a GPU and Triton")
|
||||
@@ -678,7 +677,6 @@ def expand_qsa_block_indices_cuda(
|
||||
out: torch.Tensor | None = None,
|
||||
) -> torch.Tensor:
|
||||
"""Expand compressed blocks and compact the causal tail of the open group."""
|
||||
|
||||
if not block_indices.is_cuda or not HAS_TRITON:
|
||||
raise RuntimeError("QSA index expansion requires a GPU and Triton")
|
||||
if token_topk % compress_ratio:
|
||||
@@ -738,7 +736,6 @@ def qsa_select_paged_tokens(
|
||||
out: torch.Tensor | None = None,
|
||||
) -> torch.Tensor:
|
||||
"""Score, select, and expand QSA indices without host synchronization."""
|
||||
|
||||
rows = q.shape[0]
|
||||
output_width = token_topk + compress_ratio - 1
|
||||
if out is None:
|
||||
@@ -829,7 +826,6 @@ def qsa_sparse_paged_attention(
|
||||
out: torch.Tensor | None = None,
|
||||
) -> torch.Tensor:
|
||||
"""Run sparse GQA directly over paged BF16 K/V caches."""
|
||||
|
||||
if not q.is_cuda or not HAS_TRITON:
|
||||
raise RuntimeError("paged QSA sparse attention requires a GPU and Triton")
|
||||
if q.ndim != 3 or k_cache.ndim != 4 or v_cache.shape != k_cache.shape:
|
||||
@@ -971,7 +967,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 cache stores require a GPU and Triton")
|
||||
if cache.ndim != 4 or cache.shape[2] != 1:
|
||||
@@ -1017,7 +1012,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 compression requires a GPU and Triton")
|
||||
rows = token_to_req.numel()
|
||||
|
||||
Reference in New Issue
Block a user