SingleDeviceStrategy
- class lightning.fabric.strategies.SingleDeviceStrategy(device='cpu', accelerator=None, checkpoint_io=None, precision=None)
Bases:
StrategyStrategy that handles communication on a single device.
- all_gather(tensor, group=None, sync_grads=False)
Perform a
all_gatheron all processes.- Return type:
- all_reduce(tensor, *args, **kwargs)
Reduces a tensor from several distributed processes to one aggregated tensor. As this plugin only operates with a single device, the reduction is simply the identity.
- barrier(*args, **kwargs)
Synchronizes all processes which blocks processes until the whole group enters this function.
- Parameters:
name – an optional name to pass into barrier.
- Return type:
- broadcast(obj, src=0)
Broadcasts an object to all processes.
- module_to_device(module)
Moves the model to the correct device.
- Return type:
- property is_global_zero: bool
Whether the current process is the rank zero process not only on the local node, but for all nodes.
- property root_device: device
Returns the root device.
Was this page helpful?
Thanks for the feedback.