[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
@@ -59,8 +59,7 @@ def test_with_env_set(monkeypatch, mode):
|
||||
@create_new_process_for_each_test()
|
||||
def test_other_threads_are_not_policed(monkeypatch):
|
||||
"""A background thread that syncs deliberately must not be broken by the
|
||||
check being armed on the thread running the decorated function.
|
||||
"""
|
||||
check being armed on the thread running the decorated function."""
|
||||
monkeypatch.setattr(gsd, "_SYNC_CHECK_MODE", "error")
|
||||
monkeypatch.setattr(gsd, "_sync_check_enabled", True)
|
||||
|
||||
@@ -85,8 +84,7 @@ def test_other_threads_are_not_policed(monkeypatch):
|
||||
def test_allow_on_other_thread_does_not_disarm(monkeypatch):
|
||||
"""`gpu_sync_allowed()` on one thread must not suppress the check on
|
||||
another. It is scoped by ContextVar rather than torch's process-global
|
||||
sync debug mode, which a previous implementation mutated.
|
||||
"""
|
||||
sync debug mode, which a previous implementation mutated."""
|
||||
monkeypatch.setattr(gsd, "_SYNC_CHECK_MODE", "error")
|
||||
monkeypatch.setattr(gsd, "_sync_check_enabled", True)
|
||||
|
||||
@@ -115,8 +113,7 @@ def test_allow_on_other_thread_does_not_disarm(monkeypatch):
|
||||
def test_suppressing_works_while_compiling(monkeypatch):
|
||||
"""`_suppressing` wraps torch compile entry points, which run with
|
||||
`torch.compiler.is_compiling()` true. `gpu_sync_allowed()` deliberately
|
||||
no-ops in that state, so `_suppressing` must not route through it.
|
||||
"""
|
||||
no-ops in that state, so `_suppressing` must not route through it."""
|
||||
monkeypatch.setattr(gsd, "_SYNC_CHECK_MODE", "error")
|
||||
monkeypatch.setattr(gsd, "_sync_check_enabled", True)
|
||||
# Emulate being inside a torch compile, as inductor passes are.
|
||||
@@ -148,8 +145,7 @@ def test_copy_checker_is_traceable_while_compiling(monkeypatch):
|
||||
def test_sync_debug_mode_restored_after_checked_call(monkeypatch):
|
||||
"""The mode is armed only for the duration of a checked call. Leaving it
|
||||
on process-wide made every sync outside a checked region emit a
|
||||
`UserWarning` whenever our handler was not the installed one.
|
||||
"""
|
||||
`UserWarning` whenever our handler was not the installed one."""
|
||||
monkeypatch.setattr(gsd, "_SYNC_CHECK_MODE", "error")
|
||||
monkeypatch.setattr(gsd, "_sync_check_enabled", True)
|
||||
|
||||
@@ -294,8 +290,7 @@ def test_genuinely_async_transfers_pass(monkeypatch):
|
||||
asynchronous in both directions -- even with a dtype conversion, which
|
||||
runs GPU-side, and even permuted (e.g. transposed), which uses pitched
|
||||
cudaMemcpy2D/3DAsync; D2H `Tensor.to` allocates a pinned destination.
|
||||
None of these may be flagged.
|
||||
"""
|
||||
None of these may be flagged."""
|
||||
monkeypatch.setattr(gsd, "_SYNC_CHECK_MODE", "error")
|
||||
monkeypatch.setattr(gsd, "_sync_check_enabled", True)
|
||||
gsd._install_copy_checkers()
|
||||
|
||||
@@ -29,8 +29,7 @@ def test_get_file_store_init_method_is_unique():
|
||||
|
||||
def _call_with_timeout(func, timeout: float = 10.0):
|
||||
"""Run func in a daemon thread so a livelock regression fails the test
|
||||
quickly instead of hanging the suite.
|
||||
"""
|
||||
quickly instead of hanging the suite."""
|
||||
result: dict = {}
|
||||
|
||||
def target():
|
||||
@@ -97,8 +96,7 @@ def test_get_open_port_skips_reserved_dp_master_ports(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
"""VLLM_PORT == VLLM_DP_MASTER_PORT must not livelock by returning the
|
||||
same free-but-reserved port forever (upstream issue #50024).
|
||||
"""
|
||||
same free-but-reserved port forever (upstream issue #50024)."""
|
||||
base = 42123
|
||||
with monkeypatch.context() as m:
|
||||
m.setenv("VLLM_PORT", str(base))
|
||||
@@ -111,8 +109,7 @@ def test_get_open_ports_list_skips_reserved_dp_master_ports(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
"""The VLLM_PORT band scan must not hand out ports inside the window
|
||||
reserved for the data parallel master process.
|
||||
"""
|
||||
reserved for the data parallel master process."""
|
||||
base = 42223
|
||||
reserved = range(base, base + 10)
|
||||
with monkeypatch.context() as m:
|
||||
@@ -128,8 +125,7 @@ def test_get_open_port_ephemeral_skips_reserved_range(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
"""An ephemeral port that happens to fall in the reserved range is
|
||||
replaced by a rescan starting past the range.
|
||||
"""
|
||||
replaced by a rescan starting past the range."""
|
||||
base = 42323
|
||||
with monkeypatch.context() as m:
|
||||
m.delenv("VLLM_PORT", raising=False)
|
||||
@@ -148,8 +144,7 @@ def test_get_open_port_ephemeral_without_dp_master_port(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
):
|
||||
"""Without VLLM_PORT and VLLM_DP_MASTER_PORT, an ephemeral port is
|
||||
returned as before.
|
||||
"""
|
||||
returned as before."""
|
||||
with monkeypatch.context() as m:
|
||||
m.delenv("VLLM_PORT", raising=False)
|
||||
m.delenv("VLLM_DP_MASTER_PORT", raising=False)
|
||||
|
||||
@@ -157,8 +157,7 @@ def test_pct_binding_filters_cpus(monkeypatch):
|
||||
)
|
||||
def test_pct_binding_fires_on_every_capable_sku(monkeypatch, sku, expected_cpus):
|
||||
"""Each SKU in ``_PCT_CAPABLE_SKUS`` engages the gate at its own
|
||||
expected ``highest_perf`` and uses its own priority-core stride.
|
||||
"""
|
||||
expected ``highest_perf`` and uses its own priority-core stride."""
|
||||
sku_config = numa_utils._PCT_CAPABLE_SKUS[sku]
|
||||
_patch_pct_gates(
|
||||
monkeypatch,
|
||||
@@ -243,8 +242,7 @@ def test_get_numactl_args_engine_core_baseline_spans_shard_numa_nodes():
|
||||
def test_get_numactl_args_engine_core_pct_spans_shard_numa_nodes(monkeypatch):
|
||||
"""PCT: EngineCore for a multi-NUMA shard binds to the union of priority
|
||||
cores across all shard nodes, so worker `--physcpubind` is always a
|
||||
subset of EngineCore's `cpus_allowed`.
|
||||
"""
|
||||
subset of EngineCore's `cpus_allowed`."""
|
||||
_patch_pct_gates(
|
||||
monkeypatch,
|
||||
model_match=True,
|
||||
@@ -294,8 +292,7 @@ def test_get_numactl_args_engine_core_pct_external_launcher_spans_local_nodes(
|
||||
"""external_launcher (or multi-node-within-DP, or Ray) hits the
|
||||
fallback branch. EngineCore must still span every local NUMA node
|
||||
so it can mp-spawn its local workers without ``--physcpubind``
|
||||
strict-validation failures.
|
||||
"""
|
||||
strict-validation failures."""
|
||||
_patch_pct_gates(
|
||||
monkeypatch,
|
||||
model_match=True,
|
||||
@@ -319,8 +316,7 @@ def test_get_numactl_args_engine_core_pct_external_launcher_spans_local_nodes(
|
||||
|
||||
def test_get_numactl_args_engine_core_baseline_multi_node_within_dp_spans_locals():
|
||||
"""Multi-node-within-DP fallback: bind EngineCore to all local NUMA
|
||||
nodes that the visible ``numa_bind_nodes`` reference.
|
||||
"""
|
||||
nodes that the visible ``numa_bind_nodes`` reference."""
|
||||
vllm_config = _make_config(
|
||||
numa_bind=True,
|
||||
numa_bind_nodes=[0, 0, 0, 0, 1, 1, 1, 1],
|
||||
@@ -343,8 +339,7 @@ def test_get_numactl_args_engine_core_skips_user_cpu_list(monkeypatch):
|
||||
``--physcpubind`` spawns need. We fall back to ``--cpunodebind`` over
|
||||
the shard's NUMA nodes instead. PCT auto-detect is also bypassed when
|
||||
the user is explicit (its priority-core union may not be a superset
|
||||
of the user's per-worker cores).
|
||||
"""
|
||||
of the user's per-worker cores)."""
|
||||
_patch_pct_gates(monkeypatch, model_match=True, highest_perf=46)
|
||||
vllm_config = _make_config(
|
||||
numa_bind=True,
|
||||
@@ -397,8 +392,7 @@ def test_get_numactl_args_requires_detectable_nodes(monkeypatch):
|
||||
def test_configure_subprocess_rejects_unknown_process_kind():
|
||||
"""configure_subprocess only knows 'worker' and 'EngineCore'; anything
|
||||
else must raise ValueError instead of silently routing to the worker
|
||||
path.
|
||||
"""
|
||||
path."""
|
||||
vllm_config = _make_config(numa_bind=True, numa_bind_nodes=[0])
|
||||
with (
|
||||
pytest.raises(ValueError, match="process_kind"),
|
||||
|
||||
Reference in New Issue
Block a user