Closed
Conversation
Member
|
Thanks @cdoersch. I would not remove SetDevice in caffe.cpp, as the root solver gets created after that call. I don't think it is confusing, and the call first checks the current device so it's OK to call it multiple times. |
|
+1, That's really what we need. |
Contributor
Author
|
Someone just needs to update this PR and resolve the merge conflicts, and maybe add some testing code. I haven't had a need for multi-gpu recently, so I haven't kept up with it (I currently don't have time to do so unless it's a part of my research). It shouldn't be too hard to make it work, though. |
Member
|
Closing as replaced by #4563, but thanks for the pycaffe integration of the multi-GPU setup at the time. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A simple interface which allows you to use the new MultiGPU functionality from inside python. Begin by calling
pool=get_solver_pool(solver_file,gpu_list), where solver_file is a string for the file name of the solver definition prototxt, and gpu_list is a python list of ints specifying the gpus to use. pool will then have the methodspool.step(int), which lets you step all solvers in the pool in parallel for the specified number of iterations, andpool.solverswhich is a list of python solver objects.There is currently no documentation or tests. This has been well tested on an older version of the MultiGPU version of caffe. There have been several boilerplate changes since that version (most notably,
P2Psync::runis no longer static, which changed howSolverPoolinteracts with it). I have updated this PR such that it compiles and the tests pass, but it is still possible that I made some mistake while updating the boilerplate. Feedback is appreciated.@cypof parallel.cpp line 396 now calls
SetDevice, since I couldn't find another good place to do this. This means thatSetDevicegets called twice when you run tools/caffe, which is maybe a bit confusing. Let me know if I can get rid of theSetDevicecall in tools/caffe.