-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Allow loading checkpoints from urls #1667
Allow loading checkpoints from urls #1667
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1667 +/- ##
======================================
Coverage 86% 86%
======================================
Files 75 76 +1
Lines 4788 4797 +9
======================================
+ Hits 4134 4143 +9
Misses 654 654 |
@yukw777 how is it going, it this ready for a review? 🦝 |
@Borda I wasn’t sure how to write proper tests for this. Can you advise? |
can we somehow load from |
@Borda let me see if there’s a way to run a simple file serving server locally for pytest... |
if there’s not, you can always mock out the call to the internet and then have a separate test which marks the test as an integration test (pytest.mark.integration) which should only be run on the CI server |
Alright added some tests! I ended up creating a new pytest fixture that runs a simple server that serves |
This pull request is now in conflict... :( |
Hello @yukw777! Thanks for updating this PR.
Comment last updated at 2020-06-11 19:52:35 UTC |
CircleCI jobs timed out. They should pass if rerun. |
if you rebase, the failing test should pass |
This pull request is now in conflict... :( |
from urllib.parse import urlparse | ||
|
||
|
||
def load(path_or_url: str, map_location=None): |
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.
what is type of map_location
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.
we can't really specify this b/c it can be a lot of different things: #1505
Welcome any suggestions.
This pull request is now in conflict... :( |
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.
LGTM 🦝
this is super cool! |
Very keen for this feature! |
Awesome stuff, do we know when the next tagged release will be? (which will include this feature) Also, I assume this feature supports saving to S3 as well? Awesome stuff!! |
most likely by end of this week... |
* allow loading checkpoints from urls * tmpdir_server fixture * test cases for loading checkpoints from url * dir => root_dir * default map_location to None * test case for resume_from_checkpoint * changelog * doc update * monkeypatch TORCH_HOME to avoid caching * Use a threading server with random ports so that it is easier to clean up * test fixes * pep8 fix * ThreadingHTTPServer support in 3.6 * pep8 fix * fix changelog * separate tests for urls * typo Co-authored-by: Peter Yu <2057325+yukw777@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> (cherry picked from commit 06cd849)
* allow loading checkpoints from urls * tmpdir_server fixture * test cases for loading checkpoints from url * dir => root_dir * default map_location to None * test case for resume_from_checkpoint * changelog * doc update * monkeypatch TORCH_HOME to avoid caching * Use a threading server with random ports so that it is easier to clean up * test fixes * pep8 fix * ThreadingHTTPServer support in 3.6 * pep8 fix * fix changelog * separate tests for urls * typo Co-authored-by: Peter Yu <2057325+yukw777@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Hello, guys! What's the state of this feature? I'm interested in using |
Hi, it is in there already, mind try latest version? |
@Borda Hi! Thanks, saving checkpoints to P.S. I suspect it might be a
|
I just tried the new version and the issue I talked about is gone! Very cool! |
Before submitting
What does this PR do?
Fixes #1532. I didn't touch hpc loading.
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃