-
-
Notifications
You must be signed in to change notification settings - Fork 654
Issue 1986 Checkpointing write & remove order change #1995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devrimcavusoglu
wants to merge
17
commits into
pytorch:master
Choose a base branch
from
devrimcavusoglu:issue-1986-wr-order
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
230a497
Lazy saving option added.
devrimcavusoglu 495fc84
Reverting from lazy save to direct save, allowing atomic option.
devrimcavusoglu 5d9aaee
Reverting from lazy save to direct save, allowing atomic option.
devrimcavusoglu 2509cda
Clearml storagehelper implementation
devrimcavusoglu 4b6a609
Typo fix.
devrimcavusoglu 7c77901
check for n_saved corrected.
devrimcavusoglu 853283d
logger added to StorageHelper.
devrimcavusoglu fbd58e5
Neptune Logger typo, reverted.
devrimcavusoglu ea3b39b
Docstring revised. Note section added instead of linking to issue.
devrimcavusoglu a0a7448
Docstring revised. Note section added instead of linking to issue.
devrimcavusoglu 46ed98b
Docstring revised.
devrimcavusoglu 090f0da
logger removed from StorageHelper params.
devrimcavusoglu 5b2c981
Note section reduced in docstring.
devrimcavusoglu bdf2bb9
Delete operation handle for earlier versions.
devrimcavusoglu 2c3f0c0
Black codestyle reformatted.
devrimcavusoglu 45c7eb6
Version reformatted as <major.minor.patch>.
devrimcavusoglu 69d3b42
Merge branch 'pytorch:master' into issue-1986-wr-order
devrimcavusoglu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devrimcavusoglu could you please explain why you are adding this code ?
I understand that the idea is to use clearml's v1.0 new feature and make
removework as expected for others.I'm not sure how it would work with the previous logic where a queue is used...
cc @bmartinn any suggestion on how we could recode everything here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you said, this would make use of clearml v1.0 new feature, and used to actually remove the remote or local file(s). For backward compatibility, I'd appreciate any suggestions.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to pass
loggertoStorageHelper.get, basically this should be fine:clearmlv1.0 supports older versions ofclearml-server, so pushing the requirements forclearml>1.0should not be limiting in any way for users.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review & comment @bmartinn. I'll update PR with that change asap. I and @vfdev-5 were mainly concerned about backward compatibility as it may negatively impact users using
clearml<1.0; however, I see that it is not a concern.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devrimcavusoglu I rechecked backwards compatibility, the only exception will be uploading models directly to
clearml-server< 1.0. If this is the case the delete function might return an error as the http file server did not support the delete operation. I really think that just protecting withexcept ValueErrorshould be enough. wdyt?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bmartinn can you please confirm whether we still need
_CallbacksContextand_checkpoint_slotscode with clearml v1.X ?I have an impression that if we could remove data from remote storage then we can drastically simplify
ClearMLSaverfor v1.X ?The idea could be to setup
ClearMLSaverasClearMLSaverV1if clearml is present and has version >= 1.0.For clearml version < 1.0 we can keep the existing code as
ClearMLSaverV0and try to temporary hack it in order to make it work with the new write->remove logic. Later we will remove the support for clearml version < 1.0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@devrimcavusoglu I wonder if we could recode
__call__andremovemethods forClearMLSaverV0to delay saving execution. We have two possibilities when saving new checkpoint:Second case could be covered easily such that we call "saving" ops in remove method:
... slots[slots.index(filename)] = None ... try: super(ClearMLSaver, self).__call__(checkpoint, filename, metadata) finally: WeightsFileHandler.remove_pre_callback(pre_cb_id) WeightsFileHandler.remove_post_callback(post_cb_id)The first case is complicated as remove method is not called. Maybe we could schedule a thread to execute saving ops after a delay of 5-10 seconds ?
What do you think ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vfdev-5 Hi there, sorry for delayed reply (was in tight schedule). Option 2 seems more solid to me, and also more practical. Regarding the class seperation (former comment) for different versions, I think rather than pointing to V0 and V1, handling it under
ClearMLSaverwould be more concrete, wdyt ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that doing things into two separate classes will help us later to quickly remove V0 when no one is using it anymore...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vfdev-5,
I think that if you handle storing a new checkpoint to a temporary-named newly uploaded, file, removing the previously uploaded file and renaming the temporary-named file to the previous name, you won't need the checkpoints 🙂