[Core] Make sleep-mode backend capability flags communicator-agnostic (#47243)
This commit is contained in:
@@ -23,13 +23,13 @@ def test_cumem_is_the_default_registered_backend():
|
|||||||
|
|
||||||
|
|
||||||
def test_cumem_capability_flags():
|
def test_cumem_capability_flags():
|
||||||
# cumem leaves NCCL untouched but does not preserve compiled artifacts,
|
# cumem leaves communicators untouched but does not preserve compiled
|
||||||
# graphs, or durable state - these flags are what the executor and /health
|
# artifacts, graphs, or durable state - these flags are what the executor and
|
||||||
# introspect to decide reinit / persistence behavior.
|
# /health introspect to decide reinit / persistence behavior.
|
||||||
assert CuMemBackend.is_supported() is True
|
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_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
|
assert CuMemBackend.supports_durable_storage() is False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -81,9 +81,9 @@ class SleepModeBackend(ABC):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def preserves_nccl(cls) -> bool:
|
def preserves_communicators(cls) -> bool:
|
||||||
"""If False, NCCL communicators are destroyed by ``suspend`` and the
|
"""If False, collective communicators (e.g. NCCL) are destroyed by
|
||||||
executor must re-initialize them on ``resume``."""
|
``suspend`` and the executor must re-initialize them on ``resume``."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -93,9 +93,10 @@ class SleepModeBackend(ABC):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def preserves_graphs_with_nccl(cls) -> bool:
|
def preserves_graphs_with_communicators(cls) -> bool:
|
||||||
"""If True, CUDA graphs containing NCCL collectives stay valid after
|
"""If True, CUDA graphs containing collective communicators (e.g. NCCL)
|
||||||
resume. False when NCCL is rebuilt (embedded comm handles go stale)."""
|
stay valid after resume. False when communicators are rebuilt (embedded
|
||||||
|
comm handles go stale)."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -132,9 +133,9 @@ class CuMemBackend(SleepModeBackend):
|
|||||||
self._state = "RUNNING"
|
self._state = "RUNNING"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def preserves_nccl(cls) -> bool:
|
def preserves_communicators(cls) -> bool:
|
||||||
# NCCL buffers live outside CuMemAllocator's pool, so an allocator-level
|
# Communicator buffers (e.g. NCCL) live outside CuMemAllocator's pool, so
|
||||||
# sleep leaves the communicators intact (no reinit needed on resume).
|
# an allocator-level sleep leaves them intact (no reinit needed on resume).
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user