Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
4748486e
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
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()
...
@@ -333,6 +333,10 @@ else()
endif
()
endif
()
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
(
WITH_DISTRIBUTE
)
if
(
LINUX
)
if
(
LINUX
)
set
(
WITH_GLOO ON CACHE STRING
"Enable GLOO when compiling WITH_DISTRIBUTE=ON."
FORCE
)
set
(
WITH_GLOO ON CACHE STRING
"Enable GLOO when compiling WITH_DISTRIBUTE=ON."
FORCE
)
...
...
cmake/external/gloo.cmake
浏览文件 @
4748486e
...
@@ -55,7 +55,7 @@ else()
...
@@ -55,7 +55,7 @@ else()
UPDATE_COMMAND
""
UPDATE_COMMAND
""
CONFIGURE_COMMAND
""
CONFIGURE_COMMAND
""
BUILD_COMMAND mkdir -p
${
GLOO_SOURCE_DIR
}
/build
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
&& 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
}
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"
COMMAND
${
CMAKE_COMMAND
}
-E copy_directory
"
${
GLOO_SOURCE_DIR
}
/gloo/"
"
${
GLOO_INCLUDE_DIR
}
/gloo"
...
...
cmake/flags.cmake
浏览文件 @
4748486e
...
@@ -202,6 +202,16 @@ if (APPLE)
...
@@ -202,6 +202,16 @@ if (APPLE)
set
(
COMMON_FLAGS -Wno-deprecated-register
)
set
(
COMMON_FLAGS -Wno-deprecated-register
)
endif
(
APPLE
)
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
)
if
(
LINUX
)
set
(
GPU_COMMON_FLAGS
set
(
GPU_COMMON_FLAGS
-Wall
-Wall
...
...
cmake/third_party.cmake
浏览文件 @
4748486e
...
@@ -299,8 +299,10 @@ if(WITH_PSLIB)
...
@@ -299,8 +299,10 @@ if(WITH_PSLIB)
include
(
external/leveldb
)
include
(
external/leveldb
)
list
(
APPEND third_party_deps extern_leveldb
)
list
(
APPEND third_party_deps extern_leveldb
)
include
(
external/brpc
)
if
(
NOT WITH_HETERPS
)
list
(
APPEND third_party_deps extern_brpc
)
include
(
external/brpc
)
list
(
APPEND third_party_deps extern_brpc
)
endif
()
endif
()
endif
()
endif
(
WITH_PSLIB
)
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)
...
@@ -118,7 +118,9 @@ cc_test(var_type_traits_test SRCS var_type_traits_test.cc DEPS var_type_traits)
set
(
BRPC_DEPS
""
)
set
(
BRPC_DEPS
""
)
if
(
WITH_PSLIB OR WITH_PSCORE
)
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
)
if
(
WITH_PSLIB_BRPC
)
set
(
BRPC_DEPS pslib_brpc
)
set
(
BRPC_DEPS pslib_brpc
)
endif
()
endif
()
...
...
paddle/fluid/framework/device_worker.h
浏览文件 @
4748486e
...
@@ -61,7 +61,7 @@ bool CheckValidOutput(LoDTensor* tensor, size_t batch_size);
...
@@ -61,7 +61,7 @@ bool CheckValidOutput(LoDTensor* tensor, size_t batch_size);
class
FleetWrapper
;
class
FleetWrapper
;
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
class
HeterWrapper
;
class
HeterWrapper
;
#endif
#endif
...
@@ -359,7 +359,7 @@ class DownpourWorkerOpt : public DownpourWorker {
...
@@ -359,7 +359,7 @@ class DownpourWorkerOpt : public DownpourWorker {
uint64_t
async_tid_
=
0
;
uint64_t
async_tid_
=
0
;
};
};
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
class
HeterCpuWorker
:
public
HogwildWorker
{
class
HeterCpuWorker
:
public
HogwildWorker
{
public:
public:
HeterCpuWorker
()
{}
HeterCpuWorker
()
{}
...
...
paddle/fluid/framework/device_worker_factory.cc
浏览文件 @
4748486e
...
@@ -70,7 +70,7 @@ REGISTER_DEVICE_WORKER_CLASS(DownpourWorkerOpt);
...
@@ -70,7 +70,7 @@ REGISTER_DEVICE_WORKER_CLASS(DownpourWorkerOpt);
REGISTER_DEVICE_WORKER_CLASS
(
HeterSectionWorker
);
REGISTER_DEVICE_WORKER_CLASS
(
HeterSectionWorker
);
#endif
#endif
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
REGISTER_DEVICE_WORKER_CLASS
(
HeterCpuWorker
);
REGISTER_DEVICE_WORKER_CLASS
(
HeterCpuWorker
);
#endif
#endif
...
...
paddle/fluid/framework/fleet/CMakeLists.txt
浏览文件 @
4748486e
...
@@ -2,7 +2,9 @@ if(WITH_PSLIB)
...
@@ -2,7 +2,9 @@ if(WITH_PSLIB)
if
(
WITH_PSLIB_BRPC
)
if
(
WITH_PSLIB_BRPC
)
set
(
BRPC_DEPS pslib_brpc
)
set
(
BRPC_DEPS pslib_brpc
)
else
()
else
()
set
(
BRPC_DEPS brpc
)
if
(
NOT WITH_HETERPS
)
set
(
BRPC_DEPS brpc
)
endif
()
endif
(
WITH_PSLIB_BRPC
)
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
)
cc_library
(
fleet_wrapper SRCS fleet_wrapper.cc DEPS framework_proto proto_desc op_registry variable_helper scope
${
BRPC_DEPS
}
pslib
)
else
()
else
()
...
...
paddle/fluid/framework/fleet/heter_wrapper.cc
浏览文件 @
4748486e
...
@@ -27,7 +27,7 @@ See the License for the specific language governing permissions and
...
@@ -27,7 +27,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#include "paddle/fluid/framework/fleet/heter_wrapper.h"
#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"
#include "paddle/fluid/framework/device_worker.h"
namespace
paddle
{
namespace
paddle
{
...
...
paddle/fluid/framework/fleet/heter_wrapper.h
浏览文件 @
4748486e
...
@@ -23,7 +23,7 @@ limitations under the License. */
...
@@ -23,7 +23,7 @@ limitations under the License. */
#include <unordered_map>
#include <unordered_map>
#include <vector>
#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_service.h"
#include "paddle/fluid/framework/heter_util.h"
#include "paddle/fluid/framework/heter_util.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/framework/scope.h"
...
...
paddle/fluid/framework/heter_service.h
浏览文件 @
4748486e
...
@@ -25,7 +25,7 @@ limitations under the License. */
...
@@ -25,7 +25,7 @@ limitations under the License. */
#include "paddle/fluid/framework/heter_service.pb.h"
#include "paddle/fluid/framework/heter_service.pb.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/scope.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/channel.h"
#include "brpc/controller.h"
#include "brpc/controller.h"
#include "brpc/server.h"
#include "brpc/server.h"
...
@@ -35,7 +35,7 @@ limitations under the License. */
...
@@ -35,7 +35,7 @@ limitations under the License. */
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
typedef
std
::
function
<
int
(
const
HeterRequest
*
,
HeterResponse
*
)
>
typedef
std
::
function
<
int
(
const
HeterRequest
*
,
HeterResponse
*
)
>
HeterServiceHandler
;
HeterServiceHandler
;
class
DataFeed
;
class
DataFeed
;
...
...
paddle/fluid/framework/heter_util.h
浏览文件 @
4748486e
...
@@ -14,7 +14,6 @@ limitations under the License. */
...
@@ -14,7 +14,6 @@ limitations under the License. */
#pragma once
#pragma once
#ifdef PADDLE_WITH_PSLIB
#include <fstream>
#include <fstream>
#include <memory>
#include <memory>
#include <mutex> // NOLINT
#include <mutex> // NOLINT
...
@@ -23,11 +22,12 @@ limitations under the License. */
...
@@ -23,11 +22,12 @@ limitations under the License. */
#include <unordered_map> // NOLINT
#include <unordered_map> // NOLINT
#include <unordered_set> // NOLINT
#include <unordered_set> // NOLINT
#include <vector>
#include <vector>
#if defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
#include "bthread/bthread.h"
#include "bthread/bthread.h"
#endif
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/program_desc.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/framework/scope.h"
#include "paddle/fluid/platform/timer.h"
#include "paddle/fluid/platform/timer.h"
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
class
DataFeed
;
class
DataFeed
;
...
@@ -106,7 +106,7 @@ class HeterTask {
...
@@ -106,7 +106,7 @@ class HeterTask {
double
cpu_2_gpu_time
{
0
};
double
cpu_2_gpu_time
{
0
};
platform
::
Timer
timeline
;
platform
::
Timer
timeline
;
};
};
#endif
template
<
class
T
>
template
<
class
T
>
class
HeterObjectPool
{
class
HeterObjectPool
{
public:
public:
...
@@ -143,7 +143,7 @@ class HeterObjectPool {
...
@@ -143,7 +143,7 @@ class HeterObjectPool {
int
num_
{
0
};
int
num_
{
0
};
};
};
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
struct
BthreadMutextGuard
{
struct
BthreadMutextGuard
{
BthreadMutextGuard
(
bthread_mutex_t
*
rho
)
{
BthreadMutextGuard
(
bthread_mutex_t
*
rho
)
{
mutex_
=
rho
;
mutex_
=
rho
;
...
@@ -328,6 +328,6 @@ class HeterList {
...
@@ -328,6 +328,6 @@ class HeterList {
int
cap_
;
int
cap_
;
int
size
;
int
size
;
};
};
#endif
}
// namespace framework
}
// namespace framework
}
// namespace paddle
}
// namespace paddle
#endif
paddle/fluid/framework/hetercpu_worker.cc
浏览文件 @
4748486e
...
@@ -19,7 +19,7 @@ limitations under the License. */
...
@@ -19,7 +19,7 @@ limitations under the License. */
#include "paddle/fluid/platform/cpu_helper.h"
#include "paddle/fluid/platform/cpu_helper.h"
#include "paddle/fluid/string/string_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__
#if defined _WIN32 || defined __APPLE__
#else
#else
...
...
paddle/fluid/framework/heterxpu_trainer.cc
浏览文件 @
4748486e
...
@@ -24,7 +24,7 @@ limitations under the License. */
...
@@ -24,7 +24,7 @@ limitations under the License. */
#include "paddle/fluid/framework/fleet/heter_wrapper.h"
#include "paddle/fluid/framework/fleet/heter_wrapper.h"
#include "paddle/fluid/framework/trainer.h"
#include "paddle/fluid/framework/trainer.h"
#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_XPU) && \
#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
#ifdef PADDLE_WITH_CUDA
#include "paddle/fluid/platform/cuda_device_guard.h"
#include "paddle/fluid/platform/cuda_device_guard.h"
#endif
#endif
...
...
paddle/fluid/framework/trainer.h
浏览文件 @
4748486e
...
@@ -155,7 +155,7 @@ class DistMultiTrainer : public MultiTrainer {
...
@@ -155,7 +155,7 @@ class DistMultiTrainer : public MultiTrainer {
#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_HIP || \
#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_HIP || \
defined PADDLE_WITH_XPU) && \
defined PADDLE_WITH_XPU) && \
(defined PADDLE_WITH_PSLIB)
(defined PADDLE_WITH_PSLIB)
&& (!defined(PADDLE_WITH_HETERPS))
class
HeterServiceContext
{
class
HeterServiceContext
{
public:
public:
HeterServiceContext
()
{}
HeterServiceContext
()
{}
...
...
paddle/fluid/framework/trainer_factory.cc
浏览文件 @
4748486e
...
@@ -73,7 +73,7 @@ REGISTER_TRAINER_CLASS(HeterPipelineTrainer);
...
@@ -73,7 +73,7 @@ REGISTER_TRAINER_CLASS(HeterPipelineTrainer);
#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_HIP || \
#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_HIP || \
defined PADDLE_WITH_XPU) && \
defined PADDLE_WITH_XPU) && \
(defined PADDLE_WITH_PSLIB)
(defined PADDLE_WITH_PSLIB)
&& (!defined(PADDLE_WITH_HETERPS))
REGISTER_TRAINER_CLASS
(
HeterXpuTrainer
);
REGISTER_TRAINER_CLASS
(
HeterXpuTrainer
);
#endif
#endif
#if (defined PADDLE_WITH_NCCL || defined PADDLE_WITH_RCCL) && \
#if (defined PADDLE_WITH_NCCL || defined PADDLE_WITH_RCCL) && \
...
...
paddle/fluid/pybind/heter_wrapper_py.cc
浏览文件 @
4748486e
...
@@ -33,7 +33,7 @@ namespace py = pybind11;
...
@@ -33,7 +33,7 @@ namespace py = pybind11;
namespace
paddle
{
namespace
paddle
{
namespace
pybind
{
namespace
pybind
{
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
void
BindHeterWrapper
(
py
::
module
*
m
)
{
void
BindHeterWrapper
(
py
::
module
*
m
)
{
py
::
class_
<
framework
::
HeterWrapper
,
std
::
shared_ptr
<
framework
::
HeterWrapper
>>
(
py
::
class_
<
framework
::
HeterWrapper
,
std
::
shared_ptr
<
framework
::
HeterWrapper
>>
(
*
m
,
"Heter"
)
*
m
,
"Heter"
)
...
...
paddle/fluid/pybind/heter_wrapper_py.h
浏览文件 @
4748486e
...
@@ -22,7 +22,7 @@ namespace py = pybind11;
...
@@ -22,7 +22,7 @@ namespace py = pybind11;
namespace
paddle
{
namespace
paddle
{
namespace
pybind
{
namespace
pybind
{
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
void
BindHeterWrapper
(
py
::
module
*
m
);
void
BindHeterWrapper
(
py
::
module
*
m
);
#endif
#endif
}
// namespace pybind
}
// namespace pybind
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
4748486e
...
@@ -3676,7 +3676,7 @@ All parameter, weight, gradient are variables in Paddle.
...
@@ -3676,7 +3676,7 @@ All parameter, weight, gradient are variables in Paddle.
BindFleetWrapper
(
&
m
);
BindFleetWrapper
(
&
m
);
BindIO
(
&
m
);
BindIO
(
&
m
);
#if
def PADDLE_WITH_PSLIB
#if
defined(PADDLE_WITH_PSLIB) && !defined(PADDLE_WITH_HETERPS)
BindHeterWrapper
(
&
m
);
BindHeterWrapper
(
&
m
);
#endif
#endif
#ifdef PADDLE_WITH_HETERPS
#ifdef PADDLE_WITH_HETERPS
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录