API List
- Control plane APIs: provide functions such as topology information query and communication resource management.
- Data plane APIs: provide data movement and computing functions such as local operations, inter-operator synchronization, and communication operations.
- hccl_rank_graph.h: definition file of the topology information query API on the control plane.
- hccl_res.h: resource management definition file on the control plane.
- hcomm_primitives.h: definition file of the data plane APIs.
Control Plane APIs
- Topology information query
API
Description
Obtains the rank ID of a device in a specified communicator.
Queries the number of ranks in a specified communicator.
Queries the list of topology layers that contain the current rank and the number of topology layers.
Returns the list of all rank IDs and the number of ranks in the topology instance where the current rank is located at a specified topology layer in a specified communicator.
Returns the number of ranks in the topology instance where the current rank is located at a specified topology layer in a specified communicator.
Returns the topology type of the topology layer where the current rank is located in a specified communicator.
Queries the number of topology instances at a specified topology layer and the number of ranks in each instance in a specified communicator.
Queries information about the communication connection between the source rank and the destination rank at a specified topology layer in a specified communicator.
Queries the topology instance set of the current rank based on the given communicator and topology layer ID.
Queries the topology type of the current rank in the specified topology instance based on the given communicator and topology layer ID.
Queries the rank information in the topology instance of the current rank based on the given communicator and topology layer ID.
Obtains the heterogeneous networking mode of a given communicator.
Obtains the number of endpoints in a topology instance.
Obtains the endpoint description list of a topology instance.
Obtains the topology attributes of a given communication device.
- Communicator resource management
API
Description
Obtains the HCCL communication memory in the communicator. Memory will be initialized and allocated on the device during the first call; subsequent calls will reuse the allocated memory without reinitialization.
Obtains the communication thread based on the communicator.
Obtains the communication thread resource of the specified notifyNum based on the existing runtime stream.
Initializes the communication channel description list.
Obtains multiple communication channels based on the communicator. If the communicator does not have the corresponding communication channel, the communication channel is directly created.
Obtains the HCCL communication memory of the remote end of a specified channel.
Creates the corresponding communication engine context with a specified tag by specifying the communicator and communication engine.
Obtains the corresponding communication engine context based on the communication engine context tag by specifying the communicator and communication engine.
Copies the memory data on the host to the corresponding communication engine context by specifying the communicator, communication engine, and communication engine context tag.
Destroys the corresponding communication engine context with a specified tag by specifying the communicator and communication engine.
Registers the allocated memory with the communicator and obtains the corresponding registered handle.
Obtains the remote memory information exchanged in the communication channel.
- Basic resource management
API
Description
Creates a communication endpoint.
Destroys a communication endpoint.
Registers memory to a specified endpoint.
Unregisters memory from an endpoint.
Exports the specified memory description for exchange after the memory is registered.
Imports the memory description exported by the remote end to obtain the corresponding memory description information on the local end.
Disables memory import.
Initializes the communication channel description list.
Creates communication channels in batches based on the given channel description and the created network endpoints, providing the infrastructure for data transmission in point-to-point communication or collective communication.
Query the status of communication channels in batches. This API is used to check whether the channels are ready after they are created and before communication operations are performed.
Obtains the number of Notifies of a specified channel.
Destroys a communication channel created by HcommChannelCreate, along with the system resources occupied by the communication channel, including network connections, synchronization signals, and communication queues.
Allocates communication threads. Currently, the AICPU+TS, host CPU+TS, and CCU communication engines are supported. For the AICPU+TS communication engine, the allocated communication threads can be used on the AICPU only after an additional kernel is delivered.
Destroys threads allocated by the HcommThreadAlloc API.
Data Plane APIs
- Local operations
API
Description
Copies memory data of length len pointed to by src into the memory of the same length pointed to by dst.
Performs a reduceOp operation on the memory data of length count × sizeof(dataType) pointed to by src and the memory data of the same length pointed to by dst, and outputs the result to dst.
Sends a synchronization signal to other threads, which is primarily used for synchronization between multiple threads.
Waits for a synchronization signal. This API blocks and waits for the thread execution until the specified Notify is recorded.
Sends a synchronization signal based on the Notify created by the ACL API. This API must be used in pair with HcommAclrtNotifyWaitOnThread.
Waits for a synchronization signal based on the Notify created by the ACL API. This API must be used in pair with HcommAclrtNotifyRecordOnThread.
- Communication operations
API
Description
Writes data to the specified memory on a channel. It writes memory data of length len from src into the memory of the same length pointed to by dst. The API caller is the node where src resides. This API is asynchronous.
Writes data to the specified memory on a channel. It performs a reduceOp operation on the memory data of length count × sizeof(dataType) pointed to by src and the memory data of the same length pointed to by dst, and outputs the result to dst. The API caller is the node where src resides.
Reads data from the specified memory on a channel. It reads memory data of length len from src and writes it into dst. The API caller is the node where dst resides. This API is asynchronous.
Reads data from the specified memory on a channel. It performs a reduceOp operation on the memory data of length count × sizeof(dataType) pointed to by src and the memory data of the same length pointed to by dst, and outputs the result to dst. The API caller is the node where dst resides.
Sends a synchronization signal and records a Notify on the thread. This API is asynchronous and is mainly used for synchronization between the two ends of a channel.
Waits for a synchronization signal. This API blocks and waits for the thread execution until the specified Notify is completed.
Writes data to the specified memory on a channel. It writes memory data of length len from src into the memory of the same length pointed to by dst, and sends a synchronization signal to the node where dst resides. The API caller is the node where src resides. This API is asynchronous.
Writes data to the specified memory on a channel. It performs a reduceOp operation on the memory data of length count × sizeof(dataType) pointed to by src and the memory data of the same length pointed to by dst, outputs the result to dst, and sends a synchronization signal to the node where dst resides. The API caller is the node where src resides. This API is asynchronous.
- Other APIs
API
Description
Enables the batch mode. All data plane API calls (such as HcommLocalCopy and HcommWrite) called between HcommBatchModeStart and HcommBatchModeEnd will be cached instead of being executed immediately. All operations will be submitted and executed collectively when HcommBatchModeEnd is called.
Submits and triggers the execution of all operations cached in batch mode. All data plane API call operations between HcommBatchModeStart and HcommBatchModeEnd will be executed collectively at this point.
Obtains the corresponding communicator based on the passed commId and locks the communicator to prevent it from being obtained repeatedly.
Finds the corresponding communicator based on the passed commId and releases the lock.