def _maybe_schedule_gradient_averaging(self) -> None:
    'If next epoch is coming soon, schedule the next gradient averaging round at the estimated end of epoch'
    assert self.use_gradient_averaging
    if ((self.tracker.estimated_next_update_time - get_dht_time()) <= self.matchmaking_time):
        if ((self.scheduled_grads is None) or self.scheduled_grads.triggered or self.scheduled_grads.done()):
            eta_seconds = (self.tracker.estimated_next_update_time - get_dht_time())
            eta_seconds = max(eta_seconds, self.grad_averager.matchmaking_kwargs['min_matchmaking_time'])
            logger.log(self.status_loglevel, f'Pre-scheduling gradient averaging round in {eta_seconds:.2f} sec')
            self.scheduled_grads = self.grad_averager.schedule_step(timeout=self.averaging_timeout)
If next epoch is coming soon, schedule the next gradient averaging round at the estimated end of epoch
def _maybe_schedule_gradient_averaging(self) -> None:
    
    assert self.use_gradient_averaging
    if ((self.tracker.estimated_next_update_time - get_dht_time()) <= self.matchmaking_time):
        if ((self.scheduled_grads is None) or self.scheduled_grads.triggered or self.scheduled_grads.done()):
            eta_seconds = (self.tracker.estimated_next_update_time - get_dht_time())
            eta_seconds = max(eta_seconds, self.grad_averager.matchmaking_kwargs['min_matchmaking_time'])
            logger.log(self.status_loglevel, f'Pre-scheduling gradient averaging round in {eta_seconds:.2f} sec')
            self.scheduled_grads = self.grad_averager.schedule_step(timeout=self.averaging_timeout)