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

Function get_data_iterator_for_step

train.py:167–173  ·  view source on GitHub ↗
(dataloader, engine, num_micro_batches=None)

Source from the content-addressed store, hash-verified

165# first and last stage. Can't do that during the train or inference pipeline schedule execution
166# because it conflicts with the send / recv steps.
167def get_data_iterator_for_step(dataloader, engine, num_micro_batches=None):
168 num_micro_batches = num_micro_batches or engine.micro_batches
169 if not (engine.is_first_stage() or engine.is_last_stage()):
170 return None
171 dataloader_iter = iter(dataloader)
172 items = [next(dataloader_iter) for _ in range(num_micro_batches)]
173 return iter(items)
174
175
176def evaluate_single(model_engine, eval_dataloader, eval_gradient_accumulation_steps, quantile, pbar=None):

Callers 2

evaluate_singleFunction · 0.85
train.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected