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

Method wait_for_block

utils/offloading.py:277–283  ·  view source on GitHub ↗
(self, block_idx: int)

Source from the content-addressed store, hash-verified

275 clean_memory_on_device(self.device)
276
277 def wait_for_block(self, block_idx: int):
278 if self.blocks_to_swap is None or self.blocks_to_swap == 0:
279 return
280 if self.reentrant_activation_checkpointing and torch.is_grad_enabled():
281 # Second forward pass, don't do block swapping
282 return
283 self._wait_blocks_move(block_idx)
284
285 def submit_move_blocks_forward(self, block_idx: int):
286 # check if blocks_to_swap is enabled

Callers 15

forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80
forwardMethod · 0.80

Calls 1

_wait_blocks_moveMethod · 0.80

Tested by

no test coverage detected