XLAStrategy¶
- class lightning.pytorch.strategies.XLAStrategy(accelerator=None, parallel_devices=None, checkpoint_io=None, precision_plugin=None, debug=False, **_)[소스]¶
- 기반 클래스: - lightning.pytorch.strategies.ddp.DDPStrategy- Strategy for training multiple TPU devices using the - torch_xla.distributed.xla_multiprocessing.spawn()method.- all_gather(tensor, group=None, sync_grads=False)[소스]¶
- Function to gather a tensor from several distributed processes. 
 - barrier(name=None, *args, **kwargs)[소스]¶
- Synchronizes all processes which blocks processes until the whole group enters this function. 
 - connect(model)[소스]¶
- Called by the accelerator to connect the accelerator and the model with this plugin. - 반환 형식
 
 - on_train_batch_start(batch, batch_idx)[소스]¶
- Called in the training loop before anything happens for that batch. - 반환 형식
 
 - process_dataloader(dataloader)[소스]¶
- Wraps the dataloader if necessary. - 매개변수
- dataloader¶ ( - object) – iterable. Ideally of type:- torch.utils.data.DataLoader
- 반환 형식
 
 - reduce(output, group=None, reduce_op=None)[소스]¶
- Reduces a tensor from several distributed processes to one aggregated tensor. - 매개변수
- 반환 형식
- 반환
- reduced value, except when the input was not a tensor the output remains is unchanged 
 
 - save_checkpoint(checkpoint, filepath, storage_options=None)[소스]¶
- Save model/training states as a checkpoint file through state-dump and file-write. 
 - teardown()[소스]¶
- This method is called to teardown the training process. - It is the right place to release memory and free other resources. - 반환 형식
 
 - validation_step(*args, **kwargs)[소스]¶
- The actual validation step. - See - validation_step()for more details
 - property root_device: torch.device¶
- Return the root device. - 반환 형식