MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / __init__

Method __init__

utils/dataset.py:1288–1308  ·  view source on GitHub ↗
(self, dataset, model_engine, gradient_accumulation_steps, model, num_dataloader_workers=1)

Source from the content-addressed store, hash-verified

1286# Updates epoch as soon as the final batch is returned (notably different from qlora-pipe).
1287class PipelineDataLoader:
1288 def __init__(self, dataset, model_engine, gradient_accumulation_steps, model, num_dataloader_workers=1):
1289 if len(dataset) == 0:
1290 raise RuntimeError(
1291 'Processed dataset was empty. Probably caused by rounding down for each size bucket.\n'
1292 'Try decreasing the global batch size, or increasing num_repeats.\n'
1293 f'The dataset config that triggered this error was:\n{dataset.dataset_config}'
1294 )
1295 self.model = model
1296 self.dataset = dataset
1297 self.model_engine = model_engine
1298 self.gradient_accumulation_steps = gradient_accumulation_steps
1299 self.num_dataloader_workers = num_dataloader_workers
1300 self.iter_called = False
1301 self.eval_quantile = None
1302 self.epoch = 1
1303 self.num_batches_pulled = 0
1304 self.next_micro_batch = None
1305 self.recreate_dataloader = False
1306 # Be careful to only create the DataLoader some bounded number of times: https://github.com/pytorch/pytorch/issues/91252
1307 self._create_dataloader()
1308 self.data = self._pull_batches_from_dataloader()
1309
1310 def reset(self):
1311 self.epoch = 1

Callers

nothing calls this directly

Calls 2

_create_dataloaderMethod · 0.95

Tested by

no test coverage detected