[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
@@ -274,8 +274,7 @@ def get_visible_memory_node() -> list[int]:
|
||||
def _synthesize_cpu_list() -> list[LogicalCPUInfo]:
|
||||
"""Synthesize a flat CPU list: each logical CPU is its own core on
|
||||
NUMA node 0. Used when lscpu output is unavailable or unparsable
|
||||
(e.g. macOS, RISC-V).
|
||||
"""
|
||||
(e.g. macOS, RISC-V)."""
|
||||
cpu_count = os.cpu_count()
|
||||
assert cpu_count
|
||||
return [LogicalCPUInfo(i, i, 0) for i in range(cpu_count)]
|
||||
|
||||
@@ -704,8 +704,7 @@ def fp8_fp4_paged_mqa_logits(
|
||||
|
||||
def has_deep_gemm_sparse_mqa() -> bool:
|
||||
"""Whether the installed DeepGEMM provides the sparse-indexer kernels
|
||||
(``fp8_fp4_(paged_)sparse_mqa_logits``, added in DeepGEMM 2.8, SM100-only).
|
||||
"""
|
||||
(``fp8_fp4_(paged_)sparse_mqa_logits``, added in DeepGEMM 2.8, SM100-only)."""
|
||||
_lazy_init()
|
||||
return (
|
||||
_fp8_fp4_sparse_mqa_logits_impl is not None
|
||||
|
||||
@@ -72,8 +72,7 @@ _sync_filter_head: tuple | None = None
|
||||
|
||||
def _sync_warning_hook(message, category, filename, lineno, file=None, line=None):
|
||||
"""Turn torch's sync warning into an error, but only on a thread that is
|
||||
being checked and is outside any allow region.
|
||||
"""
|
||||
being checked and is outside any allow region."""
|
||||
if _TORCH_SYNC_WARNING in str(message):
|
||||
mode = _checking.get()
|
||||
if mode is None or _allow_depth.get():
|
||||
@@ -252,8 +251,7 @@ def _is_dense(t: torch.Tensor) -> bool:
|
||||
"""Whether `t`'s elements fill a contiguous storage range, possibly
|
||||
permuted (e.g. a transposed matrix). Such layouts can be copied with
|
||||
pitched cudaMemcpy2D/3DAsync directly from/to pinned memory, whereas
|
||||
gapped layouts (e.g. strided slices) stage through a pageable temp.
|
||||
"""
|
||||
gapped layouts (e.g. strided slices) stage through a pageable temp."""
|
||||
if t.is_contiguous():
|
||||
# The common case, answered by a memoized TensorImpl flag.
|
||||
return True
|
||||
|
||||
@@ -29,8 +29,7 @@ def cuda_get_device_properties(
|
||||
device, names: Sequence[str], init_cuda=False
|
||||
) -> tuple[Any, ...]:
|
||||
"""Get specified CUDA device property values without initializing CUDA in
|
||||
the current process.
|
||||
"""
|
||||
the current process."""
|
||||
if init_cuda or cuda_is_initialized():
|
||||
props = torch.cuda.get_device_properties(device)
|
||||
return tuple(getattr(props, name) for name in names)
|
||||
|
||||
@@ -230,8 +230,7 @@ def _cgroup_cpu_limit() -> float | None:
|
||||
|
||||
def available_cpu_count() -> int:
|
||||
"""CPUs actually usable by this process: scheduling affinity capped by
|
||||
the cgroup CPU quota (unlike `os.cpu_count()`, which is quota-blind).
|
||||
"""
|
||||
the cgroup CPU quota (unlike `os.cpu_count()`, which is quota-blind)."""
|
||||
if sys.platform != "linux":
|
||||
return os.cpu_count() or 1
|
||||
count = len(os.sched_getaffinity(0))
|
||||
|
||||
Reference in New Issue
Block a user