(param)
| 53 | |
| 54 | |
| 55 | def maybe_zero_3(param): |
| 56 | if hasattr(param, "ds_id"): |
| 57 | assert param.ds_status == ZeroParamStatus.NOT_AVAILABLE |
| 58 | with zero.GatheredParameters([param]): |
| 59 | param = param.data.detach().cpu().clone() |
| 60 | else: |
| 61 | param = param.detach().cpu().clone() |
| 62 | return param |
| 63 | |
| 64 | |
| 65 | # Borrowed from peft.utils.get_peft_model_state_dict |
no outgoing calls
no test coverage detected