Skip to main content

WorkerTransfers

Trait WorkerTransfers 

Source
pub trait WorkerTransfers: Send + Sync {
    // Required methods
    fn execute_local_transfer(
        &self,
        src: LogicalLayoutHandle,
        dst: LogicalLayoutHandle,
        src_block_ids: Arc<[BlockId]>,
        dst_block_ids: Arc<[BlockId]>,
        options: TransferOptions,
    ) -> Result<TransferCompleteNotification>;
    fn execute_remote_onboard(
        &self,
        src: RemoteDescriptor,
        dst: LogicalLayoutHandle,
        dst_block_ids: Arc<[BlockId]>,
        options: TransferOptions,
    ) -> Result<TransferCompleteNotification>;
    fn execute_remote_offload(
        &self,
        src: LogicalLayoutHandle,
        src_block_ids: Arc<[BlockId]>,
        dst: RemoteDescriptor,
        options: TransferOptions,
    ) -> Result<TransferCompleteNotification>;
    fn connect_remote(
        &self,
        instance_id: InstanceId,
        metadata: Vec<SerializedLayout>,
    ) -> Result<ConnectRemoteResponse>;
    fn has_remote_metadata(&self, instance_id: InstanceId) -> bool;
    fn execute_remote_onboard_for_instance(
        &self,
        instance_id: InstanceId,
        remote_logical_type: LogicalLayoutHandle,
        src_block_ids: Vec<BlockId>,
        dst: LogicalLayoutHandle,
        dst_block_ids: Arc<[BlockId]>,
        options: TransferOptions,
    ) -> Result<TransferCompleteNotification>;
}

Required Methods§

Source

fn execute_local_transfer( &self, src: LogicalLayoutHandle, dst: LogicalLayoutHandle, src_block_ids: Arc<[BlockId]>, dst_block_ids: Arc<[BlockId]>, options: TransferOptions, ) -> Result<TransferCompleteNotification>

Execute a local transfer between two logical layouts.

§Arguments
  • src - The source layout handle
  • dst - The destination layout handle
  • src_block_ids - The source block IDs
  • dst_block_ids - The destination block IDs
  • options - Transfer options (layer range, bounce buffers, etc.)
§Returns

A future that completes when the transfer is complete

Source

fn execute_remote_onboard( &self, src: RemoteDescriptor, dst: LogicalLayoutHandle, dst_block_ids: Arc<[BlockId]>, options: TransferOptions, ) -> Result<TransferCompleteNotification>

Execute a remote transfer from a remote layout to a local logical layout.

This represents a NIXL transfer.

§Arguments
  • src - Remote sources can take several forms, see RemoteDescriptor
  • dst - The destination layout handle
  • dst_block_ids - The destination block IDs
  • options - Transfer options (layer range, bounce buffers, etc.)
§Returns

A future that completes when the transfer is complete

Source

fn execute_remote_offload( &self, src: LogicalLayoutHandle, src_block_ids: Arc<[BlockId]>, dst: RemoteDescriptor, options: TransferOptions, ) -> Result<TransferCompleteNotification>

Execute a remote offload from a local logical layout to a remote descriptor.

This represents a NIXL offload.

§Arguments
  • src - The source layout handle
  • dst - The destination remote descriptor
  • src_block_ids - The source block IDs
  • options - Transfer options (layer range, bounce buffers, etc.)
§Returns

A future that completes when the offload is complete

Source

fn connect_remote( &self, instance_id: InstanceId, metadata: Vec<SerializedLayout>, ) -> Result<ConnectRemoteResponse>

Connect to a remote instance by importing its metadata and storing handle mappings.

This method stores the handle mappings internally for later use by execute_remote_onboard_for_instance. The metadata is also imported into the underlying transfer manager so NIXL knows about the remote.

§Arguments
  • instance_id - The unique identifier of the remote instance
  • metadata - Serialized layout metadata from the remote instance. For DirectWorker, expects exactly 1 element. For ReplicatedWorker, expects one element per worker (in rank order).
§Returns

A response that completes when the metadata has been imported and mappings stored.

Source

fn has_remote_metadata(&self, instance_id: InstanceId) -> bool

Check if remote metadata has been imported for an instance.

Returns true if connect_remote has been successfully called for this instance.

Source

fn execute_remote_onboard_for_instance( &self, instance_id: InstanceId, remote_logical_type: LogicalLayoutHandle, src_block_ids: Vec<BlockId>, dst: LogicalLayoutHandle, dst_block_ids: Arc<[BlockId]>, options: TransferOptions, ) -> Result<TransferCompleteNotification>

Execute a remote onboard transfer using stored handle mapping.

This method looks up the remote handle from the stored mapping (established via connect_remote) and executes the transfer.

§Arguments
  • instance_id - The remote instance to pull from
  • remote_logical_type - The logical layout type on the remote (e.g., G2)
  • src_block_ids - Block IDs on the remote to pull
  • dst - Local destination logical layout
  • dst_block_ids - Local destination block IDs
  • options - Transfer options
§Errors

Returns error if remote metadata hasn’t been imported for this instance.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§