MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / _batch_assertion

Method _batch_assertion

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

Source from the content-addressed store, hash-verified

876 self.nebula_config = DeepSpeedNebulaConfig(param_dict)
877
878 def _batch_assertion(self):
879
880 train_batch = self.train_batch_size
881 micro_batch = self.train_micro_batch_size_per_gpu
882 grad_acc = self.gradient_accumulation_steps
883
884 assert (train_batch > 0), f"Train batch size: {train_batch} has to be greater than 0"
885
886 assert (micro_batch > 0), f"Micro batch size per gpu: {micro_batch} has to be greater than 0"
887
888 assert (grad_acc > 0), f"Gradient accumulation steps: {grad_acc} has to be greater than 0"
889
890 assert train_batch == micro_batch * grad_acc * self.world_size, (
891 f"Check batch related parameters. train_batch_size is not equal "
892 "to micro_batch_per_gpu * gradient_acc_step * world_size "
893 f"{train_batch} != {micro_batch} * {grad_acc} * {self.world_size}")
894
895 def _set_batch_related_parameters(self):
896

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected