temporarily unable hccl

This commit is contained in:
Yuxuan Han 2025-05-13 09:09:37 +08:00
parent e8f94f4003
commit 91190b949e
1 changed files with 30 additions and 2 deletions

View File

@ -610,6 +610,26 @@ def setup_nccl():
nccl_ops = nccl.ops
LOG.vv("Get nccl_ops: "+str(dir(nccl_ops)))
def setup_hccl():
global hccl_ops
hccl_src_dir = os.path.join(jittor_path, "extern", "acl", "hccl")
hccl_src_files = []
for r, _, f in os.walk(hccl_src_dir):
for fname in f:
hccl_src_files.append(os.path.join(r, fname))
hccl_include_path = os.path.join(os.environ.get("ASCEND_TOOLKIT_HOME"), "aarch64-linux/include/hccl")
hccl_lib_name = os.path.join(os.environ.get("ASCEND_TOOLKIT_HOME"), "aarch64-linux/lib64/libhccl.so")
ctypes.CDLL(hccl_lib_name, dlopen_flags)
hccl = compile_custom_ops(hccl_src_files,
extra_flags=f" -I\"{hccl_include_path}\" {mpi_compile_flags} ",
return_module=True, dlopen_flags=os.RTLD_GLOBAL | os.RTLD_NOW,
gen_name_="jittor_hccl_core")
hccl_ops = hccl.ops
LOG.vv("Get hccl_ops: "+str(dir(hccl_ops)))
def manual_link(flags):
lib_dirs = []
libs = []
@ -707,8 +727,15 @@ cudnn = cublas = curand = cufft = cusparse = None
setup_mpi()
rank = mpi.world_rank() if in_mpi else 0
world_size = mpi.world_size() if in_mpi else 1
setup_nccl()
# if has_acl:
# setup_hccl()
# elif has_cuda:
# setup_nccl()
# setup_cutt()
# setup_cutlass()
setup_nccl()
setup_cutt()
setup_cutlass()
@ -722,4 +749,5 @@ setup_cuda_extern()
# install backend extern library
for mod in jit_utils.backends:
if mod.install_extern():
break
break