(model)
| 35 | |
| 36 | |
| 37 | def free_model(model): |
| 38 | for m in model.modules(): |
| 39 | if isinstance(m, FSDP): |
| 40 | _free_storage(m._handle.flat_param.data) |
| 41 | del model |
| 42 | gc.collect() |
| 43 | torch.cuda.empty_cache() |
nothing calls this directly
no outgoing calls
no test coverage detected