Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
93f20a07
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
93f20a07
编写于
1月 13, 2023
作者:
L
LiYuRio
提交者:
GitHub
1月 13, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove ps_core dependency (#49716)
上级
a09b9a3f
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
36 addition
and
25 deletion
+36
-25
cmake/third_party.cmake
cmake/third_party.cmake
+12
-0
paddle/fluid/distributed/CMakeLists.txt
paddle/fluid/distributed/CMakeLists.txt
+1
-2
paddle/fluid/distributed/fleet_executor/CMakeLists.txt
paddle/fluid/distributed/fleet_executor/CMakeLists.txt
+1
-1
paddle/fluid/distributed/fleet_executor/message_bus.cc
paddle/fluid/distributed/fleet_executor/message_bus.cc
+4
-4
paddle/fluid/distributed/fleet_executor/message_bus.h
paddle/fluid/distributed/fleet_executor/message_bus.h
+3
-3
paddle/fluid/distributed/fleet_executor/message_service.cc
paddle/fluid/distributed/fleet_executor/message_service.cc
+1
-1
paddle/fluid/distributed/fleet_executor/message_service.h
paddle/fluid/distributed/fleet_executor/message_service.h
+1
-1
paddle/fluid/distributed/fleet_executor/test/CMakeLists.txt
paddle/fluid/distributed/fleet_executor/test/CMakeLists.txt
+1
-3
paddle/fluid/framework/CMakeLists.txt
paddle/fluid/framework/CMakeLists.txt
+12
-10
未找到文件。
cmake/third_party.cmake
浏览文件 @
93f20a07
...
@@ -444,6 +444,18 @@ if(WITH_RPC
...
@@ -444,6 +444,18 @@ if(WITH_RPC
list
(
APPEND third_party_deps extern_brpc
)
list
(
APPEND third_party_deps extern_brpc
)
endif
()
endif
()
if
(
WITH_DISTRIBUTE
AND NOT WITH_PSLIB
AND NOT WITH_PSCORE
)
include
(
external/snappy
)
list
(
APPEND third_party_deps extern_snappy
)
include
(
external/leveldb
)
list
(
APPEND third_party_deps extern_leveldb
)
include
(
external/brpc
)
list
(
APPEND third_party_deps extern_brpc
)
endif
()
if
(
WITH_XBYAK
)
if
(
WITH_XBYAK
)
include
(
external/xbyak
)
# download, build, install xbyak
include
(
external/xbyak
)
# download, build, install xbyak
list
(
APPEND third_party_deps extern_xbyak
)
list
(
APPEND third_party_deps extern_xbyak
)
...
...
paddle/fluid/distributed/CMakeLists.txt
浏览文件 @
93f20a07
add_subdirectory
(
auto_parallel
)
add_subdirectory
(
auto_parallel
)
add_subdirectory
(
collective
)
add_subdirectory
(
collective
)
add_subdirectory
(
fleet_executor
)
if
(
WITH_PYTHON
)
if
(
WITH_PYTHON
)
py_proto_compile
(
ps_py_proto SRCS the_one_ps.proto
)
py_proto_compile
(
ps_py_proto SRCS the_one_ps.proto
)
add_custom_target
(
add_custom_target
(
...
@@ -32,7 +33,6 @@ if(WITH_RPC)
...
@@ -32,7 +33,6 @@ if(WITH_RPC)
endif
()
endif
()
if
(
NOT WITH_PSCORE
)
if
(
NOT WITH_PSCORE
)
add_subdirectory
(
fleet_executor
)
return
()
return
()
endif
()
endif
()
...
@@ -49,4 +49,3 @@ add_subdirectory(common)
...
@@ -49,4 +49,3 @@ add_subdirectory(common)
add_subdirectory
(
ps
)
add_subdirectory
(
ps
)
add_subdirectory
(
test
)
add_subdirectory
(
test
)
add_subdirectory
(
index_dataset
)
add_subdirectory
(
index_dataset
)
add_subdirectory
(
fleet_executor
)
paddle/fluid/distributed/fleet_executor/CMakeLists.txt
浏览文件 @
93f20a07
...
@@ -6,7 +6,7 @@ proto_library(interceptor_message_proto SRCS interceptor_message.proto)
...
@@ -6,7 +6,7 @@ proto_library(interceptor_message_proto SRCS interceptor_message.proto)
if
(
WITH_ARM_BRPC
)
if
(
WITH_ARM_BRPC
)
set
(
BRPC_DEPS arm_brpc snappy gflags glog
)
set
(
BRPC_DEPS arm_brpc snappy gflags glog
)
elseif
(
WITH_DISTRIBUTE
AND WITH_PSCORE
)
elseif
(
WITH_DISTRIBUTE
)
set
(
BRPC_DEPS
set
(
BRPC_DEPS
brpc
brpc
ssl
ssl
...
...
paddle/fluid/distributed/fleet_executor/message_bus.cc
浏览文件 @
93f20a07
...
@@ -73,7 +73,7 @@ bool MessageBus::IsInit() const { return is_init_; }
...
@@ -73,7 +73,7 @@ bool MessageBus::IsInit() const { return is_init_; }
MessageBus
::~
MessageBus
()
{
MessageBus
::~
MessageBus
()
{
VLOG
(
3
)
<<
"Message bus releases resource."
;
VLOG
(
3
)
<<
"Message bus releases resource."
;
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
server_
.
Stop
(
1000
);
server_
.
Stop
(
1000
);
server_
.
Join
();
server_
.
Join
();
#endif
#endif
...
@@ -94,7 +94,7 @@ bool MessageBus::Send(int64_t dst_rank,
...
@@ -94,7 +94,7 @@ bool MessageBus::Send(int64_t dst_rank,
true
,
true
,
platform
::
errors
::
PreconditionNotMet
(
platform
::
errors
::
PreconditionNotMet
(
"Using message bus since it has not been initialized."
));
"Using message bus since it has not been initialized."
));
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
int
retry_time
=
0
;
// message bus will retry sending for 10 times
int
retry_time
=
0
;
// message bus will retry sending for 10 times
while
(
retry_time
<
10
)
{
while
(
retry_time
<
10
)
{
++
retry_time
;
++
retry_time
;
...
@@ -179,7 +179,7 @@ void MessageBus::ListenPort() {
...
@@ -179,7 +179,7 @@ void MessageBus::ListenPort() {
LOG
(
INFO
)
<<
"No need listen to port since training on single card."
;
LOG
(
INFO
)
<<
"No need listen to port since training on single card."
;
return
;
return
;
}
}
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
// function keep listen the port and handle the message
// function keep listen the port and handle the message
PADDLE_ENFORCE_EQ
(
PADDLE_ENFORCE_EQ
(
server_
.
AddService
(
&
message_service_
,
brpc
::
SERVER_DOESNT_OWN_SERVICE
),
server_
.
AddService
(
&
message_service_
,
brpc
::
SERVER_DOESNT_OWN_SERVICE
),
...
@@ -209,7 +209,7 @@ void MessageBus::ListenPort() {
...
@@ -209,7 +209,7 @@ void MessageBus::ListenPort() {
#endif
#endif
}
}
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
bool
MessageBus
::
SendInterRank
(
int64_t
dst_rank
,
bool
MessageBus
::
SendInterRank
(
int64_t
dst_rank
,
const
InterceptorMessage
&
interceptor_message
)
{
const
InterceptorMessage
&
interceptor_message
)
{
const
auto
&
dst_addr
=
GetAddr
(
dst_rank
);
const
auto
&
dst_addr
=
GetAddr
(
dst_rank
);
...
...
paddle/fluid/distributed/fleet_executor/message_bus.h
浏览文件 @
93f20a07
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
#include <thread>
#include <thread>
#include <unordered_map>
#include <unordered_map>
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
#include "brpc/channel.h"
#include "brpc/channel.h"
#include "brpc/server.h"
#include "brpc/server.h"
#include "paddle/fluid/distributed/fleet_executor/message_service.h"
#include "paddle/fluid/distributed/fleet_executor/message_service.h"
...
@@ -63,7 +63,7 @@ class MessageBus final {
...
@@ -63,7 +63,7 @@ class MessageBus final {
const
std
::
string
&
GetAddr
(
int64_t
rank
)
const
;
const
std
::
string
&
GetAddr
(
int64_t
rank
)
const
;
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
// send the message inter rank (dst is different rank with src)
// send the message inter rank (dst is different rank with src)
bool
SendInterRank
(
int64_t
dst_rank
,
bool
SendInterRank
(
int64_t
dst_rank
,
const
InterceptorMessage
&
interceptor_message
);
const
InterceptorMessage
&
interceptor_message
);
...
@@ -79,7 +79,7 @@ class MessageBus final {
...
@@ -79,7 +79,7 @@ class MessageBus final {
// the ip needs to be listened
// the ip needs to be listened
std
::
string
addr_
;
std
::
string
addr_
;
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
MessageServiceImpl
message_service_
;
MessageServiceImpl
message_service_
;
// brpc server
// brpc server
brpc
::
Server
server_
;
brpc
::
Server
server_
;
...
...
paddle/fluid/distributed/fleet_executor/message_service.cc
浏览文件 @
93f20a07
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
#include "paddle/fluid/distributed/fleet_executor/message_service.h"
#include "paddle/fluid/distributed/fleet_executor/message_service.h"
#include "brpc/server.h"
#include "brpc/server.h"
...
...
paddle/fluid/distributed/fleet_executor/message_service.h
浏览文件 @
93f20a07
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// See the License for the specific language governing permissions and
// limitations under the License.
// limitations under the License.
#if defined(PADDLE_WITH_DISTRIBUTE)
&& defined(PADDLE_WITH_PSCORE)
#if defined(PADDLE_WITH_DISTRIBUTE)
#pragma once
#pragma once
#include "brpc/server.h"
#include "brpc/server.h"
...
...
paddle/fluid/distributed/fleet_executor/test/CMakeLists.txt
浏览文件 @
93f20a07
...
@@ -51,9 +51,7 @@ cc_test_old(
...
@@ -51,9 +51,7 @@ cc_test_old(
scope
scope
device_context
)
device_context
)
if
(
WITH_DISTRIBUTE
if
(
WITH_DISTRIBUTE AND
NOT
(
WITH_ASCEND OR WITH_ASCEND_CL
))
AND WITH_PSCORE
AND
NOT
(
WITH_ASCEND OR WITH_ASCEND_CL
))
set_source_files_properties
(
set_source_files_properties
(
interceptor_ping_pong_with_brpc_test.cc
interceptor_ping_pong_with_brpc_test.cc
PROPERTIES COMPILE_FLAGS
${
DISTRIBUTE_COMPILE_FLAGS
}
)
PROPERTIES COMPILE_FLAGS
${
DISTRIBUTE_COMPILE_FLAGS
}
)
...
...
paddle/fluid/framework/CMakeLists.txt
浏览文件 @
93f20a07
...
@@ -630,16 +630,18 @@ if(WITH_PYTHON)
...
@@ -630,16 +630,18 @@ if(WITH_PYTHON)
${
PADDLE_BINARY_DIR
}
/python/paddle/distributed/fleet/proto
${
PADDLE_BINARY_DIR
}
/python/paddle/distributed/fleet/proto
COMMENT
"Copy generated python proto into directory paddle/fluid/proto."
COMMENT
"Copy generated python proto into directory paddle/fluid/proto."
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
WORKING_DIRECTORY
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_custom_target
(
if
(
NOT WITH_ROCM
)
fleet_executor_proto_init ALL
add_custom_target
(
DEPENDS fleet_proto_init fleet_executor_desc_py_proto
fleet_executor_proto_init ALL
COMMAND
DEPENDS fleet_proto_init fleet_executor_desc_py_proto
cp
COMMAND
${
PADDLE_BINARY_DIR
}
/paddle/fluid/distributed/fleet_executor/fleet_executor_*.py
cp
${
PADDLE_BINARY_DIR
}
/python/paddle/distributed/fleet/proto
${
PADDLE_BINARY_DIR
}
/paddle/fluid/distributed/fleet_executor/fleet_executor_*.py
COMMENT
${
PADDLE_BINARY_DIR
}
/python/paddle/distributed/fleet/proto
"Copy generated python proto into directory paddle/distributed/fleet/proto."
COMMENT
)
"Copy generated python proto into directory paddle/distributed/fleet/proto."
)
endif
()
else
()
else
()
string
(
REPLACE
"/"
"
\\
"
proto_dstpath
string
(
REPLACE
"/"
"
\\
"
proto_dstpath
"
${
PADDLE_BINARY_DIR
}
/python/paddle/fluid/proto/"
)
"
${
PADDLE_BINARY_DIR
}
/python/paddle/fluid/proto/"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录