MCPcopy
hub / github.com/hpcaitech/ColossalAI / __init__

Method __init__

colossalai/auto_parallel/offload/solver.py:53–66  ·  view source on GitHub ↗
(self, region_list: List[Region], memory_budget: float = -1.0, error_factor: float = 0.95)

Source from the content-addressed store, hash-verified

51 """
52
53 def __init__(self, region_list: List[Region], memory_budget: float = -1.0, error_factor: float = 0.95) -> None:
54 self.region_list = region_list
55
56 self.error_factor: float = error_factor
57 if memory_budget > 0:
58 self.memory_budget = memory_budget * self.error_factor
59 else:
60 self.memory_budget = (
61 torch.cuda.get_device_properties(get_accelerator().get_current_device()).total_memory
62 * self.error_factor
63 )
64
65 self.link_to_bandwidth: Dict[str, Dict[float, float]] = self._profile_bandwidth()
66 self.comp_power: float = self._extract_computing_power()
67
68 @abstractmethod
69 def _call_solver(self):

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 5

_profile_bandwidthMethod · 0.95
get_acceleratorFunction · 0.90
get_device_propertiesMethod · 0.45
get_current_deviceMethod · 0.45

Tested by

no test coverage detected