[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
@@ -62,8 +62,7 @@ def _cuda_device_count_stateless(cuda_visible_devices: str | None = None) -> int
|
||||
CUDA_VISIBLE_DEVICES has already been set to the desired value.
|
||||
|
||||
# This can be removed and simply replaced with torch.cuda.get_device_count
|
||||
# after https://github.com/pytorch/pytorch/pull/122815 is released.
|
||||
"""
|
||||
# after https://github.com/pytorch/pytorch/pull/122815 is released."""
|
||||
# Note: cuda_visible_devices is not used, but we keep it as an argument for
|
||||
# LRU Cache purposes.
|
||||
|
||||
|
||||
@@ -42,8 +42,7 @@ def set_assigned_physical_gpu_ids(ids: list[int]) -> None:
|
||||
Idempotent: a second call with the same value is a no-op.
|
||||
Raises RuntimeError if called again with a different value.
|
||||
|
||||
This is expected to run during single-threaded worker initialization.
|
||||
"""
|
||||
This is expected to run during single-threaded worker initialization."""
|
||||
global _assigned_physical_gpu_ids
|
||||
if _assigned_physical_gpu_ids is not None:
|
||||
if _assigned_physical_gpu_ids != ids:
|
||||
|
||||
@@ -91,8 +91,7 @@ def _rocm_device_count_stateless(cuda_visible_devices: str | None = None) -> int
|
||||
CUDA_VISIBLE_DEVICES has already been set to the desired value.
|
||||
|
||||
# This can be removed and simply replaced with torch.cuda.get_device_count
|
||||
# after https://github.com/pytorch/pytorch/pull/122815 is released.
|
||||
"""
|
||||
# after https://github.com/pytorch/pytorch/pull/122815 is released."""
|
||||
# Note: cuda_visible_devices is not used, but we keep it as an argument for
|
||||
# LRU Cache purposes.
|
||||
|
||||
@@ -127,8 +126,7 @@ def _get_wsl_kernel_version() -> tuple[int, ...] | None:
|
||||
|
||||
def _sync_hip_cuda_env_vars():
|
||||
"""Ensure HIP_VISIBLE_DEVICES and CUDA_VISIBLE_DEVICES are consistent.
|
||||
Treats empty string as unset. Raises on genuine conflicts.
|
||||
"""
|
||||
Treats empty string as unset. Raises on genuine conflicts."""
|
||||
hip_val = os.environ.get("HIP_VISIBLE_DEVICES") or None
|
||||
cuda_val = os.environ.get("CUDA_VISIBLE_DEVICES") or None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user