Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
4748486e
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
未验证
提交
4748486e
编写于
1月 27, 2022
作者:
T
Thunderbrook
提交者:
GitHub
1月 27, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
compile for afs api (#39113)
* compile for afs api * with pslib
上级
a7edb3f3
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
44 addition
and
24 deletion
+44
-24
CMakeLists.txt
CMakeLists.txt
+4
-0
cmake/external/gloo.cmake
cmake/external/gloo.cmake
+1
-1
cmake/flags.cmake
cmake/flags.cmake
+10
-0
cmake/third_party.cmake
cmake/third_party.cmake
+4
-2
paddle/fluid/framework/CMakeLists.txt
paddle/fluid/framework/CMakeLists.txt
+3
-1
paddle/fluid/framework/device_worker.h
paddle/fluid/framework/device_worker.h
+2
-2
paddle/fluid/framework/device_worker_factory.cc
paddle/fluid/framework/device_worker_factory.cc
+1
-1
paddle/fluid/framework/fleet/CMakeLists.txt
paddle/fluid/framework/fleet/CMakeLists.txt
+3
-1
paddle/fluid/framework/fleet/heter_wrapper.cc
paddle/fluid/framework/fleet/heter_wrapper.cc
+1
-1
paddle/fluid/framework/fleet/heter_wrapper.h
paddle/fluid/framework/fleet/heter_wrapper.h
+1
-1
paddle/fluid/framework/heter_service.h
paddle/fluid/framework/heter_service.h
+2
-2
paddle/fluid/framework/heter_util.h
paddle/fluid/framework/heter_util.h
+5
-5
paddle/fluid/framework/hetercpu_worker.cc
paddle/fluid/framework/hetercpu_worker.cc
+1
-1
paddle/fluid/framework/heterxpu_trainer.cc
paddle/fluid/framework/heterxpu_trainer.cc
+1
-1
paddle/fluid/framework/trainer.h
paddle/fluid/framework/trainer.h
+1
-1
paddle/fluid/framework/trainer_factory.cc
paddle/fluid/framework/trainer_factory.cc
+1
-1
paddle/fluid/pybind/heter_wrapper_py.cc
paddle/fluid/pybind/heter_wrapper_py.cc
+1
-1
paddle/fluid/pybind/heter_wrapper_py.h
paddle/fluid/pybind/heter_wrapper_py.h
+1
-1
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
4748486e
...
...
@@ -333,6 +333,10 @@ else()
endif
()
endif
()
if
(
WITH_HETERPS AND WITH_PSLIB
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-D_GLIBCXX_USE_CXX11_ABI=0"
)
endif
()
if
(
WITH_DISTRIBUTE
)
if
(
LINUX
)
set
(
WITH_GLOO ON CACHE STRING
"Enable GLOO when compiling WITH_DISTRIBUTE=ON."
FORCE
)
...
...
cmake/external/gloo.cmake
浏览文件 @
4748486e
...
...
@@ -55,7 +55,7 @@ else()
UPDATE_COMMAND
""
CONFIGURE_COMMAND
""
BUILD_COMMAND mkdir -p
${
GLOO_SOURCE_DIR
}
/build
&& cd
${
GLOO_SOURCE_DIR
}
/build && cmake .. && make
&& cd
${
GLOO_SOURCE_DIR
}
/build && cmake ..
-DCMAKE_CXX_FLAGS=
${
CMAKE_CXX_FLAGS
}
&& make
&& mkdir -p
${
GLOO_LIBRARY_DIR
}
${
GLOO_INCLUDE_DIR
}
/gloo
INSTALL_COMMAND
${
CMAKE_COMMAND
}
-E copy
${
GLOO_SOURCE_DIR
}
/build/gloo/libgloo.a
${
GLOO_LIBRARY_DIR
}
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
"
${
GLOO_SOURCE_DIR
}
/gloo/"
"
${
GLOO_INCLUDE_DIR
}
/gloo"
...
...
cmake/flags.cmake
浏览文件 @
4748486e
...
...
@@ -202,6 +202,16 @@ if (APPLE)
set
(
COMMON_FLAGS -Wno-deprecated-register
)
endif
(
APPLE
)
if
(
WITH_HETERPS AND WITH_PSLIB
)
set
(
COMMON_FLAGS
-D_GLIBCXX_USE_CXX11_ABI=0
${
COMMON_FLAGS
}
)
set
(
GPU_COMMON_FLAGS
-D_GLIBCXX_USE_CXX11_ABI=0
${
GPU_COMMON_FLAGS
}
)
endif
()
if
(
LINUX
)
set
(
GPU_COMMON_FLAGS
-Wall
...
...
cmake/third_party.cmake
浏览文件 @
4748486e
...
...
@@ -299,8 +299,10 @@ if(WITH_PSLIB)
include
(
external/leveldb
)
list
(
APPEND third_party_deps extern_leveldb
)
include
(
external/brpc
)
list
(
APPEND third_party_deps extern_brpc
)
if
(
NOT WITH_HETERPS
)
include
(
external/brpc
)
list
(
APPEND third_party_deps extern_brpc
)
endif
()
endif
()
endif
(
WITH_PSLIB
)
...
...
paddle/fluid/framework/CMakeLists.txt
浏览文件 @
4748486e
...
...
@@ -118,7 +118,9 @@ cc_test(var_type_traits_test SRCS var_type_traits_test.cc DEPS var_type_traits)
set
(
BRPC_DEPS
""
)
if
(
WITH_PSLIB OR WITH_PSCORE
)
set
(
BRPC_DEPS brpc ssl crypto
)
if
(
NOT WITH_HETERPS
)
set
(
BRPC_DEPS brpc ssl crypto
)
endif
()
if
(
WITH_PSLIB_BRPC
)
set
(
BRPC_DEPS pslib_brpc
)
endif
()
...
...
paddle/fluid/framework/device_worker.h
浏览文件 @
4748486e
...
...
@@ -61,7 +61,7 @@ bool CheckValidOutput(LoDTensor* tensor, size_t batch_size);
class
FleetWrapper
;
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
class
HeterWrapper
;
#endif
...
...
@@ -359,7 +359,7 @@ class DownpourWorkerOpt : public DownpourWorker {
uint64_t
async_tid_
=
0
;
};
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
class
HeterCpuWorker
:
public
HogwildWorker
{
public:
HeterCpuWorker
()
{}
...
...
paddle/fluid/framework/device_worker_factory.cc
浏览文件 @
4748486e
...
...
@@ -70,7 +70,7 @@ REGISTER_DEVICE_WORKER_CLASS(DownpourWorkerOpt);
REGISTER_DEVICE_WORKER_CLASS
(
HeterSectionWorker
);
#endif
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
REGISTER_DEVICE_WORKER_CLASS
(
HeterCpuWorker
);
#endif
...
...
paddle/fluid/framework/fleet/CMakeLists.txt
浏览文件 @
4748486e
...
...
@@ -2,7 +2,9 @@ if(WITH_PSLIB)
if
(
WITH_PSLIB_BRPC
)
set
(
BRPC_DEPS pslib_brpc
)
else
()
set
(
BRPC_DEPS brpc
)
if
(
NOT WITH_HETERPS
)
set
(
BRPC_DEPS brpc
)
endif
()
endif
(
WITH_PSLIB_BRPC
)
cc_library
(
fleet_wrapper SRCS fleet_wrapper.cc DEPS framework_proto proto_desc op_registry variable_helper scope
${
BRPC_DEPS
}
pslib
)
else
()
...
...
paddle/fluid/framework/fleet/heter_wrapper.cc
浏览文件 @
4748486e
...
...
@@ -27,7 +27,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/framework/fleet/heter_wrapper.h"
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
#include "paddle/fluid/framework/device_worker.h"
namespace
paddle
{
...
...
paddle/fluid/framework/fleet/heter_wrapper.h
浏览文件 @
4748486e
...
...
@@ -23,7 +23,7 @@ limitations under the License. */
#include <unordered_map>
#include <vector>
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
#include "paddle/fluid/framework/heter_service.h"
#include "paddle/fluid/framework/heter_util.h"
#include "paddle/fluid/framework/scope.h"
...
...
paddle/fluid/framework/heter_service.h
浏览文件 @
4748486e
...
...
@@ -25,7 +25,7 @@ limitations under the License. */
#include "paddle/fluid/framework/heter_service.pb.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/scope.h"
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
#include "brpc/channel.h"
#include "brpc/controller.h"
#include "brpc/server.h"
...
...
@@ -35,7 +35,7 @@ limitations under the License. */
namespace
paddle
{
namespace
framework
{
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
typedef
std
::
function
<
int
(
const
HeterRequest
*
,
HeterResponse
*
)
>
HeterServiceHandler
;
class
DataFeed
;
...
...
paddle/fluid/framework/heter_util.h
浏览文件 @
4748486e
...
...
@@ -14,7 +14,6 @@ limitations under the License. */
#pragma once
#ifdef PADDLE_WITH_PSLIB
#include <fstream>
#include <memory>
#include <mutex> // NOLINT
...
...
@@ -23,11 +22,12 @@ limitations under the License. */
#include <unordered_map> // NOLINT
#include <unordered_set> // NOLINT
#include <vector>
#if defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
#include "bthread/bthread.h"
#endif
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/platform/timer.h"
namespace
paddle
{
namespace
framework
{
class
DataFeed
;
...
...
@@ -106,7 +106,7 @@ class HeterTask {
double
cpu_2_gpu_time
{
0
};
platform
::
Timer
timeline
;
};
#endif
template
<
class
T
>
class
HeterObjectPool
{
public:
...
...
@@ -143,7 +143,7 @@ class HeterObjectPool {
int
num_
{
0
};
};
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
struct
BthreadMutextGuard
{
BthreadMutextGuard
(
bthread_mutex_t
*
rho
)
{
mutex_
=
rho
;
...
...
@@ -328,6 +328,6 @@ class HeterList {
int
cap_
;
int
size
;
};
#endif
}
// namespace framework
}
// namespace paddle
#endif
paddle/fluid/framework/hetercpu_worker.cc
浏览文件 @
4748486e
...
...
@@ -19,7 +19,7 @@ limitations under the License. */
#include "paddle/fluid/platform/cpu_helper.h"
#include "paddle/fluid/string/string_helper.h"
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
#if defined _WIN32 || defined __APPLE__
#else
...
...
paddle/fluid/framework/heterxpu_trainer.cc
浏览文件 @
4748486e
...
...
@@ -24,7 +24,7 @@ limitations under the License. */
#include "paddle/fluid/framework/fleet/heter_wrapper.h"
#include "paddle/fluid/framework/trainer.h"
#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_XPU) && \
(defined PADDLE_WITH_PSLIB)
(defined PADDLE_WITH_PSLIB)
&& (!defined(PADDLE_WITH_HETERPS))
#ifdef PADDLE_WITH_CUDA
#include "paddle/fluid/platform/cuda_device_guard.h"
#endif
...
...
paddle/fluid/framework/trainer.h
浏览文件 @
4748486e
...
...
@@ -155,7 +155,7 @@ class DistMultiTrainer : public MultiTrainer {
#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_HIP || \
defined PADDLE_WITH_XPU) && \
(defined PADDLE_WITH_PSLIB)
(defined PADDLE_WITH_PSLIB)
&& (!defined(PADDLE_WITH_HETERPS))
class
HeterServiceContext
{
public:
HeterServiceContext
()
{}
...
...
paddle/fluid/framework/trainer_factory.cc
浏览文件 @
4748486e
...
...
@@ -73,7 +73,7 @@ REGISTER_TRAINER_CLASS(HeterPipelineTrainer);
#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_HIP || \
defined PADDLE_WITH_XPU) && \
(defined PADDLE_WITH_PSLIB)
(defined PADDLE_WITH_PSLIB)
&& (!defined(PADDLE_WITH_HETERPS))
REGISTER_TRAINER_CLASS
(
HeterXpuTrainer
);
#endif
#if (defined PADDLE_WITH_NCCL || defined PADDLE_WITH_RCCL) && \
...
...
paddle/fluid/pybind/heter_wrapper_py.cc
浏览文件 @
4748486e
...
...
@@ -33,7 +33,7 @@ namespace py = pybind11;
namespace
paddle
{
namespace
pybind
{
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
void
BindHeterWrapper
(
py
::
module
*
m
)
{
py
::
class_
<
framework
::
HeterWrapper
,
std
::
shared_ptr
<
framework
::
HeterWrapper
>>
(
*
m
,
"Heter"
)
...
...
paddle/fluid/pybind/heter_wrapper_py.h
浏览文件 @
4748486e
...
...
@@ -22,7 +22,7 @@ namespace py = pybind11;
namespace
paddle
{
namespace
pybind
{
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
void
BindHeterWrapper
(
py
::
module
*
m
);
#endif
}
// namespace pybind
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
4748486e
...
...
@@ -3676,7 +3676,7 @@ All parameter, weight, gradient are variables in Paddle.
BindFleetWrapper
(
&
m
);
BindIO
(
&
m
);
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
BindHeterWrapper
(
&
m
);
#endif
#ifdef PADDLE_WITH_HETERPS
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录