TransferAsync

Applicability

Product

Supported (√/x)

Atlas 350 Accelerator Card

x

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product

x

Atlas training product

x

Note: For Atlas A2 training product / Atlas A2 inference product , 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.

Restrictions

  • 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 product / Atlas A2 inference product
      • Atlas A3 training product / Atlas A3 inference product
  • This API and Initialize must run in the same thread. If you need to switch threads to call this API, first call aclrtGetCurrentContext in Application Development (C&C++) in the thread where Initialize is running to obtain the context. Then, in the new thread, call aclrtSetCurrentContext in Application Development (C&C++) 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 product / Atlas A3 inference product