-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Enhacemnet] api train support cpu training for mmcv<1.4.4 #1161
Conversation
[Enhace] api train support cpu training
Thanks for your contribution! Not sure if it is really necessary to support CPU training. It normally takes a lot of time. Haha 😆 |
Codecov Report
@@ Coverage Diff @@
## dev-0.24 #1161 +/- ##
===========================================
Coverage ? 82.67%
===========================================
Files ? 204
Lines ? 16365
Branches ? 2943
===========================================
Hits ? 13529
Misses ? 2092
Partials ? 744
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Thanks! |
Thank you very much for your contribution! In fact, we have just supported CPU training/test in #1157, boosted by new features in mmcv 1.4.4. Nevertheless, I think it would be nice to also support for earlier mmcv version. So would you mind modifying this PR and adding an mmcv version check to determine whether to use MMDataParallel on CPU? Here is a reference. |
@ly015 However, there is one thing I am confused, if I use just use a single cpu to train the model, why should I put data to parallel. Is it a standard, or cpu can be more than one pice? Thank you again! |
MMDataParallel does not really perform data parallel in CPU mode. It's equivalent to the simple forward of the wrapped PyTorch module. This design is for keeping a unified interface for both CPU and GPU environments. |
Thanks for letting me know! |
co-authored-by: ly015 <[email protected]>
co-authored-by: ly015 <[email protected]>
…b#1161) co-authored-by: ly015 <[email protected]>
…b#1161) co-authored-by: ly015 <[email protected]>
[Enhance] support training api on cpu
Motivation
support training api on cpu
Modification
add a parameter 'device' and add a if-else in train_module(...)
Checklist
Before PR:
After PR: