def _load_and_init_python_lib(): _load_clib('libkungfu') _python_lib = _load_clib('libkungfu_python') if not os.getenv('KUNGFU_SINGLE_MACHINE_MULTIPROCESS'): _call_method(_python_lib, 'kungfu_python_init') has_nccl = _call_method(_python_lib, 'kungfu_python_init_nccl') return _python_lib, has_nccl
def _init_single_machine_multiple_process(rank, size): global _python_lib global _has_nccl _load_clib('libkungfu') _python_lib = _load_clib('libkungfu_python') _call_method_with(_python_lib, 'kungfu_python_init_single_machine', rank, size) _has_nccl = _call_method(_python_lib, 'kungfu_python_init_nccl')
def _load_and_init_python_lib(): _load_clib('libkungfu') _python_lib = _load_clib('libkungfu_python') _call_method(_python_lib, 'kungfu_python_init') has_nccl = _call_method(_python_lib, 'kungfu_python_init_nccl') return _python_lib, has_nccl
def run(): clib = _load_clib('libkungfu') clib.kungfu_run_main()