[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
+4 -8
View File
@@ -62,8 +62,7 @@ class AttentionState(NamedTuple):
@dataclass(frozen=True)
class BatchExecutionDescriptor:
"""Describes the shape of the batch and CG mode to run; this is used to make shape
matches between the capture and runtime.
"""
matches between the capture and runtime."""
cg_mode: CUDAGraphMode
num_tokens: int
@@ -91,8 +90,7 @@ def make_cudagraph_stats(
class CreateForwardFn(Protocol):
"""Factory that prepares inputs (OUTSIDE the graph) and returns a
forward_fn. Called with warmup=True for the warmup pass and warmup=False
for the captured pass.
"""
for the captured pass."""
def __call__(
self,
@@ -955,8 +953,7 @@ def profile_cudagraph_memory(runner: "GPUModelRunner") -> int:
def _extrapolate_full_graph_memory(mem_samples: list[int], total_graphs: int) -> int:
"""Extrapolate the total FULL capture cost from samples of the largest
graphs. The first capture allocates the pool baseline; later graphs mostly
reuse it, so the second sample is taken as the per-graph cost.
"""
reuse it, so the second sample is taken as the per-graph cost."""
if not mem_samples:
return 0
first_capture = mem_samples[0]
@@ -993,8 +990,7 @@ def _init_minimal_kv_cache_for_profiling(runner: "GPUModelRunner") -> None:
def _teardown_profiling_state(runner: "GPUModelRunner") -> None:
"""Release the profiling KV cache and captured graphs while keeping model
weights, so the real ``initialize_kv_cache`` starts from a clean slate.
"""
weights, so the real ``initialize_kv_cache`` starts from a clean slate."""
torch.accelerator.synchronize()
if hasattr(runner.model_state, "_mamba_ctx"):
runner.model_state._mamba_ctx = None