MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / get_batch_info

Method get_batch_info

deepspeed/runtime/engine.py:1418–1432  ·  view source on GitHub ↗

Get all training batch related settings. Returns: train_batch_size (int): The effective training batch size. This is the amount of data samples that leads to one step of model update. train_micro_batch_size_per_gpu (int): Batch size to be processed by

(self)

Source from the content-addressed store, hash-verified

1416 logger.info(f"model parameter = {num_params}")
1417
1418 def get_batch_info(self):
1419 """Get all training batch related settings.
1420 Returns:
1421 train_batch_size (int): The effective training batch size. This is the amount of data
1422 samples that leads to one step of model update.
1423 train_micro_batch_size_per_gpu (int): Batch size to be processed by one GPU in one
1424 step (without gradient accumulation).
1425 gradient_accumulation_steps (int): Number of training steps to accumulate gradients
1426 before averaging and applying them.
1427 """
1428 return (
1429 self.train_batch_size,
1430 self.train_micro_batch_size_per_gpu,
1431 self.gradient_accumulation_steps,
1432 )
1433
1434 def set_train_batch_size(self, train_batch_size):
1435 """Adjust the global batch size by increasing or decreasing the number of

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected