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

Method __init__

lightx2v/common/offload/manager.py:15–26  ·  view source on GitHub ↗
(self, offload_granularity)

Source from the content-addressed store, hash-verified

13
14class WeightAsyncStreamManager(object):
15 def __init__(self, offload_granularity):
16 self.offload_granularity = offload_granularity
17 self.init_stream = torch_device_module.Stream(priority=0)
18 self.need_init_first_buffer = True
19 self.lazy_load = False
20 self.contiguous_group = None
21 self.contiguous_transfer = None
22 torch_version = parse(torch.__version__.split("+")[0])
23 # Legacy name: this is the active device backend's weight-loading stream, not a CUDA-only stream.
24 if PLATFORM == "cuda" and torch_version >= parse("2.7"):
25 self.cuda_load_stream = torch_device_module.Stream(priority=1)
26 self.compute_stream = torch_device_module.Stream(priority=1)
27 else:
28 self.cuda_load_stream = torch_device_module.Stream(priority=0)
29 self.compute_stream = torch_device_module.Stream(priority=-1)

Callers

nothing calls this directly

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected