Provably Efficient Model Training over Centralized and Decentralized Datasets