-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[multiprocessing] Add paddle.incubate.multiprocessing for sharing tensors between python processes. #37302
Conversation
18c3c0b
to
2f5a055
Compare
Sorry to inform you that 2f5a055's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
@@ -131,4 +131,7 @@ cc_library(virtual_memory_auto_growth_best_fit_allocator SRCS virtual_memory_aut | |||
if(NOT WIN32) | |||
cc_library(mmap_allocator SRCS mmap_allocator.cc DEPS allocator) | |||
cc_test(mmap_allocator_test SRCS mmap_allocator_test.cc DEPS mmap_allocator allocator) | |||
if (WITH_GPU) |
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.
这块需要限制成非WIN32吗? 下面cuda_ipc_allocator在define的时候限制了非WIN32
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.
没有尝试,cmake里这么写,也可以减少 WIN32下的编译问题
if tensor.place.is_cpu_place() or tensor.place.is_gpu_place( | ||
) or tensor.place.is_cuda_pinned_place(): | ||
if type(tensor) == paddle.fluid.framework.ParamBase: | ||
metadata = copy.deepcopy(tensor.__dict__) |
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.
这里有个疑问,为啥知识对Parameter类型进行deep copy了?或者说这里对persisable类型要进行deep copy
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.
因为 Parameter 的一些属性比较多,对于普通的Tensor我们只单独记录了 stop_gradients 属性,
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
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 for set_tests_properties(test_paddle_multiprocessing PROPERTIES TIMEOUT 120)
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 for skipIf
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
PR types
New features
PR changes
Others
Describe
Add paddle.incubate.multiprocessing for tensor sharing between python process.
This PR aims give an initial version of paddle.incubate.multiprocessing which support both CPU and GPU tensor.
Here are some TODOs for this PR. The full RoadMap is at the end of this PR。
Useage
Paddle.multiprocessing RoadMap
Sharing CPU Tensor.
platform
other
Sharing GPU Tensor.
other
Influence on Paddle Framework
Application