[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:
co-authored by
Claude Opus 5
parent
1085b64425
commit
651a88c09a
@@ -126,8 +126,7 @@ def _canonical_handler(gpu_tensor, cpu_tensor, mapping, gpu_to_cpu):
|
||||
def test_gpu_roundtrip_assembles_canonical_page_across_ranks():
|
||||
"""Two TP2-style rank handlers must scatter into one shared canonical
|
||||
CPU page such that each rank reloads bit-exact and a whole-page (TP1)
|
||||
reader sees both shards — the cross-topology contract.
|
||||
"""
|
||||
reader sees both shards — the cross-topology contract."""
|
||||
torch.manual_seed(0)
|
||||
num_blocks = 4
|
||||
gpu_rank = [
|
||||
@@ -204,8 +203,7 @@ def _nhd_shard_mapping(tp: int, rank: int) -> CanonicalPageMapping:
|
||||
|
||||
def _head_shard(full_kv: torch.Tensor, tp: int, rank: int) -> torch.Tensor:
|
||||
"""This rank's local page rows out of the (blocks, 2, tokens, heads,
|
||||
head_bytes) ground truth.
|
||||
"""
|
||||
head_bytes) ground truth."""
|
||||
local_heads = _TOTAL_HEADS // tp
|
||||
shard = full_kv[:, :, :, rank * local_heads : (rank + 1) * local_heads, :]
|
||||
return shard.reshape(full_kv.shape[0], -1).contiguous()
|
||||
@@ -216,8 +214,7 @@ def _head_shard(full_kv: torch.Tensor, tp: int, rank: int) -> torch.Tensor:
|
||||
def test_cross_topology_roundtrip(writer_tp: int, reader_tp: int):
|
||||
"""KV written at one tp must be readable at another: writer ranks scatter
|
||||
head shards into a shared canonical region, reader ranks gather their own
|
||||
shards, and every reader must see the writers' ground-truth bytes.
|
||||
"""
|
||||
shards, and every reader must see the writers' ground-truth bytes."""
|
||||
torch.manual_seed(0)
|
||||
num_blocks = 3
|
||||
full_kv = torch.randint(
|
||||
|
||||
Reference in New Issue
Block a user