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
@@ -37,6 +37,7 @@ class InklingLogitsProcessor(LogitsProcessor):
soft_cap: Optional logit soft cap (``None`` for the served checkpoint).
logits_mup_width_multiplier: muP width divisor for the final logits;
``None`` or ``0`` disables it.
"""
def __init__(
+2 -1
View File
@@ -72,7 +72,8 @@ def _sconv_add_norm(
ROCm uses the portable collective path. The Lamport P2P implementation in
the NVIDIA model relies on CUDA GDC and CUDA-specific symmetric-memory
publication semantics which cannot be linked into a gfx950 HSACO."""
publication semantics which cannot be linked into a gfx950 HSACO.
"""
norm_w = norm.weight if norm is not None else None
eps = norm.variance_epsilon if norm is not None else 0.0
+6 -3
View File
@@ -192,7 +192,8 @@ def inkling_gate_select(
class InklingGate(nn.Module):
"""Sigmoid gate with selection bias, log-sigmoid renorm after top-k, and
global scale (the served checkpoint's only configuration)."""
global scale (the served checkpoint's only configuration).
"""
def __init__(
self,
@@ -246,7 +247,8 @@ class InklingGate(nn.Module):
self, gating_output: torch.Tensor
) -> tuple[torch.Tensor, torch.Tensor]:
"""Full selection: (weights, ids) of [T, K + S]. The first K entries
are the routed top-k; the S trailing entries are the sink gammas."""
are the routed top-k; the S trailing entries are the sink gammas.
"""
return inkling_gate_select(
gating_output,
self.n_total_experts,
@@ -267,7 +269,8 @@ class InklingGate(nn.Module):
def _inkling_moe_ep_size() -> int:
"""EP size the MoERunner layer will run with (mirrors
FusedMoEParallelConfig.make: experts shard over tp * dp * pcp when
expert parallelism is enabled)."""
expert parallelism is enabled).
"""
parallel_config = get_current_vllm_config().parallel_config
if not parallel_config.enable_expert_parallel:
return 1
+6 -3
View File
@@ -166,7 +166,8 @@ class InklingMultiTokenPredictor(nn.Module):
) -> torch.Tensor:
"""Draft-prefill embedding: fused gather + backbone embed_norm, then
the target's tower embeddings scattered in unnormed (the backbone
convention — MM embeds are merged after embed_norm)."""
convention — MM embeds are merged after embed_norm).
"""
norm = self.backbone_embed_norm
embeds = embed_rmsnorm(
input_ids,
@@ -195,7 +196,8 @@ class InklingMultiTokenPredictor(nn.Module):
"""The depth layer's [rmsnorm(hidden) | embed_norm(embed)] input in one
launch: embedding row gather + the backbone embed_norm + the depth
embed_norm chain on one side, hidden_norm on the other, written
straight into the cat buffer."""
straight into the cat buffer.
"""
hidden_w = layer.hidden_norm.weight
embed_w = layer.embed_norm.weight
eps = layer.hidden_norm.variance_epsilon
@@ -327,7 +329,8 @@ class InklingMTP(nn.Module, SupportsMultiModalEmbeddings):
"""Greedy draft tokens via rank-local argmax + tiny (value, index)
reduction — no full-vocab logits all-gather. The muP divisor is a
positive scalar, so the argmax is invariant and the scaling is
skipped entirely."""
skipped entirely.
"""
return self.logits_processor.get_top_tokens(self.lm_head, hidden_states)
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
+4 -2
View File
@@ -238,7 +238,8 @@ def embed_rmsnorm(
embedding-table gather.
``chain_weight`` additionally emits ``rmsnorm(out, chain_weight)`` (the
first decoder layer's pre-attention norm) as a second output, still one
launch. Bit-exact vs the unfused module sequence."""
launch. Bit-exact vs the unfused module sequence.
"""
ids = input_ids.view(-1)
(T,) = ids.shape
n = embed_table.shape[1]
@@ -332,7 +333,8 @@ def embed_dual_rmsnorm_cat(
(draft decode steps) or precomputed ``embeds`` ([T, N], the target-merged
multimodal embeddings at draft prefill); ``pre_norm_weight`` chains the
backbone embed_norm in front of the depth embed_norm (bit-exact vs the
unfused sequence). The concat copies collapse into direct writes."""
unfused sequence). The concat copies collapse into direct writes.
"""
T, n = hidden.shape
if embeds is not None:
assert embeds.shape == hidden.shape