From a461070d1c534885e8d092e1cf2be452d6cec7a0 Mon Sep 17 00:00:00 2001 From: Nils Matteson Date: Wed, 1 Jul 2026 01:17:44 -0600 Subject: [PATCH] [Core] Make sleep-mode backend capability flags communicator-agnostic (#47243) --- tests/v1/worker/test_sleep_mode_backend.py | 10 +++++----- vllm/device_allocator/sleep_mode_backend.py | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/v1/worker/test_sleep_mode_backend.py b/tests/v1/worker/test_sleep_mode_backend.py index 684ff87837..4ec9f0bf12 100644 --- a/tests/v1/worker/test_sleep_mode_backend.py +++ b/tests/v1/worker/test_sleep_mode_backend.py @@ -23,13 +23,13 @@ def test_cumem_is_the_default_registered_backend(): def test_cumem_capability_flags(): - # cumem leaves NCCL untouched but does not preserve compiled artifacts, - # graphs, or durable state - these flags are what the executor and /health - # introspect to decide reinit / persistence behavior. + # cumem leaves communicators untouched but does not preserve compiled + # artifacts, graphs, or durable state - these flags are what the executor and + # /health introspect to decide reinit / persistence behavior. assert CuMemBackend.is_supported() is True - assert CuMemBackend.preserves_nccl() is True + assert CuMemBackend.preserves_communicators() is True assert CuMemBackend.preserves_compiled_artifacts() is False - assert CuMemBackend.preserves_graphs_with_nccl() is False + assert CuMemBackend.preserves_graphs_with_communicators() is False assert CuMemBackend.supports_durable_storage() is False diff --git a/vllm/device_allocator/sleep_mode_backend.py b/vllm/device_allocator/sleep_mode_backend.py index fe0b31a60d..0f1e243344 100644 --- a/vllm/device_allocator/sleep_mode_backend.py +++ b/vllm/device_allocator/sleep_mode_backend.py @@ -81,9 +81,9 @@ class SleepModeBackend(ABC): return True @classmethod - def preserves_nccl(cls) -> bool: - """If False, NCCL communicators are destroyed by ``suspend`` and the - executor must re-initialize them on ``resume``.""" + def preserves_communicators(cls) -> bool: + """If False, collective communicators (e.g. NCCL) are destroyed by + ``suspend`` and the executor must re-initialize them on ``resume``.""" return False @classmethod @@ -93,9 +93,10 @@ class SleepModeBackend(ABC): return False @classmethod - def preserves_graphs_with_nccl(cls) -> bool: - """If True, CUDA graphs containing NCCL collectives stay valid after - resume. False when NCCL is rebuilt (embedded comm handles go stale).""" + def preserves_graphs_with_communicators(cls) -> bool: + """If True, CUDA graphs containing collective communicators (e.g. NCCL) + stay valid after resume. False when communicators are rebuilt (embedded + comm handles go stale).""" return False @classmethod @@ -132,9 +133,9 @@ class CuMemBackend(SleepModeBackend): self._state = "RUNNING" @classmethod - def preserves_nccl(cls) -> bool: - # NCCL buffers live outside CuMemAllocator's pool, so an allocator-level - # sleep leaves the communicators intact (no reinit needed on resume). + def preserves_communicators(cls) -> bool: + # Communicator buffers (e.g. NCCL) live outside CuMemAllocator's pool, so + # an allocator-level sleep leaves them intact (no reinit needed on resume). return True