unilab.ipc.replay_pipelines.transfer

Device transfer backends for replay pipelines.

class unilab.ipc.replay_pipelines.transfer.ReplayTransferBackend[source]

Bases: Protocol

Device-specific host-to-device transfer backend.

device: device
device_family: str
h2d_submitter: str
host_memory_kind: str
host_pinned: bool
direct_pinned_shared: bool
supports_async_submit: bool
supports_timing_events: bool
register_host_slots(slots)[source]
Parameters:

slots (list[Tensor])

Return type:

None

allocate_device_slots(*, count, shape, dtype)[source]
Parameters:
Return type:

list[Tensor]

submit_h2d(*, slot, dst, src, metadata, trace_recorder, trace_cuda_events, h2d_bytes, pack_layout, pack_executor)[source]
Parameters:
Return type:

float

clear_ready(slot)[source]
Parameters:

slot (int)

Return type:

None

ready_query(slot)[source]
Parameters:

slot (int)

Return type:

bool

synchronize_ready(slot)[source]
Parameters:

slot (int)

Return type:

None

wait_current_stream_for_ready(slot)[source]
Parameters:

slot (int)

Return type:

None

close()[source]
Return type:

None

__init__(*args, **kwargs)
class unilab.ipc.replay_pipelines.transfer.XpuReplayTransferBackend[source]

Bases: object

XPU stream/event backend for packed replay batch transfer.

Parameters:
device_family = 'xpu'
h2d_submitter = 'torch_xpu_copy_stream'
host_memory_kind = 'pageable_shared'
host_pinned = False
direct_pinned_shared = False
supports_async_submit = True
supports_timing_events = False
__init__(*, device, ring_depth)[source]
Parameters:
register_host_slots(slots)[source]
Parameters:

slots (list[Tensor])

Return type:

None

allocate_device_slots(*, count, shape, dtype)[source]
Parameters:
Return type:

list[Tensor]

submit_h2d(*, slot, dst, src, metadata, trace_recorder, trace_cuda_events, h2d_bytes, pack_layout, pack_executor)[source]
Parameters:
Return type:

float

clear_ready(slot)[source]
Parameters:

slot (int)

Return type:

None

ready_query(slot)[source]
Parameters:

slot (int)

Return type:

bool

synchronize_ready(slot)[source]
Parameters:

slot (int)

Return type:

None

wait_current_stream_for_ready(slot)[source]
Parameters:

slot (int)

Return type:

None

close()[source]
Return type:

None

unilab.ipc.replay_pipelines.transfer.build_replay_transfer_backend(*, device, ring_depth)[source]

Build the transfer backend for a learner device.

Parameters:
Return type:

ReplayTransferBackend

Modules

base

Replay transfer backend contract.

cuda_like

CUDA/ROCm replay transfer backend.

factory

Replay transfer backend factory.

torch_copy

Portable torch-copy replay transfer backend.

xpu

Intel XPU replay transfer backend.