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
@@ -151,6 +151,7 @@ def create_and_prepopulate_kv_cache(
|
||||
Returns:
|
||||
A 4D tensor in logical ``(num_blocks, num_kv_heads, block_size,
|
||||
2 * head_size)`` order with strides determined by ``layout``.
|
||||
|
||||
"""
|
||||
batch_size = len(k_contexts)
|
||||
seq_lens = common_attn_metadata.seq_lens.cpu()
|
||||
@@ -286,7 +287,6 @@ def run_attention_backend(
|
||||
use_cuda_graph: bool = False,
|
||||
) -> torch.Tensor:
|
||||
"""Run attention computation using the specified backend's AttentionImpl."""
|
||||
|
||||
use_direct_block_mask = is_torch_equal_or_newer("2.9.0.dev0")
|
||||
if backend == "FLEX_ATTENTION_SLOW":
|
||||
use_direct_block_mask = False
|
||||
@@ -414,8 +414,7 @@ def _test_backend_correctness(
|
||||
max_num_seqs: int | None = None,
|
||||
max_num_batched_tokens: 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 FlexAttention or an explicit attention-sink reference.
|
||||
|
||||
This test works by:
|
||||
@@ -1393,7 +1392,8 @@ def test_non_causal_backend_correctness(
|
||||
model: str,
|
||||
):
|
||||
"""Test backend's correctness with non-causal (bidirectional) decoder
|
||||
attention, as used by DFlash speculative decoding."""
|
||||
attention, as used by DFlash speculative decoding.
|
||||
"""
|
||||
|
||||
def bidirectional_mask_mod(
|
||||
b: torch.Tensor,
|
||||
|
||||
Reference in New Issue
Block a user