Towards Flexible Device Participation in Federated Learning for Non-IID Data