Whether or not this process is the global main process (when training in a distributed fashion on several machines, this is only going to be `True` for one process).
(self)
| 4418 | return self.args.local_process_index == 0 |
| 4419 | |
| 4420 | def is_world_process_zero(self) -> bool: |
| 4421 | """ |
| 4422 | Whether or not this process is the global main process (when training in a distributed fashion on several |
| 4423 | machines, this is only going to be `True` for one process). |
| 4424 | """ |
| 4425 | # Special case for SageMaker ModelParallel since there process_index is dp_process_index, not the global |
| 4426 | # process index. |
| 4427 | if is_sagemaker_mp_enabled(): |
| 4428 | return smp.rank() == 0 |
| 4429 | return self.args.process_index == 0 |
| 4430 | |
| 4431 | def _move_model_to_device(self, model: nn.Module, device: torch.device) -> None: |
| 4432 | """Move the model to the specified device, re-tying weights on XLA if needed.""" |
no test coverage detected