MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _exec_schedule

Method _exec_schedule

deepspeed/runtime/pipe/engine.py:1396–1410  ·  view source on GitHub ↗
(self, pipe_schedule)

Source from the content-addressed store, hash-verified

1394 }
1395
1396 def _exec_schedule(self, pipe_schedule):
1397 # Reserve and reset buffers.
1398 self._reserve_pipe_buffers(pipe_schedule.num_pipe_buffers())
1399 self.fwd_outputs = []
1400
1401 # For each step in the schedule
1402 for step_cmds in pipe_schedule:
1403 # For each instruction in the step
1404 for cmd in step_cmds:
1405 if type(cmd) not in self._INSTRUCTION_MAP:
1406 raise RuntimeError(f'{self.__class__.__name__} does not understand instruction {repr(cmd)}')
1407
1408 # Equivalent to: self._exec_forward_pass(buffer_id=0)
1409 self._exec_instr = MethodType(self._INSTRUCTION_MAP[type(cmd)], self)
1410 self._exec_instr(**cmd.kwargs)
1411
1412 def get_additional_losses(self):
1413 return self.agg_additional_losses

Callers 2

train_batchMethod · 0.95
eval_batchMethod · 0.95

Calls 2

_reserve_pipe_buffersMethod · 0.95
num_pipe_buffersMethod · 0.45

Tested by

no test coverage detected