Tighten local_sgd loop by inlining vector_sub.