(model_dict, weight_cache_dir)
| 163 | def save_model(model_arg_name="model", config_arg_name="fd_config"): |
| 164 | @measure_time("Model saving") |
| 165 | def _save_model(model_dict, weight_cache_dir): |
| 166 | # Note: ProcessGroupNCCL do not support deepcopy protocol, we made modifications here. |
| 167 | paddle.distributed.communication.group.Group.__deepcopy__ = lambda self, _: self |
| 168 | paddle.distributed.communication.group.Group.to_json = lambda self: repr(self) |
| 169 | paddle.save(model_dict, weight_cache_dir) |
| 170 | |
| 171 | def decorator(func): |
| 172 | @wraps(func) |