(model, state, ginfo)
| 202 | |
| 203 | |
| 204 | def load_state_model(model, state, ginfo): |
| 205 | if ginfo.task_rank == 0: |
| 206 | printlog(f'======= loading model state for task {ginfo.task_id} ... =======') |
| 207 | |
| 208 | msg = model.load_state_dict(state, strict=False) |
| 209 | |
| 210 | state_keys = set(state.keys()) |
| 211 | model_keys = set(model.state_dict().keys()) |
| 212 | missing_keys = model_keys - state_keys |
| 213 | if ginfo.task_rank == 0: |
| 214 | for k in missing_keys: |
| 215 | printlog(f'missing key: {k}') |
| 216 | printlog(f'load msg: {msg}') |
| 217 | |
| 218 | |
| 219 | def load_state_optimizer(optimizer, state, ginfo): |
no test coverage detected