TransferSync

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.

Prototype

1
2
3
4
Status TransferSync(const AscendString &remote_engine,
                    TransferOp operation,
                    const std::vector<TransferOpDesc> &op_descs,
                    int32_t timeout_in_millis = 1000)

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.

timeout_in_millis

Input

Transmission timeout interval, in milliseconds. The default value is 1000.

Example

Click GitCode, select the matching version, and obtain the sample from the examples/cpp directory.

Returns

  • SUCCESS: Success.
  • PARAM_INVALID: Incorrect parameter.
  • NOT_CONNECTED: No link is established with the peer end.
  • TIMEOUT: Transmission timeout.
  • RESOURCE_EXHAUSTED: Resources are used up.
  • Other values: Failure.

Restrictions

  • Before calling this API, 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.
  • The relay memory pool is enabled by default. When the relay memory pool is enabled, if either the local memory or remote memory in op_descs is not registered, the system will determine that relay transmission mode should be used. Unregistered memory is considered as host memory, and users must ensure that the addresses are valid. This restriction applies to the following products:
    • Atlas A2 training product / Atlas A2 inference product
    • Atlas A3 training product / Atlas A3 inference product
  • In relay transmission mode, all entries in op_descs must have the same transmission type. For example, all entries involve writing from local host memory to remote host memory. This restriction applies to the following products:
    • Atlas A2 training product / Atlas A2 inference product
    • Atlas A3 training product / Atlas A3 inference product
  • 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