Configuration for dynamic weight loading strategies Attributes: dynamic_load_weight: Whether to enable dynamic weight loading load_strategy: Specifies the weight loading method when enabled: - 'ipc': Real-time IPC streaming with automatic resharding
| 1256 | |
| 1257 | |
| 1258 | class LoadConfig: |
| 1259 | """ |
| 1260 | Configuration for dynamic weight loading strategies |
| 1261 | |
| 1262 | Attributes: |
| 1263 | dynamic_load_weight: Whether to enable dynamic weight loading |
| 1264 | load_strategy: Specifies the weight loading method when enabled: |
| 1265 | - 'ipc': Real-time IPC streaming with automatic resharding |
| 1266 | - 'ipc_snapshot': Load from disk snapshot of IPC weights |
| 1267 | - 'meta': Only model meta messages |
| 1268 | - None: No dynamic loading |
| 1269 | """ |
| 1270 | |
| 1271 | def __init__( |
| 1272 | self, |
| 1273 | args, |
| 1274 | ): |
| 1275 | self.load_choices: Union[str, LoadChoices] = LoadChoices.DEFAULT.value |
| 1276 | self.is_pre_sharded: bool = False |
| 1277 | self.dynamic_load_weight: bool = False |
| 1278 | self.load_strategy: Optional[Literal["ipc", "ipc_snapshot", "meta", "normal", "rsync"]] = "normal" |
| 1279 | self.rsync_config: Optional[Dict[str, Any]] = None |
| 1280 | for key, value in args.items(): |
| 1281 | if hasattr(self, key): |
| 1282 | setattr(self, key, value) |
| 1283 | |
| 1284 | def __str__(self) -> str: |
| 1285 | return json.dumps({key: value for key, value in self.__dict__.items()}) |
| 1286 | |
| 1287 | |
| 1288 | class PoolerConfig: |
no outgoing calls