[CI] Ignore ruff D209, rejoin the docstrings it split, and silence incompatible-rule warnings (#57212)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harry Mellor
2026-09-16 10:57:24 -07:00
committed by GitHub
co-authored by Claude Opus 5
parent 1085b64425
commit 651a88c09a
693 changed files with 2088 additions and 4171 deletions
+2 -4
View File
@@ -365,8 +365,7 @@ class AttentionBackend(ABC):
@classmethod
def supported_kv_cache_layouts(cls) -> tuple[KVCacheLayout, ...] | None:
"""Layouts this backend's kernels can consume, most preferred first, or
None when the kernels consume any layout and express no preference.
"""
None when the kernels consume any layout and express no preference."""
return None
@classmethod
@@ -558,8 +557,7 @@ M = TypeVar("M")
class AttentionCGSupport(Enum):
"""Constants for the cudagraph support of the attention backend
Here we do not consider the cascade attention, as currently
it is never cudagraph supported.
"""
it is never cudagraph supported."""
ALWAYS = 3
"""Cudagraph always supported; supports mixed-prefill-decode"""
+1 -2
View File
@@ -84,8 +84,7 @@ class CPUAttentionBackend(AttentionBackend):
@classmethod
def supports_attn_type(cls, attn_type: str) -> bool:
"""CPU attention supports decoder,
encoder-only and encoder-decoder attention.
"""
encoder-only and encoder-decoder attention."""
return attn_type in (
AttentionType.DECODER,
AttentionType.ENCODER,
+1 -2
View File
@@ -398,8 +398,7 @@ class FlashInferBackend(AttentionBackend):
@classmethod
def customize_spec(cls, spec: "AttentionSpec") -> "AttentionSpec":
"""NVFP4 stores K and V as separate per-head slots of packed fp4 data
plus fp8 block scales.
"""
plus fp8 block scales."""
if spec.state_content_bytes is not None or not spec.kv_quant_mode.is_nvfp4:
return spec
hs_k = nvfp4_kv_cache_full_dim(spec.head_size)
+1 -2
View File
@@ -63,8 +63,7 @@ _SPLIT_OCCUPANCY_MULTIPLIER = 2
def _compute_num_kv_splits(max_seq_len: int, num_threads: int) -> int:
"""Mirrors TritonMLAImpl's _compute_num_kv_splits, using the CPU thread
count in place of SM count.
"""
count in place of SM count."""
ideal_splits = 1
while ideal_splits < max(1, max_seq_len // _MIN_WORK_PER_SPLIT):
ideal_splits *= 2
@@ -847,8 +847,7 @@ class FlashMLASparseImpl(SparseMLACommonImpl[FlashMLASparseMetadata]):
prefill_meta: "FlashMLASparseMetadata.FP8SeparatePrefillDecode.Prefill",
) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
"""All-gather this rank's upconverted KV shard so the chunk's rows attend
the whole context, and map their top-k onto the rank-major result.
"""
the whole context, and map their top-k onto the rank-major result."""
shard_rows = int(chunk.chunk_tot_seqlen)
assert self.gathered_kv_workspace is not None
gathered_kv = self.gathered_kv_workspace[: self.dcp_world_size * shard_rows]
+1 -2
View File
@@ -1118,8 +1118,7 @@ class DeepseekV32IndexerMetadataBuilder(AttentionMetadataBuilder):
def _prefill_split_seq_lens(self, seq_lens_cpu: torch.Tensor) -> torch.Tensor:
"""Per-request KV lengths the prefill chunker budgets logits with;
subclasses whose logits rows are wider than the context override.
"""
subclasses whose logits rows are wider than the context override."""
return seq_lens_cpu
@staticmethod
@@ -70,8 +70,7 @@ class MLAPrefillBackend(ABC):
def supports_quant_output(self, quant_key: "QuantKey") -> bool:
"""Whether `run_prefill_new_tokens` can write quantized output
directly (fused) for the given quant key, skipping the post-quant
pass. Overridden by backends that support it.
"""
pass. Overridden by backends that support it."""
return False
def supports_out(self) -> bool:
@@ -110,8 +110,7 @@ class RocmAiterUnifiedAttentionBackend(RocmAttentionBackend):
@classmethod
def customize_spec(cls, spec: AttentionSpec) -> AttentionSpec:
"""Keep K and V packed in the content dim, unlike the native HIP
kernels the base class targets.
"""
kernels the base class targets."""
# block_size == 1 is the per-token page-size probe (see
# Platform.get_page_size_bytes); real blocks must be gatherable in
# 16-token units by the ROCm kernel.
+1 -2
View File
@@ -244,8 +244,7 @@ class RocmAttentionBackend(AttentionBackend):
@classmethod
def customize_spec(cls, spec: AttentionSpec) -> AttentionSpec:
"""K and V as two head groups so the native HIP kernels address each side
as one contiguous region (x-packed interior applied in split_kv_cache).
"""
as one contiguous region (x-packed interior applied in split_kv_cache)."""
if spec.state_content_bytes is not None:
return spec
assert spec.head_size == spec.head_size_v, (
+1 -2
View File
@@ -275,8 +275,7 @@ class TritonAttentionBackend(AttentionBackend):
@classmethod
def customize_spec(cls, spec: "AttentionSpec") -> "AttentionSpec":
"""Per-token-head modes pack inline fp32 scales after each head's
data, so the content is (data + one scale) per K/V side.
"""
data, so the content is (data + one scale) per K/V side."""
mode = spec.kv_quant_mode
if spec.state_content_bytes is not None or not mode.is_per_token_head:
return spec
@@ -45,8 +45,7 @@ def _store_quantized_value(
BLOCK_GRP: tl.constexpr,
):
"""Uniform quantization of values to VQB bits, pack, and store with
scale/zero in the per-block SoA metadata region (Opt#3 layout).
"""
scale/zero in the per-block SoA metadata region (Opt#3 layout)."""
if VQB == 3:
val_vec = tl.load(Value_ptr + base + d_offs, mask=d_mask, other=0.0).to(
tl.float32