MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / execute_transfer

Function execute_transfer

deepspeed/checkpoint/affine_transfer_executor.py:260–274  ·  view source on GitHub ↗

Execute one plan with the same preflight and completion contract as a batch. Bindings use transport-group ranks. Buffers must be packed views on the owning process; their storage offsets are retained. Rejection on any participant precedes all target writes. Transport failures after payl

(plan: TransferPlan,
                     source_buffers: Mapping[int, torch.Tensor],
                     target_buffers: Mapping[int, torch.Tensor],
                     endpoints: TransferEndpoints,
                     dtype: torch.dtype,
                     budget: StagingBudget = StagingBudget(),
                     group: Optional[object] = None)

Source from the content-addressed store, hash-verified

258
259
260def execute_transfer(plan: TransferPlan,
261 source_buffers: Mapping[int, torch.Tensor],
262 target_buffers: Mapping[int, torch.Tensor],
263 endpoints: TransferEndpoints,
264 dtype: torch.dtype,
265 budget: StagingBudget = StagingBudget(),
266 group: Optional[object] = None) -> TransferStats:
267 """Execute one plan with the same preflight and completion contract as a batch.
268
269 Bindings use transport-group ranks. Buffers must be packed views on the owning process;
270 their storage offsets are retained. Rejection on any participant precedes all target writes.
271 Transport failures after payload begins may leave partially written targets.
272 """
273 request = TransferRequest('parameter', plan, source_buffers, target_buffers)
274 return execute_transfers([request], endpoints, dtype, budget, group)
275
276
277def _packed_rounds(indexed_operations: Sequence[Tuple[int, _Operation]], max_elements: int):

Calls 3

StagingBudgetClass · 0.85
TransferRequestClass · 0.85
execute_transfersFunction · 0.85