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

Method get_batch_info

deepspeed/runtime/engine.py:1390–1404  ·  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

1388 logger.info(f"model parameter = {num_params}")
1389
1390 def get_batch_info(self):
1391 """Get all training batch related settings.
1392 Returns:
1393 train_batch_size (int): The effective training batch size. This is the amount of data
1394 samples that leads to one step of model update.
1395 train_micro_batch_size_per_gpu (int): Batch size to be processed by one GPU in one
1396 step (without gradient accumulation).
1397 gradient_accumulation_steps (int): Number of training steps to accumulate gradients
1398 before averaging and applying them.
1399 """
1400 return (
1401 self.train_batch_size,
1402 self.train_micro_batch_size_per_gpu,
1403 self.gradient_accumulation_steps,
1404 )
1405
1406 def set_train_batch_size(self, train_batch_size):
1407 """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