Make add_artifact replace by name (#685)#925
Conversation
|
Hi @gkanwar! I'm happy to accept this feature! But the default behavior shouldn't change so that we don't break other people's code. I prefer a flag added to the |
With the current version of the PR this means that the user has to do the rate-limiting by renaming the artifacts, right? Would it make sense to add an option for this? E.g., to overwrite an artifact for 10 minutes and then add a new one? |
|
Hi @thequilo, thanks for the quick reply! A flag in the Yes, the user could do something like frequently saving over the I'm hesitant to add such an automatic timed backup feature, since for example users may want to organize these files differently. In our case, it's checkpointing based on gradient descent steps, which is of course not known to sacred explicitly. We set our filenames based on this. |
Agreed, it makes more sense to let the users do it themselves. There are too many different usecases. |
This addresses the feature request in Issue #685. In our experiments we have found this pattern to be very useful, e.g. for model checkpoints or intermediate artifact checkpoints. With this PR, artifact checkpoints can be updated frequently so the latest checkpoint is up-to-date. At a much slower rate, artifacts can be checkpointed to distinct names to preserve history with much less disk usage.
If it's preferable to not make this the default behavior, I would be happy to update the PR to thread a flag through add_artifact to optionally enable this behavior.