Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
72ad280b
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看板
未验证
提交
72ad280b
编写于
2月 11, 2022
作者:
Z
zhangchunle
提交者:
GitHub
2月 11, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
get build time (#39368)
上级
be8ab0ea
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
110 addition
and
3 deletion
+110
-3
CMakeLists.txt
CMakeLists.txt
+9
-1
cmake/cuda.cmake
cmake/cuda.cmake
+0
-1
paddle/scripts/paddle_build.sh
paddle/scripts/paddle_build.sh
+20
-1
tools/analysis_build_time.py
tools/analysis_build_time.py
+63
-0
tools/get_build_time.sh
tools/get_build_time.sh
+18
-0
未找到文件。
CMakeLists.txt
浏览文件 @
72ad280b
...
...
@@ -242,6 +242,15 @@ option(NEW_RELEASE_CUBIN "PaddlePaddle next-level release strategy for pypi cu
option
(
NEW_RELEASE_JIT
"PaddlePaddle next-level release strategy for backup jit package"
OFF
)
option
(
WITH_ASCEND_INT64
"Compile with int64 kernel for ascend NPU"
OFF
)
option
(
WITH_POCKETFFT
"Compile with pocketfft support"
ON
)
option
(
WITH_RECORD_BUILDTIME
"Compile PaddlePaddle with record all targets build time"
OFF
)
if
(
WITH_RECORD_BUILDTIME
)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_COMPILE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/tools/get_build_time.sh"
)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_LINK
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/tools/get_build_time.sh"
)
else
()
include
(
ccache
)
# set ccache for compilation ; if WITH_RECORD_BUILDTIME=ON can't use ccache
endif
()
unset
(
WITH_RECORD_BUILDTIME CACHE
)
# PY_VERSION
if
(
NOT PY_VERSION
)
...
...
@@ -382,7 +391,6 @@ if(WITH_PROFILER)
add_definitions
(
-DWITH_GPERFTOOLS
)
endif
()
include
(
ccache
)
# set ccache for compilation
include
(
util
)
# set unittest and link libs
include
(
version
)
# set PADDLE_VERSION
include
(
coveralls
)
# set code coverage
...
...
cmake/cuda.cmake
浏览文件 @
72ad280b
...
...
@@ -2,7 +2,6 @@ if(NOT WITH_GPU)
return
()
endif
()
if
(
WITH_NV_JETSON
)
add_definitions
(
-DWITH_NV_JETSON
)
set
(
paddle_known_gpu_archs
"53 62 72"
)
...
...
paddle/scripts/paddle_build.sh
浏览文件 @
72ad280b
...
...
@@ -240,6 +240,7 @@ function cmake_base() {
-DON_INFER=
${
ON_INFER
:-
OFF
}
-DWITH_HETERPS=
${
WITH_HETERPS
:-
OFF
}
-DWITH_FLUID_ONLY=
${
WITH_FLUID_ONLY
:-
OFF
}
-DWITH_RECORD_BUILDTIME=
${
WITH_RECORD_BUILDTIME
:-
OFF
}
-DCUDA_ARCH_BIN="
${
CUDA_ARCH_BIN
}
"
========================================
EOF
...
...
@@ -291,6 +292,7 @@ EOF
-DWITH_HETERPS
=
${
WITH_HETERPS
:-
OFF
}
\
-DWITH_FLUID_ONLY
=
${
WITH_FLUID_ONLY
:-
OFF
}
\
-DCUDA_ARCH_BIN
=
"
${
CUDA_ARCH_BIN
}
"
\
-DWITH_RECORD_BUILDTIME
=
${
WITH_RECORD_BUILDTIME
:-
OFF
}
\
-DWITH_UNITY_BUILD
=
${
WITH_UNITY_BUILD
:-
OFF
}
;
build_error
=
$?
if
[
"
$build_error
"
!=
0
]
;
then
exit
7
;
...
...
@@ -454,6 +456,14 @@ function cmake_gen_and_build() {
echo
"ipipe_log_param_Build_Time:
$[
$endTime_s
-
$startTime_s
]s"
>>
${
PADDLE_ROOT
}
/build/build_summary.txt
}
function
get_build_time_file
()
{
python
${
PADDLE_ROOT
}
/tools/analysis_build_time.py
cat
${
PADDLE_ROOT
}
/tools/buildTime.txt
today
=
$(
date
"+%Y-%m-%d"
)
mkdir
-p
/paddle_targets_buildtime_record
cp
${
PADDLE_ROOT
}
/tools/buildTime.txt /paddle_targets_buildtime_record/
${
today
}
-buildTime
.txt
}
function
build_mac
()
{
set
+e
mkdir
-p
${
PADDLE_ROOT
}
/build
...
...
@@ -2485,6 +2495,10 @@ function build_pr_and_develop() {
mkdir
${
PADDLE_ROOT
}
/build/dev_whl
&&
cp
${
PADDLE_ROOT
}
/build/python/dist/
*
.whl
${
PADDLE_ROOT
}
/build/dev_whl
}
function
build_develop
()
{
#git checkout -b develop_base_pr upstream/$BRANCH
cmake_gen_and_build
${
PYTHON_ABI
:-
""
}
${
parallel_number
}
}
function
main
()
{
local
CMD
=
$1
...
...
@@ -2497,6 +2511,11 @@ function main() {
build_pr_dev
)
build_pr_and_develop
;;
build_dev_test
)
#build_develop
cmake_gen_and_build
${
PYTHON_ABI
:-
""
}
${
parallel_number
}
get_build_time_file
;;
build_and_check
)
set
+e
check_style_info
=
$(
check_style
)
...
...
tools/analysis_build_time.py
0 → 100644
浏览文件 @
72ad280b
# Copyright (c) 2022 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
os
root_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
getcwd
(),
".."
))
def
strToSecond
(
strTime
):
minute
=
int
(
strTime
.
split
(
':'
)[
0
])
second
=
int
(
strTime
.
split
(
':'
)[
1
].
split
(
'.'
)[
0
])
+
1
return
minute
*
60
+
second
def
getUsefulBuildTimeFile
(
filename
):
os
.
system
(
"grep -Po -- '-o .*' %s | grep ' elapsed' | grep -P -v '0:00.* elapse' > %s/tools/analysis_build_time"
%
(
filename
,
root_path
))
os
.
system
(
"grep -v -- '-o .*' %s |grep ' elapse' | grep -P -v '0:00.* elapse' >> %s/tools/analysis_build_time"
%
(
filename
,
root_path
))
def
analysisBuildTime
():
filename
=
'%s/build/build-time'
%
root_path
getUsefulBuildTimeFile
(
filename
)
os
.
system
(
'rm -rf %s/tools/tempbuildTime.txt'
%
root_path
)
with
open
(
'%s/tools/analysis_build_time'
%
root_path
,
'r'
)
as
f
:
lines
=
f
.
readlines
()
for
line
in
lines
:
try
:
line
=
line
.
strip
()
if
'-o '
in
line
:
buildFile
=
line
.
split
(
', '
)[
0
].
split
(
' '
)[
1
]
buildTime
=
line
.
split
(
', '
)[
1
].
split
(
'elapsed'
)[
0
].
strip
()
secondTime
=
strToSecond
(
buildTime
)
os
.
system
(
"echo %s, %s >> %s/tools/tempbuildTime.txt"
%
(
buildFile
,
secondTime
,
root_path
))
else
:
buildTime
=
line
.
split
(
', '
)[
1
].
split
(
'elapsed'
)[
0
].
strip
()
secondTime
=
strToSecond
(
buildTime
)
if
secondTime
>
30
:
os
.
system
(
"echo %s, %s >> %s/tools/tempbuildTime.txt"
%
(
line
,
secondTime
,
root_path
))
except
ValueError
:
print
(
line
)
os
.
system
(
'sort -n -k 2 -r %s/tools/tempbuildTime.txt > %s/tools/buildTime.txt'
%
(
root_path
,
root_path
))
analysisBuildTime
()
tools/get_build_time.sh
0 → 100755
浏览文件 @
72ad280b
#!/bin/bash
# Copyright (c) 2022 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.
CUR_ROOT
=
$(
dirname
"
$0
"
)
/..
/usr/bin/time
-f
'%C, %E elapsed, %U user, %S sys'
"
$@
"
>>
$CUR_ROOT
/build/build-time 2>&1
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录