Making ML Training Efficient, Algorithmically