TransferAsync

Applicable Products

Product

Supported (√/x)

Ascend 950PR / Ascend 950DT

√

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Note: For Atlas A2 training products / Atlas A2 inference products , only the Atlas 800I A2 inference server and A200I A2 Box heterogeneous subrack are supported.

Function Description

Transmits memory in batches with the remote HIXL instance asynchronously.

Prototype

1
2
3
4
5
Status TransferAsync(const AscendString &remote_engine,
                     TransferOp operation,
                     const std::vector<TransferOpDesc> &op_descs,
                     const TransferArgs &optional_args,
                     TransferReq &req)

Parameters

Parameter

Input/Output

Description

remote_engine

Input

Unique identifier of the remote HIXL instance.

operation

Input

Reading the remote memory to the local side or writing the local memory to the remote side.

op_descs

Input

Local and remote addresses for batch operations.

optional_args

Input

Optional parameter (reserved).

req

Output

Request handle, which is used to query the transmission request status.

Example

// Initialize the engines on the client and server and establish a link.
client_engine.TransferAsync(remote_engine, operation, op_descs, optional_args, req);

Returns

  • SUCCESS: Success.
  • NOT_CONNECTED: No link is established with the peer end.
  • RESOURCE_EXHAUSTED: Resources are used up.
  • Other values: Failure.

Constraints

  • Before calling this API, note the following constraints:
    • Call the Connect API to establish a link with the peer end.
    • Alternatively, enable the link pool mechanism during HIXL initialization. Specifically, set the OPTION_GLOBAL_RESOURCE_CONFIG parameter in options. This restriction applies to the following products:
      • Atlas A2 training products / Atlas A2 inference products
      • Atlas A3 training products / Atlas A3 inference products
  • This API and Initialize must run in the same thread. If you need to switch threads to call this API, first call aclrtGetCurrentContext in the thread where Initialize is running to obtain the context. Then, in the new thread, call aclrtSetCurrentContext to set the context.
  • Currently, asynchronous transmission supports only direct transmission (used by default). Relay transmission is not supported at this time.
  • In Fabric Mem transfer mode, the transfer types of all op_descs must be the same. The system determines the transfer direction based on the memory type of the first op_desc. This restriction applies to the following products:
    • Atlas A3 training products / Atlas A3 inference products