MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / _sync

Method _sync

lightx2v/common/offload/manager.py:50–60  ·  view source on GitHub ↗

Synchronize to ensure memory visibility across streams. XPU streams do not guarantee cross-stream memory visibility after a per-stream synchronize, so we use a device-wide sync on XPU. On CUDA, per-stream synchronize is sufficient and preferred.

(self)

Source from the content-addressed store, hash-verified

48 assert phases_cuda_buffer is not None
49 self.cuda_buffers = [phases_cuda_buffer[i] for i in range(len(phases_cuda_buffer))]
50 else:
51 raise NotImplementedError
52
53 def init_contiguous_group(self, group):
54 from lightx2v.common.offload.block_layout import ContiguousBlockTransfer
55
56 if group is None:
57 raise ValueError("No contiguous offload group was registered")
58 if self.contiguous_transfer is not None:
59 raise ValueError("An offload manager can initialize only one contiguous group")
60 slots = list(group.device_slots)
61 self.contiguous_transfer = ContiguousBlockTransfer(group.blocks, slots)
62 self.contiguous_group = group
63 self.cuda_buffers = slots

Callers 1

init_first_bufferMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected