distributed_slurm.py 380 B

123456789101112131415161718192021
  1. import easyfl
  2. from easyfl.distributed import slurm
  3. rank, local_rank, world_size, host_addr = slurm.setup()
  4. configs = {
  5. "gpu": 4,
  6. "distributed": {
  7. "rank": rank,
  8. "local_rank": local_rank,
  9. "world_size": world_size,
  10. "init_method": host_addr,
  11. },
  12. "server": {
  13. "clients_per_round": 20,
  14. }
  15. }
  16. easyfl.init(configs)
  17. easyfl.run()