ddp
- class aitoolbox.torchtrain.callbacks.ddp.DistributedSamplerSetEpoch(train_sampler, validation_sampler, test_sampler)[source]
Bases:
AbstractCallback
Callback setting epoch index in the DistributedSamplers at the beginning of every epoch
- Parameters:
train_sampler (torch.utils.data.distributed.DistributedSampler or None) – Distributed sampler for train loader
validation_sampler (torch.utils.data.distributed.DistributedSampler or None) – Distributed sampler for validation loader
test_sampler (torch.utils.data.distributed.DistributedSampler or None) – Distributed sampler for test loader
- class aitoolbox.torchtrain.callbacks.ddp.InMultiProcessDataLoad(train_loader_build_fn=None, val_loader_build_fn=None, test_loader_build_fn=None)[source]
Bases:
AbstractCallback
Multiprocess in-process data loading logic infuser
- Parameters:
train_loader_build_fn (callable or bool or None) – function specifying the training data reading and train data loader preparation which should be returned from the function. If not provided, the original train data loader in TrainLoop will be kept.
val_loader_build_fn (callable or bool or None) – function specifying the validation data reading and validation data loader preparation which should be returned from the function. If not provided, the original validation data loader in TrainLoop will be kept.
test_loader_build_fn (callable or bool or None) – function specifying the test data reading and test data loader preparation which should be returned from the function. If not provided, the original test data loader in TrainLoop will be kept.