Skip to content

Commit

Permalink
Add random seed for initialization of compressor
Browse files Browse the repository at this point in the history
  • Loading branch information
huangrh99 committed Oct 28, 2020
1 parent c228567 commit 508dc32
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions autodist/kernel/synchronization/compressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 508dc32

Please sign in to comment.