DDPSpawnStrategy
- class pytorch_lightning.strategies.DDPSpawnStrategy(accelerator=None, parallel_devices=None, cluster_environment=None, checkpoint_io=None, precision_plugin=None, ddp_comm_state=None, ddp_comm_hook=None, ddp_comm_wrapper=None, process_group_backend=None, **kwargs)[source]
Bases:
pytorch_lightning.strategies.parallel.ParallelStrategy
Spawns processes using the
torch.multiprocessing.spawn()
method and joins processes after training finishes.- barrier(*args, **kwargs)[source]
Synchronizes all processes which blocks processes until the whole group enters this function.
- Parameters
- Return type
- broadcast(obj, src=0)[source]
Broadcasts an object to all processes.
- model_to_device()[source]
Moves the model to the correct device.
- predict_step(*args, **kwargs)[source]
The actual predict step.
See
predict_step()
for more details
- reduce(tensor, group=None, reduce_op='mean')[source]
Reduces a tensor from several distributed processes to one aggregated tensor.
- Parameters
- Return type
- Returns
reduced value, except when the input was not a tensor the output remains is unchanged
- setup(trainer)[source]
Setup plugins for the trainer fit and creates optimizers.
- teardown()[source]
This method is called to teardown the training process.
It is the right place to release memory and free other resources.
- Return type
- test_step(*args, **kwargs)[source]
The actual test step.
See
test_step()
for more details
- training_step(*args, **kwargs)[source]
The actual training step.
See
training_step()
for more details
- validation_step(*args, **kwargs)[source]
The actual validation step.
See
validation_step()
for more details