|
|
|
@ -33,15 +33,6 @@ extern "C" {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the rank number in the group.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param rankSize A pointer identifying the rank number.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult hcom_get_rank_size(const char *group, u32 *rankSize);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the rank number in the group.
|
|
|
|
|
*
|
|
|
|
@ -51,15 +42,6 @@ HcclResult hcom_get_rank_size(const char *group, u32 *rankSize);
|
|
|
|
|
*/
|
|
|
|
|
HcclResult HcomGetRankSize(const char *group, u32 *rankSize);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the rank number of this rank's server within the group.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param localRankSize A pointer identifying the rank number.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult hcom_get_local_rank_size(const char *group, u32 *localRankSize);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the rank number of this rank's server within the group.
|
|
|
|
|
*
|
|
|
|
@ -69,15 +51,6 @@ HcclResult hcom_get_local_rank_size(const char *group, u32 *localRankSize);
|
|
|
|
|
*/
|
|
|
|
|
HcclResult HcomGetLocalRankSize(const char *group, u32 *localRankSize);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the rank id of this rank.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param rankId A pointer identifying the rank id.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult hcom_get_rank_id(const char *group, u32 *rankId);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the rank id of this rank.
|
|
|
|
|
*
|
|
|
|
@ -87,15 +60,6 @@ HcclResult hcom_get_rank_id(const char *group, u32 *rankId);
|
|
|
|
|
*/
|
|
|
|
|
HcclResult HcomGetRankId(const char *group, u32 *rankId);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the local rank id of this rank's server within the group.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param localRankId A pointer identifying the local rank id.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult hcom_get_local_rank_id(const char *group, u32 *localRankId);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the local rank id of this rank's server within the group.
|
|
|
|
|
*
|
|
|
|
@ -105,16 +69,6 @@ HcclResult hcom_get_local_rank_id(const char *group, u32 *localRankId);
|
|
|
|
|
*/
|
|
|
|
|
HcclResult HcomGetLocalRankId(const char *group, u32 *localRankId);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the world rank id according to the group rank id.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param groupRank An integer(u32) identifying the group rank id.
|
|
|
|
|
* @param worldRank A pointer identifying the world rank id.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult hcom_get_world_rank_from_group_rank(const char *group, u32 groupRank, u32 *worldRank);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the world rank id according to the group rank id.
|
|
|
|
|
*
|
|
|
|
@ -125,16 +79,6 @@ HcclResult hcom_get_world_rank_from_group_rank(const char *group, u32 groupRank,
|
|
|
|
|
*/
|
|
|
|
|
HcclResult HcomGetWorldRankFromGroupRank(const char *group, u32 groupRank, u32 *worldRank);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the group rank id according to the world rank id.
|
|
|
|
|
*
|
|
|
|
|
* @param worldRank An integer(u32) identifying the world rank id.
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param groupRank A pointer identifying the group rank id.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult hcom_get_group_rank_from_world_rank(u32 worldRank, const char *group, u32 *groupRank);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get the group rank id according to the world rank id.
|
|
|
|
|
*
|
|
|
|
@ -145,16 +89,6 @@ HcclResult hcom_get_group_rank_from_world_rank(u32 worldRank, const char *group,
|
|
|
|
|
*/
|
|
|
|
|
HcclResult HcomGetGroupRankFromWorldRank(u32 worldRank, const char *group, u32 *groupRank);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Create group.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param rankNum An integer(u32) identifying the number of ranks in the group.
|
|
|
|
|
* @param rankIds A list identifying the ranks in the group.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult hcom_create_group(const char *group, u32 rankNum, u32 *rankIds);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Create group.
|
|
|
|
|
*
|
|
|
|
@ -165,14 +99,6 @@ HcclResult hcom_create_group(const char *group, u32 rankNum, u32 *rankIds);
|
|
|
|
|
*/
|
|
|
|
|
HcclResult HcomCreateGroup(const char *group, u32 rankNum, u32 *rankIds);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Destroy group
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult hcom_destroy_group(const char *group);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Destroy group
|
|
|
|
|
*
|
|
|
|
@ -189,46 +115,54 @@ HcclResult HcomDestroyGroup(const char *group);
|
|
|
|
|
* @param IdxList A list identifying the index of end gradient in each segment.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
extern HcclResult hcom_set_split_strategy_by_index(const char *group, u32 segmentNum, const u32 *IdxList);
|
|
|
|
|
extern HcclResult HcomSetGradFusionByIndex(const char *group, u32 segmentNum, const u32 *IdxList);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Set the gradient split strategy with in the group, according to gradient index.
|
|
|
|
|
* @brief Set the gradient split strategy with in the group, according to gradient data size.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param segmentNum An integer(u32) identifying the segments number of gradients.
|
|
|
|
|
* @param IdxList A list identifying the index of end gradient in each segment.
|
|
|
|
|
* @param sizeList A list identifying the percent of each segment.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
extern HcclResult HcomSetGradFusionByIndex(const char *group, u32 segmentNum, const u32 *IdxList);
|
|
|
|
|
extern HcclResult HcomSetGradFusionBySize(const char *group, u32 segmentNum, const float *sizeList);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Set the gradient split strategy with in the group, according to gradient data size.
|
|
|
|
|
* @brief Initialize hcom executor.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param segmentNum An integer(u32) identifying the segments number of gradients.
|
|
|
|
|
* @param sizeList A list identifying the percent of each segment.
|
|
|
|
|
* @param void
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
extern HcclResult hcom_set_split_strategy_by_size(const char *group, u32 segmentNum, const float *sizeList);
|
|
|
|
|
HcclResult HcomExecInitialize();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Set the gradient split strategy with in the group, according to gradient data size.
|
|
|
|
|
* @brief Finalize hcom executor.
|
|
|
|
|
*
|
|
|
|
|
* @param group A string identifying the group name.
|
|
|
|
|
* @param segmentNum An integer(u32) identifying the segments number of gradients.
|
|
|
|
|
* @param sizeList A list identifying the percent of each segment.
|
|
|
|
|
* @param void
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
extern HcclResult HcomSetGradFusionBySize(const char *group, u32 segmentNum, const float *sizeList);
|
|
|
|
|
HcclResult HcomExecFinalize();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Register memories and init resources for remote access.
|
|
|
|
|
* @brief Put collective communication operation into hcom executor.
|
|
|
|
|
*
|
|
|
|
|
* @param addrList memory addresses for remote access.
|
|
|
|
|
* @param count number of remote memory addresses.
|
|
|
|
|
* @param opInfo information about collective communication operation.
|
|
|
|
|
* @param callback callback after collective communication operation.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
extern HcclResult hcom_remote_access_mem_register(const MemRegisterAddr* addrList, u32 count);
|
|
|
|
|
HcclResult HcomExecEnqueueOperation(HcomOperation opInfo, std::function<void(HcclResult status)> callback);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Put remote access operation into hcom executor.
|
|
|
|
|
*
|
|
|
|
|
* @param remoteAccessType operation type (read or write).
|
|
|
|
|
* @param addrInfos address information about collective communication operation.
|
|
|
|
|
* @param callback callback after collective communication operation.
|
|
|
|
|
* @return HcclResult
|
|
|
|
|
*/
|
|
|
|
|
HcclResult HcomExecEnqueueRemoteAccess(const std::string& remoteAccessType,
|
|
|
|
|
const std::vector<HcomRemoteAccessAddrInfo>& addrInfos,
|
|
|
|
|
std::function<void(HcclResult status)> callback);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Register memories and init resources for remote access.
|
|
|
|
@ -239,16 +173,6 @@ extern HcclResult hcom_remote_access_mem_register(const MemRegisterAddr* addrLis
|
|
|
|
|
*/
|
|
|
|
|
extern HcclResult HcomRegRemoteAccessMem(const MemRegisterAddr* addrList, u32 count);
|
|
|
|
|
|
|
|
|
|
HcclResult HcomExecInitialize();
|
|
|
|
|
|
|
|
|
|
HcclResult HcomExecFinalize();
|
|
|
|
|
|
|
|
|
|
HcclResult HcomExecEnqueueOperation(HcomOperation opInfo, std::function<void(HcclResult status)> callback);
|
|
|
|
|
|
|
|
|
|
HcclResult HcomExecEnqueueRemoteAccess(const std::string& remoteAccessType,
|
|
|
|
|
const std::vector<HcomRemoteAccessAddrInfo>& addrInfos,
|
|
|
|
|
std::function<void(HcclResult status)> callback);
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif // __cplusplus
|
|
|
|
|