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
+6 -3
View File
@@ -383,7 +383,8 @@ def _hash_ids(requests, tables_meta, block_table, cache=None, capture=False):
"""Run the op on a batch of (token_ids, start, window) requests; `window`
is the runner's [depth] lookback for that request (None = all unknown).
Token IDs 14 and 22 stand in for image tokens that break n-grams.
Returns one [len(token_ids), ...] hash tensor per request."""
Returns one [len(token_ids), ...] hash tensor per request.
"""
token_map, multipliers, primes, offsets, block_size = tables_meta
depth = multipliers.shape[1] - 1
@@ -442,7 +443,8 @@ def test_lookback_window_reproduces_single_instance(runner, capture):
V2 supplies every lookback from its device token history and needs no
slot cache. V1 supplies prompt positions only and reads generated
positions from the slot cache it fills itself. Without any window the
first decode token hashes stale slots (negative control)."""
first decode token hashes stale slots (negative control).
"""
block_size = 4
block_table = torch.tensor(
[[3, 1, 5, 0], [2, 4, 6, 7]], dtype=torch.int32, device="cuda"
@@ -708,7 +710,8 @@ def test_engram_lookup_reuses_jit_across_token_shapes():
def test_engram_lookup_matches_torch(cpu_offload, background, num_tokens):
"""The fused gather must be bit-exact with the torch dequant path it
replaces, from HBM and from pinned host memory alike, and must contribute
zeros for rows another TP rank owns."""
zeros for rows another TP rank owns.
"""
layer = _make_embedding(cpu_offload)
cols, rows = 24, layer.part_num_embeddings
ids = torch.randint(0, rows, (num_tokens, cols), dtype=torch.int32, device="cuda")