From b17a02d44aed9187e268efe67653493fe855ed49 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Mon, 19 Jul 2021 14:54:45 +0800 Subject: [PATCH] feat(mge/distributed): deprecate get_device_count_by_fork GitOrigin-RevId: 6147c3ae905c65a532fe000aa51546abdfddc96f --- imperative/python/megengine/distributed/helper.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/imperative/python/megengine/distributed/helper.py b/imperative/python/megengine/distributed/helper.py index 96d79a6c0..436623634 100644 --- a/imperative/python/megengine/distributed/helper.py +++ b/imperative/python/megengine/distributed/helper.py @@ -15,12 +15,12 @@ from weakref import WeakSet import numpy as np from megengine.autodiff.grad_manager import GradManager, get_backwarding_grad_manager -from megengine.device import get_default_device, get_device_count from ..core._imperative_rt.core2 import apply from ..core.ops.builtin import ParamPackConcat, ParamPackSplit from ..functional.tensor import copy from ..tensor import Tensor +from ..utils.deprecation import deprecated_func from ..utils.future import Future from . import group as _group from .functional import _bcast_param, all_reduce_sum, broadcast @@ -193,6 +193,11 @@ def _check_device_initialized(device_type: str, rank: int): raise RuntimeError(errmsg) +get_device_count_by_fork = deprecated_func( + "1.5", "megengine.device", "get_device_count", False +) + + def bcast_list_(inps: list, group: Group = WORLD): """ Broadcast tensors between given group. -- GitLab