[Core] Make sleep-mode backend capability flags communicator-agnostic (#47243)
Nils Matteson committed
Jul 1, 2026 at 01:17 UTC
a461070d1c534885e8d092e1cf2be452d6cec7a0
2 files changed
+15
-14
tests/v1/worker/test_sleep_mode_backend.py
+5
-5
@@ -23,13 +23,13 @@ def test_cumem_is_the_default_registered_backend():
23
24
25
def test_cumem_capability_flags():
26
- # cumem leaves NCCL untouched but does not preserve compiled artifacts,
27
- # graphs, or durable state - these flags are what the executor and /health
28
- # introspect to decide reinit / persistence behavior.
26
+ # cumem leaves communicators untouched but does not preserve compiled
27
+ # artifacts, graphs, or durable state - these flags are what the executor and
28
+ # /health introspect to decide reinit / persistence behavior.
29
assert CuMemBackend.is_supported() is True
30
- assert CuMemBackend.preserves_nccl() is True
30
+ assert CuMemBackend.preserves_communicators() is True
31
assert CuMemBackend.preserves_compiled_artifacts() is False
32
- assert CuMemBackend.preserves_graphs_with_nccl() is False
32
+ assert CuMemBackend.preserves_graphs_with_communicators() is False
33
assert CuMemBackend.supports_durable_storage() is False
34
35
vllm/device_allocator/sleep_mode_backend.py
+10
-9
@@ -81,9 +81,9 @@ class SleepModeBackend(ABC):
81
return True
82
83
@classmethod
84
- def preserves_nccl(cls) -> bool:
85
- """If False, NCCL communicators are destroyed by ``suspend`` and the
86
- executor must re-initialize them on ``resume``."""
84
+ def preserves_communicators(cls) -> bool:
85
+ """If False, collective communicators (e.g. NCCL) are destroyed by
86
+ ``suspend`` and the executor must re-initialize them on ``resume``."""
87
return False
88
89
@classmethod
@@ -93,9 +93,10 @@ class SleepModeBackend(ABC):
93
return False
94
95
@classmethod
96
- def preserves_graphs_with_nccl(cls) -> bool:
97
- """If True, CUDA graphs containing NCCL collectives stay valid after
98
- resume. False when NCCL is rebuilt (embedded comm handles go stale)."""
96
+ def preserves_graphs_with_communicators(cls) -> bool:
97
+ """If True, CUDA graphs containing collective communicators (e.g. NCCL)
98
+ stay valid after resume. False when communicators are rebuilt (embedded
99
+ comm handles go stale)."""
100
return False
101
102
@classmethod
@@ -132,9 +133,9 @@ class CuMemBackend(SleepModeBackend):
133
self._state = "RUNNING"
134
135
@classmethod
135
- def preserves_nccl(cls) -> bool:
136
- # NCCL buffers live outside CuMemAllocator's pool, so an allocator-level
137
- # sleep leaves the communicators intact (no reinit needed on resume).
136
+ def preserves_communicators(cls) -> bool:
137
+ # Communicator buffers (e.g. NCCL) live outside CuMemAllocator's pool, so
138
+ # an allocator-level sleep leaves them intact (no reinit needed on resume).
139
return True
140
141