configuration.
Here is the documentation.
Batch Size
To configure batch size, use:
json
{
    "train_batch_size": "auto",
    "train_micro_batch_size_per_gpu": "auto"
}
and the [Trainer] will automatically set train_micro_batch_size_per_gpu to the value of
args.per_device_train_batch_size and train_batch_size to args.world_size * args.per_device_train_batch_size * args.gradient_accumulation_steps.
You can also set the values explicitly:
json
{
    "train_batch_size": 12,
    "train_micro_batch_size_per_gpu": 4
}
But then you're on your own synchronizing the [Trainer] command line arguments and the DeepSpeed
configuration.
Gradient Accumulation
To configure gradient accumulation set:
json
{
    "gradient_accumulation_steps": "auto"
}
and the [Trainer] will automatically set it to the value of args.gradient_accumulation_steps.
