From 508dc322b26b65412333834bd01045aab8a2f077 Mon Sep 17 00:00:00 2001 From: Ezra-H <44772185+Ezra-H@users.noreply.github.com> Date: Wed, 28 Oct 2020 16:06:31 +0800 Subject: [PATCH] Add random seed for initialization of compressor --- autodist/kernel/synchronization/compressor.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/autodist/kernel/synchronization/compressor.py b/autodist/kernel/synchronization/compressor.py index 1548878..868b542 100644 --- a/autodist/kernel/synchronization/compressor.py +++ b/autodist/kernel/synchronization/compressor.py @@ -235,12 +235,10 @@ def reduce(self, tensor: Tensor, conf: CollectiveOpsConfig): # compressor init if self.compressor is None: - self.compressor = random_ops.random_normal([array_ops.shape_v2(tensor)[1], self.rank]) + self.compressor = random_ops.random_normal([array_ops.shape_v2(tensor)[1], self.rank], seed=1000) - # synchronize compressor init statue self.compressor_conf = copy.copy(conf) self.conf.instance_key = get_collective_keys().get_instance_key(self.var_op_name + '/compressor') - self.compressor = self._all_reduce(self.compressor, self.compressor_conf) if self.error is not None: tensor += self.error