code: def __init__(
      self, global_batch_size, micro_batch_size, data_parallel_size
  ):
      micro_batch_times_data_parallel = (
          micro_batch_size * data_parallel_size
      )
      assert global_batch_size % micro_batch_times_data_parallel == 0, (
          "global batch size ({}) is not divisible by micro batch size ({})"
          " times data parallel size ({})".format(
              global_batch_size, micro_batch_size, data_parallel_size
          )
      )
      self.num_micro_batches = (
          global_batch_size // micro_batch_times_data_parallel
      )
      assert self.num_micro_batches >= 1
      self.current_global_batch_size = global_batch_size
  
file_path: megatron-lm/megatron/microbatches.py
imports: from abc import ABC
  from abc import abstractmethod
label_desc: Use image node_id 1 to create a new ConstantNumMicroBatches object from inherited base classes: NumMicroBatchesCalculator with example: obj = ConstantNumMicroBatches(global_batch_size, micro_batch_size, data_parallel_size)