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

Method _exec_schedule

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

Source from the content-addressed store, hash-verified

1378 }
1379
1380 def _exec_schedule(self, pipe_schedule):
1381 # Reserve and reset buffers.
1382 self._reserve_pipe_buffers(pipe_schedule.num_pipe_buffers())
1383 self.fwd_outputs = []
1384
1385 # For each step in the schedule
1386 for step_cmds in pipe_schedule:
1387 # For each instruction in the step
1388 for cmd in step_cmds:
1389 if type(cmd) not in self._INSTRUCTION_MAP:
1390 raise RuntimeError(f'{self.__class__.__name__} does not understand instruction {repr(cmd)}')
1391
1392 # Equivalent to: self._exec_forward_pass(buffer_id=0)
1393 self._exec_instr = MethodType(self._INSTRUCTION_MAP[type(cmd)], self)
1394 self._exec_instr(**cmd.kwargs)
1395
1396 def get_additional_losses(self):
1397 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