Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
ce70229b
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看板
未验证
提交
ce70229b
编写于
12月 28, 2018
作者:
G
gongweibao
提交者:
GitHub
12月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add max_body_size flags to brpc (#15084)
上级
6f0a1d7b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
57 addition
and
15 deletion
+57
-15
paddle/fluid/operators/distributed/collective_server_test.cc
paddle/fluid/operators/distributed/collective_server_test.cc
+3
-2
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+7
-3
paddle/testing/paddle_gtest_main.cc
paddle/testing/paddle_gtest_main.cc
+43
-10
python/paddle/fluid/__init__.py
python/paddle/fluid/__init__.py
+4
-0
未找到文件。
paddle/fluid/operators/distributed/collective_server_test.cc
浏览文件 @
ce70229b
...
@@ -52,12 +52,12 @@ std::unique_ptr<framework::Scope> GenerateVars(platform::Place place) {
...
@@ -52,12 +52,12 @@ std::unique_ptr<framework::Scope> GenerateVars(platform::Place place) {
framework
::
Scope
*
scope
=
new
framework
::
Scope
();
framework
::
Scope
*
scope
=
new
framework
::
Scope
();
framework
::
Variable
*
var
=
scope
->
Var
(
"var1"
);
framework
::
Variable
*
var
=
scope
->
Var
(
"var1"
);
auto
*
slr
=
var
->
GetMutable
<
framework
::
SelectedRows
>
();
auto
*
slr
=
var
->
GetMutable
<
framework
::
SelectedRows
>
();
slr
->
set_height
(
1
000
);
slr
->
set_height
(
20
000
);
auto
*
tensor
=
slr
->
mutable_value
();
auto
*
tensor
=
slr
->
mutable_value
();
auto
*
rows
=
slr
->
mutable_rows
();
auto
*
rows
=
slr
->
mutable_rows
();
tensor
->
Resize
(
framework
::
make_ddim
({
3
,
5
}));
tensor
->
Resize
(
framework
::
make_ddim
({
20000
,
1024
}));
tensor
->
mutable_data
<
float
>
(
place
);
tensor
->
mutable_data
<
float
>
(
place
);
paddle
::
operators
::
math
::
set_constant
(
ctx
,
tensor
,
32.7
);
paddle
::
operators
::
math
::
set_constant
(
ctx
,
tensor
,
32.7
);
...
@@ -83,6 +83,7 @@ void Gather(const std::vector<distributed::RemoteVar>& vars,
...
@@ -83,6 +83,7 @@ void Gather(const std::vector<distributed::RemoteVar>& vars,
}
}
TEST
(
PREFETCH
,
GPU
)
{
TEST
(
PREFETCH
,
GPU
)
{
setenv
(
"FLAGS_max_body_size"
,
"2147483647"
,
1
);
platform
::
CUDAPlace
place
;
platform
::
CUDAPlace
place
;
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
&
ctx
=
*
pool
.
Get
(
place
);
auto
&
ctx
=
*
pool
.
Get
(
place
);
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
ce70229b
...
@@ -84,11 +84,15 @@ bool IsCompiledWithCUDA() {
...
@@ -84,11 +84,15 @@ bool IsCompiledWithCUDA() {
}
}
bool
IsCompiledWithBrpc
()
{
bool
IsCompiledWithBrpc
()
{
#if defined(PADDLE_WITH_BRPC) || defined(PADDLE_WITH_BRPC_RDMA)
#ifndef PADDLE_WITH_DISTRIBUTE
return
true
;
#else
return
false
;
return
false
;
#endif
#endif
#ifdef PADDLE_WITH_GRPC
return
false
;
#endif
return
true
;
}
}
bool
IsCompiledWithDIST
()
{
bool
IsCompiledWithDIST
()
{
...
...
paddle/testing/paddle_gtest_main.cc
浏览文件 @
ce70229b
...
@@ -28,20 +28,53 @@ int main(int argc, char** argv) {
...
@@ -28,20 +28,53 @@ int main(int argc, char** argv) {
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
new_argv
.
push_back
(
argv
[
i
]);
new_argv
.
push_back
(
argv
[
i
]);
}
}
std
::
vector
<
std
::
string
>
envs
;
std
::
vector
<
std
::
string
>
undefok
;
#if defined(PADDLE_WITH_DISTRIBUTE) && !defined(PADDLE_WITH_GRPC)
envs
.
push_back
(
"max_body_size"
);
#endif
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
new_argv
.
push_back
(
envs
.
push_back
(
"fraction_of_gpu_memory_to_use"
);
strdup
(
"--tryfromenv=fraction_of_gpu_memory_to_use,allocator_strategy"
)
);
envs
.
push_back
(
"allocator_strategy"
);
#elif __clang__
#elif __clang__
new_argv
.
push_back
(
envs
.
push_back
(
"use_mkldnn"
);
strdup
(
"--tryfromenv=use_mkldnn,initial_cpu_memory_in_"
envs
.
push_back
(
"initial_cpu_memory_in_mb"
);
"mb,allocator_strategy"
));
envs
.
push_back
(
"allocator_strategy"
);
new_argv
.
push_back
(
strdup
(
"--undefok=use_mkldnn,initial_cpu_memory_in_mb"
));
undefok
.
push_back
(
"use_mkldnn"
);
undefok
.
push_back
(
"initial_cpu_memory_in_mb"
);
#else
#else
new_argv
.
push_back
(
envs
.
push_back
(
"use_pinned_memory"
);
strdup
(
"--tryfromenv=use_pinned_memory,use_mkldnn,initial_cpu_memory_in_"
envs
.
push_back
(
"use_mkldnn"
);
"mb,allocator_strategy"
));
envs
.
push_back
(
"initial_cpu_memory_in_mb"
);
new_argv
.
push_back
(
strdup
(
"--undefok=use_mkldnn,initial_cpu_memory_in_mb"
));
envs
.
push_back
(
"allocator_strategy"
);
undefok
.
push_back
(
"use_mkldnn"
);
undefok
.
push_back
(
"initial_cpu_memory_in_mb"
);
#endif
#endif
if
(
envs
.
size
()
>
0
)
{
std
::
string
env_string
=
"--tryfromenv="
;
for
(
auto
t
:
envs
)
{
env_string
+=
t
+
","
;
}
env_string
=
env_string
.
substr
(
0
,
env_string
.
length
()
-
1
);
new_argv
.
push_back
(
strdup
(
env_string
.
c_str
()));
VLOG
(
1
)
<<
"gtest env_string:"
<<
env_string
;
}
if
(
undefok
.
size
()
>
0
)
{
std
::
string
undefok_string
=
"--undefok="
;
for
(
auto
t
:
undefok
)
{
undefok_string
+=
t
+
","
;
}
undefok_string
=
undefok_string
.
substr
(
0
,
undefok_string
.
length
()
-
1
);
new_argv
.
push_back
(
strdup
(
undefok_string
.
c_str
()));
VLOG
(
1
)
<<
"gtest undefok_string:"
<<
undefok_string
;
}
int
new_argc
=
static_cast
<
int
>
(
new_argv
.
size
());
int
new_argc
=
static_cast
<
int
>
(
new_argv
.
size
());
char
**
new_argv_address
=
new_argv
.
data
();
char
**
new_argv_address
=
new_argv
.
data
();
google
::
ParseCommandLineFlags
(
&
new_argc
,
&
new_argv_address
,
false
);
google
::
ParseCommandLineFlags
(
&
new_argc
,
&
new_argv_address
,
false
);
...
...
python/paddle/fluid/__init__.py
浏览文件 @
ce70229b
...
@@ -151,6 +151,10 @@ def __bootstrap__():
...
@@ -151,6 +151,10 @@ def __bootstrap__():
read_env_flags
.
append
(
'rpc_get_thread_num'
)
read_env_flags
.
append
(
'rpc_get_thread_num'
)
read_env_flags
.
append
(
'rpc_prefetch_thread_num'
)
read_env_flags
.
append
(
'rpc_prefetch_thread_num'
)
read_env_flags
.
append
(
'rpc_disable_reuse_port'
)
read_env_flags
.
append
(
'rpc_disable_reuse_port'
)
if
core
.
is_compiled_with_brpc
():
read_env_flags
.
append
(
'max_body_size'
)
#set brpc max body size
os
.
environ
[
'FLAGS_max_body_size'
]
=
"2147483647"
if
core
.
is_compiled_with_cuda
():
if
core
.
is_compiled_with_cuda
():
read_env_flags
+=
[
read_env_flags
+=
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录