Functions for launching training on distributed processes.
( function args = () num_processes = None use_fp16 = False mixed_precision = 'no' use_port = '29500' )
Parameters
Callable
) —
The training function to execute. If it accepts arguments, the first argument should be the index of the
process run.
Tuple
) —
Tuple of arguments to pass to the function (it will receive *args
).
int
, optional) —
The number of processes to use for training. Will default to 8 in Colab/Kaggle if a TPU is available, to
the number of GPUs available otherwise.
str
, optional, defaults to "no"
) —
If fp16
or bf16
, will use mixed precision training on multi-GPU.
str
, optional, defaults to "29500"
) —
The port to use to communicate between processes when launching a multi-GPU training.
Launches a training function, using several processes if it’s possible in the current environment (TPU with multiple cores for instance).
( function args = () num_processes = 2 )
Launches a training function using several processes on CPU for debugging purposes.
This function is provided for internal testing and debugging, but it’s not intended for real trainings. It will only use the CPU.