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
@@ -54,7 +54,8 @@ def _get_flashinfer_dsv4_workspace(device: torch.device) -> torch.Tensor:
def _packed_block_span(pool: torch.Tensor) -> int:
"""Per-block stride of ``pool`` in tokens (``stride(0)//stride(-2)``): ==
block_size for unpacked KV, larger when packed (#44577). Raises if not
token-aligned."""
token-aligned.
"""
block_stride = pool.stride(0)
token_stride = pool.stride(-2)
if block_stride % token_stride != 0:
+4 -2
View File
@@ -1179,7 +1179,8 @@ class DeepseekV41LLMForCausalLM(
@property
def token_lookback_depth(self) -> int:
"""Tokens before a chunk start the engram hash needs; the model runner
passes them as `lookback_token_ids`."""
passes them as `lookback_token_ids`.
"""
engram_hash = self.model.engram_hash
return engram_hash.lookback_depth if engram_hash is not None else 0
@@ -1203,7 +1204,8 @@ class DeepseekV41LLMForCausalLM(
def get_mtp_target_hidden_states(self) -> torch.Tensor | None:
"""Pre-collapse residual stream buffer (max_num_batched_tokens,
hc_mult * hidden_size) for the MTP draft model. Populated by
forward(); valid after each target step."""
forward(); valid after each target step.
"""
return getattr(self.model, "_mtp_hidden_buffer", None)
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
+2 -1
View File
@@ -209,7 +209,8 @@ class DeepseekV41ForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, Supports
self, image_embeds: torch.Tensor, types: torch.Tensor
) -> torch.Tensor:
"""Full image span: aligner rows at IMAGE slots, the learned
delimiter vectors at IMAGE_START/IMAGE_NEW_LINE/IMAGE_END."""
delimiter vectors at IMAGE_START/IMAGE_NEW_LINE/IMAGE_END.
"""
types = types.to(image_embeds.device)
span = image_embeds.new_empty(types.numel(), image_embeds.shape[-1])
dtype = image_embeds.dtype