未验证 提交 6374e59d 编写于 作者: C cheng cheng 提交者: GitHub

fix bug of SyncOnMasterFn atexit (#5909)

* fix bug of SyncOnMasterFn atexit

* move sync to func
Co-authored-by: Noneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
上级 87cec628
......@@ -94,17 +94,12 @@ del register_python_callback
def _SyncOnMasterFn():
import oneflow
def Sync():
if not oneflow._oneflow_internal.IsEnvInited():
return
if oneflow.framework.distribute.is_multi_client():
oneflow._oneflow_internal.eager.multi_client.Sync()
elif oneflow.framework.distribute.get_rank() == 0:
oneflow._oneflow_internal.eager.single_client.Sync()
return Sync
if not oneflow._oneflow_internal.IsEnvInited():
return
if oneflow.framework.distribute.is_multi_client():
oneflow._oneflow_internal.eager.multi_client.Sync()
elif oneflow.framework.distribute.get_rank() == 0:
oneflow._oneflow_internal.eager.single_client.Sync()
atexit.register(oneflow._oneflow_internal.SetShuttingDown)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册