diff --git a/imperative/python/megengine/distributed/helper.py b/imperative/python/megengine/distributed/helper.py index 79be16e1000bbdf3e2c50de98204b079994093ea..0755ea2ce3f275612d60312bda6b1087cee7065c 100644 --- a/imperative/python/megengine/distributed/helper.py +++ b/imperative/python/megengine/distributed/helper.py @@ -211,6 +211,8 @@ class AllreduceCallback: self._grad_origin_device = dict() def _pack(self, dtype): + if len(self._packing_list[dtype]) == 0: + return grad_list = [self._gradients_dict[p] for p in self._packing_list[dtype]] shapes = [p.shape for p in self._packing_list[dtype]] reduced_grads = pack_allreduce_split(