returnn
returnn copied to clipboard
PyTorch cleanup logic
At some point we need to have a cleanup logic for the PyTorch engine, similar to cleanup_old_models (https://github.com/rwth-i6/returnn/blob/master/returnn/tf/engine.py#L2103).
Do we want to have a compatible logic with the same defaults, or have it simpler? What we definitely should implement first is the automatic deletion of the optimizer states, which take a huge amount of file space.
We can actually mostly share the code. I.e. move that over to the base EngineBase.
Just delete_model might need to be specialized. That can also cover the optimizer states.