-
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
[Ready for review] use gfile to support remote directories #2164
Conversation
Thanks @samj1912 fix the one missing call. I also cleaned up how this was being called and fixed up the tests. The tests were using the tmpdir pytest fixture which gives a |
Rebased since the requirements paths changed on master. |
I will leave this a draft PR in case a different solution is suggested for issue #2161 |
Hmm. ok the tests here are now failing on just the 'minimal' builds where it passes on the lastest. A better approach here might be to wrap all the IO in something that can detect what is installed. If running on a minimum of dependencies only support local disk writes, and if more/later deps are installed support cloud file paths. |
tests/trainer/test_trainer.py
Outdated
@@ -501,7 +501,7 @@ def test_benchmark_option(tmpdir): | |||
|
|||
# fit model | |||
trainer = Trainer( | |||
default_root_dir=tmpdir, | |||
default_root_dir=str(tmpdir), |
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.
rather so this casting in Trainer
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.
Sounds good. will make that change.
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.
The reason to do it here is that the trainer and other places correctly type annotate that it should be a str
or Optional[str]
and it is hte tests which are wrong in passing a path object. @Borda I think if the tests are going to do this we should update the type annotations to accept a union of string and path. 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.
yes, then pls update annotation :]
Codecov Report
@@ Coverage Diff @@
## master #2164 +/- ##
======================================
- Coverage 90% 90% -0%
======================================
Files 79 79
Lines 7236 7275 +39
======================================
+ Hits 6530 6541 +11
- Misses 706 734 +28 |
Hello @f4hy! Thanks for updating this PR.
Comment last updated at 2020-08-08 23:37:43 UTC |
de0fd62
to
42b914a
Compare
@f4hy is this ready for 0.8.2 today? |
Yep! Just removed some extra cruft. If you @williamFalcon think this is a good solution to this then I think its ready to go now. I was worried the tests are not passing on the 'minimal' builds, I tried to fix it but looks like its failing on master for minimal right now. |
btw, how does it goes with #2175? |
So s3 support is just one cloud hosting provider. My pr should support any of the backends that tensorboard currently supports which is If the other PR does something this one does not we can add it here, but my understanding is that this is a superset of that. |
This pull request is now in conflict... :( |
1 similar comment
This pull request is now in conflict... :( |
This pull request is now in conflict... :( |
This pull request is now in conflict... :( |
@Borda I have rebased master and updated the tests so now all pass except against windows. I am not quite sure how to test against windows and some tips would be welcome. I believe it is just due to line-ending issues. On a larger issue though, is this design acceptable? I know others have tried to solve similar problems. My issue is my training happens on a Kubernetes cluster where I only have remote file systems to store data so I want all logs/checkpoints/outputs to be written to remote/cloud storage. I think this is a reasonable way to approach it since tensorboard has this capability and is already a dependency but other approaches can work as well. |
This pull request is now in conflict... :( |
commit 29fb0506cd38a15c359e369cc8bc4435916b0c78 Author: Brendan Fahy <[email protected]> Date: Sat Aug 8 19:35:30 2020 +0000 fix checking for version for docs to build commit 467fd64 Author: Brendan Fahy <[email protected]> Date: Sat Aug 8 18:56:05 2020 +0000 remove no local test commit a7cc9f8 Author: Brendan Fahy <[email protected]> Date: Sat Aug 8 18:46:44 2020 +0000 fix commit 3fdbb72 Author: Brendan Fahy <[email protected]> Date: Sat Aug 8 18:23:30 2020 +0000 revert requirements commit 9b8686b Author: Brendan Fahy <[email protected]> Date: Sat Aug 8 18:16:42 2020 +0000 make it a fixture commit eec7495 Author: Brendan Fahy <[email protected]> Date: Sat Aug 8 18:01:32 2020 +0000 fix up the testing commit 896d94a Author: Brendan Fahy <[email protected]> Date: Sat Aug 8 17:47:28 2020 +0000 fix some tests commit 6d22bde Merge: 6175d4e 6ebe0d7 Author: Brendan Fahy <[email protected]> Date: Sat Aug 8 10:20:47 2020 +0000 Merge remote-tracking branch 'origin/master' into tb_use_gfile commit 6175d4e Author: Brendan Fahy <[email protected]> Date: Fri Aug 7 10:16:36 2020 +0000 Use tensorboard.compat.gfile to support remote writing
@Borda Rebased again. Now passes all tests. Should be ready for review. Let me know any ideas on how to improve this. I would like better ways of testing it. The concern I have is ensuring we don't later add some methods to write files that only work locally. So somehow testing this can actually work with remote files would be good, but not sure how to do that without something like docker compose to set that up. Ideas welcome. |
Hi, @f4hy. Was this already merged? I cannot see it on release 1.1.2. Did it got removed somehow? |
We went with fsspec instead. See the other PRs by me. Remote directories should be supported but with fsspec instead |
Before submitting
What does this PR do?
Fixes #2161
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 🙃