def should_save_checkpoint_on_current_rank(self) -> bool:
        """Indicates whether to save checkpoints on the current DDP rank."""
        if self.zero_enabled:
            return True
        else:
            return self.is_data_parallel_master
Indicates whether to save checkpoints on the current DDP rank.
kosmos-2/fairseq/fairseq/ds_trainer.py