def METHOD_NAME(self):
    class MyIterableDataset(Dataset):
        def __init__(self, start, end):
            super().__init__()
            assert end > start, "this example code only works with end >= start"
            self.start = start
            self.end = end
            self.samples = list(range(self.start, self.end))
        def __len__(self):
            return self.end - self.start
        def __iter__(self):
            return iter(range(self.start, self.end))
        def __getitem__(self, index):
            return (torch.tensor([index, index]), torch.tensor([index // 2, index // 2]))
    dataset = MyIterableDataset(0, 100)
    torch.manual_seed(42)
    global_batch_size = 16
    loader = DataLoader(dataset, batch_sampler=MegatronPretrainingRandomSampler(100, 0, global_batch_size, 0, 1), num_workers=2)
    batch = next(iter(loader))
    for _micro_batch_size in (1, 2, 4, 8):
        microbatches = list(split_batch_into_microbatch(
            batch,
            _micro_batch_size=_micro_batch_size,
            _global_batch_size=global_batch_size,
        ))
        self.assertEqual(len(microbatches), global_batch_size // _micro_batch_size)
        self.assertEqual(len(microbatches[0][0]), _micro_batch_size)