Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
d051c2b1
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看板
提交
d051c2b1
编写于
6月 20, 2017
作者:
乔
乔龙飞
提交者:
GitHub
6月 20, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2530 from jacquesqiao/fix-go
Add WITH_GOLANG to control the link of go lib
上级
03d181cf
9e13b68f
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
43 addition
and
29 deletion
+43
-29
CMakeLists.txt
CMakeLists.txt
+7
-2
cmake/configure.cmake
cmake/configure.cmake
+4
-0
go/pserver/cclient/CMakeLists.txt
go/pserver/cclient/CMakeLists.txt
+0
-9
paddle/api/CMakeLists.txt
paddle/api/CMakeLists.txt
+1
-1
paddle/api/PaddleAPI.h
paddle/api/PaddleAPI.h
+2
-1
paddle/api/ParameterUpdater.cpp
paddle/api/ParameterUpdater.cpp
+8
-1
paddle/optimizer/CMakeLists.txt
paddle/optimizer/CMakeLists.txt
+4
-2
paddle/trainer/CMakeLists.txt
paddle/trainer/CMakeLists.txt
+13
-3
proto/CMakeLists.txt
proto/CMakeLists.txt
+2
-4
python/CMakeLists.txt
python/CMakeLists.txt
+1
-1
python/paddle/v2/__init__.py
python/paddle/v2/__init__.py
+0
-2
python/setup.py.in
python/setup.py.in
+1
-3
未找到文件。
CMakeLists.txt
浏览文件 @
d051c2b1
...
@@ -47,6 +47,7 @@ option(WITH_COVERAGE "Compile PaddlePaddle with code coverage" OFF)
...
@@ -47,6 +47,7 @@ option(WITH_COVERAGE "Compile PaddlePaddle with code coverage" OFF)
option
(
COVERALLS_UPLOAD
"Package code coverage data to coveralls"
OFF
)
option
(
COVERALLS_UPLOAD
"Package code coverage data to coveralls"
OFF
)
option
(
ON_TRAVIS
"Exclude special unit test on Travis CI"
OFF
)
option
(
ON_TRAVIS
"Exclude special unit test on Travis CI"
OFF
)
option
(
WITH_C_API
"Compile PaddlePaddle with C-API(Prediction)"
OFF
)
option
(
WITH_C_API
"Compile PaddlePaddle with C-API(Prediction)"
OFF
)
option
(
WITH_GOLANG
"Compile PaddlePaddle with GOLANG"
OFF
)
# CMAKE_BUILD_TYPE
# CMAKE_BUILD_TYPE
if
(
NOT CMAKE_BUILD_TYPE
)
if
(
NOT CMAKE_BUILD_TYPE
)
...
@@ -107,6 +108,7 @@ include(configure) # add paddle env configuration
...
@@ -107,6 +108,7 @@ include(configure) # add paddle env configuration
include_directories
(
"
${
PROJ_ROOT
}
"
)
include_directories
(
"
${
PROJ_ROOT
}
"
)
include_directories
(
"
${
PROJ_ROOT
}
/paddle/cuda/include"
)
include_directories
(
"
${
PROJ_ROOT
}
/paddle/cuda/include"
)
include_directories
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/proto"
)
include_directories
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/proto"
)
include_directories
(
"
${
CMAKE_CURRENT_BINARY_DIR
}
/go/pserver/cclient"
)
set
(
EXTERNAL_LIBS
set
(
EXTERNAL_LIBS
${
GFLAGS_LIBRARIES
}
${
GFLAGS_LIBRARIES
}
...
@@ -126,9 +128,12 @@ endif(WITH_GPU)
...
@@ -126,9 +128,12 @@ endif(WITH_GPU)
add_subdirectory
(
proto
)
add_subdirectory
(
proto
)
add_subdirectory
(
paddle
)
add_subdirectory
(
paddle
)
add_subdirectory
(
go/master/c
)
add_subdirectory
(
python
)
add_subdirectory
(
python
)
add_subdirectory
(
go/pserver/cclient
)
if
(
WITH_GOLANG
)
#TODO (add go/master/c back when fixed)
add_subdirectory
(
go/pserver/cclient
)
endif
(
WITH_GOLANG
)
if
(
WITH_DOC
)
if
(
WITH_DOC
)
add_subdirectory
(
doc
)
add_subdirectory
(
doc
)
...
...
cmake/configure.cmake
浏览文件 @
d051c2b1
...
@@ -40,6 +40,10 @@ if(NOT CMAKE_CROSSCOMPILING)
...
@@ -40,6 +40,10 @@ if(NOT CMAKE_CROSSCOMPILING)
endif
()
endif
()
endif
()
endif
()
if
(
NOT WITH_GOLANG
)
add_definitions
(
-DPADDLE_WITHOUT_GOLANG
)
endif
(
NOT WITH_GOLANG
)
if
(
NOT WITH_GPU
)
if
(
NOT WITH_GPU
)
add_definitions
(
-DPADDLE_ONLY_CPU
)
add_definitions
(
-DPADDLE_ONLY_CPU
)
add_definitions
(
-DHPPL_STUB_FUNC
)
add_definitions
(
-DHPPL_STUB_FUNC
)
...
...
go/pserver/cclient/CMakeLists.txt
浏览文件 @
d051c2b1
...
@@ -11,13 +11,4 @@ include(flags)
...
@@ -11,13 +11,4 @@ include(flags)
go_library
(
paddle_pserver_cclient STATIC
)
go_library
(
paddle_pserver_cclient STATIC
)
if
(
PROJ_ROOT
)
add_custom_command
(
OUTPUT
${
PROJ_ROOT
}
/paddle/trainer/libpaddle_pserver_cclient.a
COMMAND cp
${
CMAKE_CURRENT_BINARY_DIR
}
/libpaddle_pserver_cclient.h
${
PROJ_ROOT
}
/paddle/trainer/
COMMAND cp
${
CMAKE_CURRENT_BINARY_DIR
}
/libpaddle_pserver_cclient.a
${
PROJ_ROOT
}
/paddle/trainer/
WORKING_DIRECTORY
${
PROJ_ROOT
}
/paddle
DEPENDS paddle_pserver_cclient
)
add_custom_target
(
paddle_pserver_cclient_lib ALL DEPENDS
${
PROJ_ROOT
}
/paddle/trainer/libpaddle_pserver_cclient.a
)
endif
(
PROJ_ROOT
)
add_subdirectory
(
test
)
add_subdirectory
(
test
)
paddle/api/CMakeLists.txt
浏览文件 @
d051c2b1
...
@@ -16,7 +16,7 @@ set(API_HEADER
...
@@ -16,7 +16,7 @@ set(API_HEADER
Internal.h
)
Internal.h
)
add_library
(
paddle_api STATIC
${
API_SOURCES
}
)
add_library
(
paddle_api STATIC
${
API_SOURCES
}
)
add_dependencies
(
paddle_api gen_proto_cpp paddle_
pserver_cclient
_lib
)
add_dependencies
(
paddle_api gen_proto_cpp paddle_
trainer
_lib
)
INCLUDE
(
${
SWIG_USE_FILE
}
)
INCLUDE
(
${
SWIG_USE_FILE
}
)
INCLUDE_DIRECTORIES
(
${
PROJ_ROOT
}
/paddle
)
INCLUDE_DIRECTORIES
(
${
PROJ_ROOT
}
/paddle
)
...
...
paddle/api/PaddleAPI.h
浏览文件 @
d051c2b1
...
@@ -842,7 +842,8 @@ public:
...
@@ -842,7 +842,8 @@ public:
int
passCount
,
int
passCount
,
bool
useSparseUpdater
);
bool
useSparseUpdater
);
static
ParameterUpdater
*
createNewRemoteUpdater
(
static
ParameterUpdater
*
createNewRemoteUpdater
(
OptimizationConfig
*
config
,
const
std
::
string
pserverSpec
);
OptimizationConfig
*
config
,
const
std
::
string
pserverSpec
)
throw
(
UnsupportError
);
~
ParameterUpdater
();
~
ParameterUpdater
();
/**
/**
...
...
paddle/api/ParameterUpdater.cpp
浏览文件 @
d051c2b1
...
@@ -15,7 +15,9 @@ limitations under the License. */
...
@@ -15,7 +15,9 @@ limitations under the License. */
#include "PaddleAPI.h"
#include "PaddleAPI.h"
#include "PaddleAPIPrivate.h"
#include "PaddleAPIPrivate.h"
#ifndef PADDLE_WITHOUT_GOLANG
#include "paddle/trainer/NewRemoteParameterUpdater.h"
#include "paddle/trainer/NewRemoteParameterUpdater.h"
#endif
#include "paddle/trainer/RemoteParameterUpdater.h"
#include "paddle/trainer/RemoteParameterUpdater.h"
#include "paddle/trainer/ThreadParameterUpdater.h"
#include "paddle/trainer/ThreadParameterUpdater.h"
...
@@ -30,11 +32,16 @@ ParameterUpdater *ParameterUpdater::createLocalUpdater(
...
@@ -30,11 +32,16 @@ ParameterUpdater *ParameterUpdater::createLocalUpdater(
}
}
ParameterUpdater
*
ParameterUpdater
::
createNewRemoteUpdater
(
ParameterUpdater
*
ParameterUpdater
::
createNewRemoteUpdater
(
OptimizationConfig
*
config
,
const
std
::
string
pserverSpec
)
{
OptimizationConfig
*
config
,
const
std
::
string
pserverSpec
)
throw
(
UnsupportError
)
{
#ifndef PADDLE_WITHOUT_GOLANG
auto
updater
=
new
ParameterUpdater
();
auto
updater
=
new
ParameterUpdater
();
updater
->
m
->
updater
.
reset
(
new
paddle
::
NewRemoteParameterUpdater
(
updater
->
m
->
updater
.
reset
(
new
paddle
::
NewRemoteParameterUpdater
(
config
->
m
->
getConfig
(),
pserverSpec
));
config
->
m
->
getConfig
(),
pserverSpec
));
return
updater
;
return
updater
;
#else
throw
UnsupportError
();
#endif
}
}
ParameterUpdater
*
ParameterUpdater
::
createRemoteUpdater
(
ParameterUpdater
*
ParameterUpdater
::
createRemoteUpdater
(
...
...
paddle/optimizer/CMakeLists.txt
浏览文件 @
d051c2b1
...
@@ -12,5 +12,7 @@ set(OPITMIZER_SRCS
...
@@ -12,5 +12,7 @@ set(OPITMIZER_SRCS
add_library
(
paddle_optimizer STATIC
${
OPITMIZER_SRCS
}
)
add_library
(
paddle_optimizer STATIC
${
OPITMIZER_SRCS
}
)
add_dependencies
(
paddle_optimizer gen_proto_cpp
)
add_dependencies
(
paddle_optimizer gen_proto_cpp
)
add_simple_unittest
(
serialization_test
)
if
(
WITH_TESTING
)
add_simple_unittest
(
parameter_optimizer_test
)
add_simple_unittest
(
serialization_test
)
add_simple_unittest
(
parameter_optimizer_test
)
endif
()
paddle/trainer/CMakeLists.txt
浏览文件 @
d051c2b1
...
@@ -26,6 +26,13 @@ set(TRAINER_HEADERS
...
@@ -26,6 +26,13 @@ set(TRAINER_HEADERS
ThreadParameterUpdater.h
ThreadParameterUpdater.h
TrainerConfigHelper.h
)
TrainerConfigHelper.h
)
if
(
NOT WITH_GOLANG
)
list
(
REMOVE_ITEM TRAINER_SOURCES
NewRemoteParameterUpdater.cpp
)
list
(
REMOVE_ITEM TRAINER_HEADERS
NewRemoteParameterUpdater.h
)
endif
()
add_library
(
paddle_trainer_lib STATIC
add_library
(
paddle_trainer_lib STATIC
${
TRAINER_SOURCES
}
)
${
TRAINER_SOURCES
}
)
...
@@ -34,7 +41,7 @@ add_style_check_target(paddle_trainer_lib
...
@@ -34,7 +41,7 @@ add_style_check_target(paddle_trainer_lib
add_style_check_target
(
paddle_trainer_lib
add_style_check_target
(
paddle_trainer_lib
${
TRAINER_HEADERS
}
)
${
TRAINER_HEADERS
}
)
add_dependencies
(
paddle_trainer_lib
add_dependencies
(
paddle_trainer_lib
gen_proto_cpp
paddle_pserver_cclient_lib
)
gen_proto_cpp
)
macro
(
add_paddle_exe TARGET_NAME
)
macro
(
add_paddle_exe TARGET_NAME
)
add_executable
(
${
TARGET_NAME
}
${
ARGN
}
)
add_executable
(
${
TARGET_NAME
}
${
ARGN
}
)
...
@@ -63,5 +70,8 @@ if(APPLE)
...
@@ -63,5 +70,8 @@ if(APPLE)
set
(
CMAKE_EXE_LINKER_FLAGS
"-framework CoreFoundation -framework Security"
)
set
(
CMAKE_EXE_LINKER_FLAGS
"-framework CoreFoundation -framework Security"
)
endif
()
endif
()
target_link_libraries
(
paddle_trainer
${
CMAKE_CURRENT_SOURCE_DIR
}
/libpaddle_pserver_cclient.a
)
if
(
WITH_GOLANG
)
target_link_libraries
(
paddle_trainer_lib
${
CMAKE_CURRENT_SOURCE_DIR
}
/libpaddle_pserver_cclient.a
)
add_dependencies
(
paddle_trainer_lib paddle_pserver_cclient
)
target_link_libraries
(
paddle_trainer
${
CMAKE_BINARY_DIR
}
/go/pserver/cclient/libpaddle_pserver_cclient.a
)
target_link_libraries
(
paddle_trainer_lib
${
CMAKE_BINARY_DIR
}
/go/pserver/cclient/libpaddle_pserver_cclient.a
)
endif
(
WITH_GOLANG
)
proto/CMakeLists.txt
浏览文件 @
d051c2b1
...
@@ -36,10 +36,8 @@ foreach(filename ${proto_filenames})
...
@@ -36,10 +36,8 @@ foreach(filename ${proto_filenames})
DEPENDS
${
filename
}
${
external_project_dependencies
}
)
DEPENDS
${
filename
}
${
external_project_dependencies
}
)
endforeach
()
endforeach
()
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
/proto
)
add_custom_target
(
gen_proto_cpp ALL DEPENDS
${
PROTO_GEN
}
)
add_custom_target
(
gen_proto_cpp ALL DEPENDS
${
PROTO_GEN
}
)
add_custom_target
(
gen_proto_py ALL DEPENDS
${
PROTO_GEN_PY
}
)
add_custom_target
(
gen_proto_py ALL DEPENDS
${
PROTO_GEN_PY
}
)
add_library
(
paddle_proto STATIC
${
PROTO_GEN
}
)
add_library
(
paddle_proto STATIC
${
PROTO_GEN
}
)
target_include_directories
(
paddle_proto PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
)
target_include_directories
(
paddle_proto PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
)
python/CMakeLists.txt
浏览文件 @
d051c2b1
...
@@ -18,7 +18,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in
...
@@ -18,7 +18,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in
add_custom_command
(
OUTPUT
${
OUTPUT_DIR
}
/.timestamp
add_custom_command
(
OUTPUT
${
OUTPUT_DIR
}
/.timestamp
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
setup.py bdist_wheel
COMMAND env
${
py_env
}
${
PYTHON_EXECUTABLE
}
setup.py bdist_wheel
COMMAND
${
CMAKE_COMMAND
}
-E touch
${
OUTPUT_DIR
}
/.timestamp
COMMAND
${
CMAKE_COMMAND
}
-E touch
${
OUTPUT_DIR
}
/.timestamp
DEPENDS gen_proto_py
${
PY_FILES
}
${
external_project_dependencies
}
paddle_master_shared
)
DEPENDS gen_proto_py
${
PY_FILES
}
${
external_project_dependencies
}
)
add_custom_target
(
paddle_python ALL DEPENDS
add_custom_target
(
paddle_python ALL DEPENDS
${
OUTPUT_DIR
}
/.timestamp
)
${
OUTPUT_DIR
}
/.timestamp
)
...
...
python/paddle/v2/__init__.py
浏览文件 @
d051c2b1
...
@@ -26,7 +26,6 @@ import evaluator
...
@@ -26,7 +26,6 @@ import evaluator
from
.
import
dataset
from
.
import
dataset
from
.
import
reader
from
.
import
reader
from
.
import
plot
from
.
import
plot
from
.
import
master
import
attr
import
attr
import
op
import
op
import
pooling
import
pooling
...
@@ -57,7 +56,6 @@ __all__ = [
...
@@ -57,7 +56,6 @@ __all__ = [
'plot'
,
'plot'
,
'evaluator'
,
'evaluator'
,
'image'
,
'image'
,
'master'
,
]
]
...
...
python/setup.py.in
浏览文件 @
d051c2b1
...
@@ -8,8 +8,7 @@ packages=['paddle',
...
@@ -8,8 +8,7 @@ packages=['paddle',
'paddle.v2',
'paddle.v2',
'paddle.v2.dataset',
'paddle.v2.dataset',
'paddle.v2.reader',
'paddle.v2.reader',
'paddle.v2.plot',
'paddle.v2.plot']
'paddle.v2.master']
setup_requires=["requests",
setup_requires=["requests",
"numpy",
"numpy",
...
@@ -25,7 +24,6 @@ setup(name='paddle',
...
@@ -25,7 +24,6 @@ setup(name='paddle',
description='Parallel Distributed Deep Learning',
description='Parallel Distributed Deep Learning',
install_requires=setup_requires,
install_requires=setup_requires,
packages=packages,
packages=packages,
package_data={'paddle.v2.master': ['libpaddle_master.so'], },
package_dir={
package_dir={
'': '${CMAKE_CURRENT_SOURCE_DIR}'
'': '${CMAKE_CURRENT_SOURCE_DIR}'
},
},
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录