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
+4 -5
View File
@@ -171,7 +171,8 @@ def test_glm5_flashinfer_masked_mha_routing(
def test_concat_k_nope_k_pe_matches_torch_cat(qk_rope_head_dim):
"""The K concat used by the MLA prefill context loop must equal torch.cat of
k_nope with the broadcast k_pe; with no RoPE part it returns k_nope itself
instead of allocating and copying."""
instead of allocating and copying.
"""
torch.manual_seed(0)
num_tokens, num_heads, qk_nope_head_dim = 5, 4, 256
k_nope = torch.randn(num_tokens, num_heads, qk_nope_head_dim, dtype=torch.bfloat16)
@@ -515,6 +516,7 @@ def create_and_prepopulate_kv_cache(
Returns:
MLA KV cache tensor
"""
batch_size = len(kv_c_contexts)
seq_lens = common_attn_metadata.seq_lens.cpu()
@@ -1307,7 +1309,6 @@ def run_attention_backend(
chunked_prefill_workspace_size: int | None = None,
) -> torch.Tensor:
"""Run attention computation using the specified backend's AttentionImpl."""
builder_cls, impl_cls = try_get_attention_backend(backend)
# Force the prefill backend selection (None means auto-select).
@@ -1434,8 +1435,7 @@ def _run_backend_correctness(
v_head_dim: int,
chunked_prefill_workspace_size: int | None = None,
):
"""
Test that all backends produce similar outputs to a reference implementation
"""Test that all backends produce similar outputs to a reference implementation
using torch.nn.functional.scaled_dot_product_attention.
This test works by:
@@ -1454,7 +1454,6 @@ def _run_backend_correctness(
multiple GPUs. This tests that backends work correctly with different
head counts.
"""
# Filter backends to those that support the requested kv_cache_dtype
backends_to_test = [
b