Near-optimal sparse allreduce for distributed deep learning