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

Method _batch_assertion

deepspeed/runtime/config.py:594–609  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

592 self.expert_parallel_config = get_expert_parallel_config(param_dict)
593
594 def _batch_assertion(self):
595
596 train_batch = self.train_batch_size
597 micro_batch = self.train_micro_batch_size_per_gpu
598 grad_acc = self.gradient_accumulation_steps
599
600 assert (train_batch > 0), f"Train batch size: {train_batch} has to be greater than 0"
601
602 assert (micro_batch > 0), f"Micro batch size per gpu: {micro_batch} has to be greater than 0"
603
604 assert (grad_acc > 0), f"Gradient accumulation steps: {grad_acc} has to be greater than 0"
605
606 assert train_batch == micro_batch * grad_acc * self.world_size, (
607 f"Check batch related parameters. train_batch_size is not equal "
608 "to micro_batch_per_gpu * gradient_acc_step * world_size "
609 f"{train_batch} != {micro_batch} * {grad_acc} * {self.world_size}")
610
611 def _set_batch_related_parameters(self):
612

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected