(dataloader, engine, num_micro_batches=None)
| 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. |
| 167 | def 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 | |
| 176 | def evaluate_single(model_engine, eval_dataloader, eval_gradient_accumulation_steps, quantile, pbar=None): |
no outgoing calls
no test coverage detected