We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 728e167 commit 2f34cc7Copy full SHA for 2f34cc7
swift/megatron/arguments/megatron_args.py
@@ -645,6 +645,11 @@ def __post_init__(self):
645
self.data_parallel_size = self.world_size // total_model_size
646
# Gradient Accumulation
647
self.num_microbatches = self.global_batch_size // self.data_parallel_size // self.micro_batch_size
648
+ if self.num_microbatches == 0:
649
+ raise ValueError('global_batch_size must be >= `data_parallel_size * micro_batch_size` '
650
+ f'to have at least one micro-batch. global_batch_size: {self.global_batch_size}, '
651
+ f'data_parallel_size: {self.data_parallel_size}, '
652
+ f'micro_batch_size: {self.micro_batch_size}.')
653
654
def _init_teacher_model(self):
655
if self.teacher_model is None:
0 commit comments