Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Serving
提交
c32b92cd
S
Serving
项目概览
PaddlePaddle
/
Serving
1 年多 前同步成功
通知
186
Star
833
Fork
253
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
105
列表
看板
标记
里程碑
合并请求
10
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Serving
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
105
Issue
105
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c32b92cd
编写于
7月 07, 2020
作者:
M
MRXLT
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add cube benchmark script
上级
01f5cd22
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
2 deletion
+57
-2
core/cube/cube-api/src/cube_cli.cpp
core/cube/cube-api/src/cube_cli.cpp
+6
-2
python/examples/criteo_ctr_with_cube/benchmark_cube.sh
python/examples/criteo_ctr_with_cube/benchmark_cube.sh
+31
-0
python/examples/criteo_ctr_with_cube/gen_key.py
python/examples/criteo_ctr_with_cube/gen_key.py
+20
-0
未找到文件。
core/cube/cube-api/src/cube_cli.cpp
浏览文件 @
c32b92cd
...
...
@@ -188,6 +188,7 @@ int run_m(int argc, char** argv) {
request_list
.
resize
(
thread_num
);
time_list
.
resize
(
thread_num
);
std
::
vector
<
std
::
thread
*>
thread_pool
;
TIME_FLAG
(
main_start
);
for
(
int
i
=
0
;
i
<
thread_num
;
i
++
)
{
thread_pool
.
push_back
(
new
std
::
thread
(
run
,
argc
,
argv
,
i
));
}
...
...
@@ -195,6 +196,7 @@ int run_m(int argc, char** argv) {
thread_pool
[
i
]
->
join
();
delete
thread_pool
[
i
];
}
TIME_FLAG
(
main_end
);
uint64_t
sum_time
=
0
;
uint64_t
max_time
=
0
;
uint64_t
min_time
=
1000000
;
...
...
@@ -210,12 +212,14 @@ int run_m(int argc, char** argv) {
request_num
+=
request_list
[
i
];
}
uint64_t
mean_time
=
sum_time
/
thread_num
;
uint64_t
main_time
=
time_diff
(
main_start
,
main_end
);
LOG
(
INFO
)
<<
thread_num
<<
" thread seek cost"
<<
" avg = "
<<
std
::
to_string
(
mean_time
)
<<
" max = "
<<
std
::
to_string
(
max_time
)
<<
" min = "
<<
std
::
to_string
(
min_time
);
LOG
(
INFO
)
<<
" total_request = "
<<
std
::
to_string
(
request_num
)
<<
" speed = "
<<
std
::
to_string
(
1000000
*
thread_num
/
mean_time
)
// mean_time us
LOG
(
INFO
)
<<
" total_request = "
<<
std
::
to_string
(
request_num
)
<<
" speed = "
<<
std
::
to_string
(
request_num
*
1000000
/
main_time
)
// mean_time us
<<
" query per second"
;
return
0
;
}
...
...
python/examples/criteo_ctr_with_cube/benchmark_cube.sh
0 → 100755
浏览文件 @
c32b92cd
rm
profile_log
#wget https://paddle-serving.bj.bcebos.com/unittest/ctr_cube_unittest.tar.gz --no-check-certificate
tar
xf ctr_cube_unittest.tar.gz
mv
models/ctr_client_conf ./
mv
models/ctr_serving_model_kv ./
mv
models/data ./cube/
#wget https://paddle-serving.bj.bcebos.com/others/cube_app.tar.gz --no-check-certificate
tar
xf cube_app.tar.gz
mv
cube_app/cube
*
./cube/
sh cube_prepare.sh &
cp
../../../build_server/core/cube/cube-api/cube-cli
.
python gen_key.py
for
thread_num
in
1
do
for
batch_size
in
1
do
./cube-cli
-config_file
./cube/conf/cube.conf
-keys
key
-dict
test_dict
-thread_num
$thread_num
--batch
$batch_size
>
profile 2>&1
echo
"batch size :
$batch_size
"
echo
"thread num :
$thread_num
"
echo
"========================================"
echo
"batch size :
$batch_size
"
>>
profile_log
echo
"thread num :
$thread_num
"
>>
profile_log
tail
-n
2 profile
>>
profile_log
done
done
ps
-ef
|grep
'cube'
|grep
-v
grep
|cut
-c
9-15 | xargs
kill
-9
python/examples/criteo_ctr_with_cube/gen_key.py
0 → 100644
浏览文件 @
c32b92cd
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import
sys
import
random
with
open
(
"key"
,
"w"
)
as
f
:
for
i
in
range
(
1000000
):
f
.
write
(
"{}
\n
"
.
format
(
random
.
randint
(
0
,
999999
)))
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录