From: @zhoufeng54
Reviewed-by: @jjfeing,@kisnwang
Signed-off-by: @kisnwang
This commit is contained in:
mindspore-ci-bot 2021-05-15 17:09:13 +08:00 committed by Gitee
commit 8b7154c6a7
2 changed files with 7 additions and 4 deletions

View File

@ -330,8 +330,8 @@ bool HcclAdapter::InitHcclComm(std::string_view rank_id, std::string_view rank_f
} catch (std::invalid_argument &) {
MS_LOG(EXCEPTION) << "Invalid rank id env:" << rank_id;
}
if (rank_id_i < 0 || rank_id_i > 7) {
MS_LOG(ERROR) << "rank_id needs to be between 0-7";
if (rank_id_i < 0) {
MS_LOG(ERROR) << "rank_id cannot be negative";
return false;
}
MS_EXCEPTION_IF_NULL(init_hccl_comm_);

View File

@ -15,10 +15,11 @@
# ============================================================================
"""HCCL management API"""
import ctypes
import os
MAX_GROUP_NAME_LEN = 127
MAX_RANK_NUM = 4096
HCCL_LIB = 'libhccl.so'
HCCL_LIB = 'libhccl_plugin.so'
HCCL_LIB_CTYPES = ""
@ -67,7 +68,9 @@ def check_rank_id(rank_id):
def load_lib():
try:
hccl_lib = ctypes.CDLL(HCCL_LIB)
base_dir = os.path.dirname(os.path.realpath(__file__))
lib_path = os.path.join(base_dir, "../lib", HCCL_LIB)
hccl_lib = ctypes.CDLL(lib_path)
except Exception:
raise RuntimeError('Get hccl lib error.')
global HCCL_LIB_CTYPES