[ROCm] Enable the cuMem CUDA-graph pool offload on ROCm (#59523)

Signed-off-by: aoshen02 <aoshen@inferact.ai>
Signed-off-by: indianspeedster <cspandey016@gmail.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: indianspeedster <cspandey016@gmail.com>
This commit is contained in:
aoshen02
2026-10-09 08:29:55 +00:00
committed by GitHub
co-authored by Claude Fable 5.1 indianspeedster
parent bacbbe1878
commit a6f43e57d6
9 changed files with 84 additions and 38 deletions
@@ -30,6 +30,8 @@ class AiterCustomAllreduce:
group: ProcessGroup,
device: int | str | torch.device,
max_size: int | None = None,
*,
register_graph_buffers: bool = True,
):
from aiter.dist.device_communicators.custom_all_reduce import (
CustomAllreduce as _AiterCustomAllreduce,
@@ -38,7 +40,10 @@ class AiterCustomAllreduce:
if max_size is None:
max_size = self.MAX_SIZE
self._impl = _AiterCustomAllreduce(group, device, max_size=max_size)
kwargs = {}
if not register_graph_buffers:
kwargs["enable_register_for_capturing"] = False
self._impl = _AiterCustomAllreduce(group, device, max_size=max_size, **kwargs)
@property
def aiter_ca(self):
@@ -151,6 +151,7 @@ class CudaCommunicator(DeviceCommunicatorBase):
self.aiter_ar_comm = AiterCustomAllreduce(
group=self.cpu_group,
device=self.device,
register_graph_buffers=register,
)
if use_custom_allreduce and self.aiter_ar_comm is None and self.world_size > 1:
@@ -174,6 +175,7 @@ class CudaCommunicator(DeviceCommunicatorBase):
self.aiter_ar_comm = AiterCustomAllreduce(
group=self.cpu_group,
device=self.device,
register_graph_buffers=register,
)
if self.aiter_ar_comm.disabled:
self.aiter_ar_comm = None