Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
23bce472
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
23bce472
编写于
11月 15, 2016
作者:
L
liaogang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add gpu profiling docs
上级
e8c0fb9e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
85 addition
and
0 deletion
+85
-0
doc/index.md
doc/index.md
+1
-0
doc/optimization/gpu_profiling.rst
doc/optimization/gpu_profiling.rst
+77
-0
doc/optimization/index.rst
doc/optimization/index.rst
+7
-0
doc/optimization/nvprof.png
doc/optimization/nvprof.png
+0
-0
doc/optimization/nvvp1.png
doc/optimization/nvvp1.png
+0
-0
未找到文件。
doc/index.md
浏览文件 @
23bce472
...
...
@@ -17,6 +17,7 @@ Development Guide
*
[
Layer Documents
](
layer.md
)
*
[
Writing New Layers
](
dev/new_layer/index.rst
)
*
[
Source Code Documents
](
source/index.md
)
*
[
GPU Profiling Documents
](
optimization/index.rst
)
Algorithm Tutorial
------------------
...
...
doc/optimization/gpu_profiling.rst
0 → 100644
浏览文件 @
23bce472
GPU Profiling
=============
This tutorial will guide you step-by-step through how to conduct profiling and performance tuning using :code:`nvprof` and :code:`nvvp`.
- What is profiling?
- Why we need profiling?
- How to do profiling?
- Profile tools
- Hands-on Tutorial
What's profiling?
=================
In software engineering, profiling is a form of dynamic program analysis that measures the space (memory) or time
complexity of a program, the usage of particular instructions, or the frequency and duration of function calls.
Most commonly, profiling information serves to aid program optimization.
Briefly, profiler is used to measure application performance. Program analysis tools are extremely important for
understanding program behavior. Simple profiling can tell you that how long does an operation take? For advanced
profiling, it can interpret why does an operation take a long time?
Why we need profiling?
======================
Since training deep neural network typically take a very long time to get over, performance is gradually becoming
the most important thing in deep learning field. The first step to improve performance is to understand what parts
are slow. No point in improving performance of a region which doesn’t take much time!
How to do profiling?
====================
To achieve maximum performance, there are five steps you can take to reach your goals.
- Profile the code
- Find the slow parts
- Work out why they’re slow
- Make them fast
- Profile the code again
Usually, processor has two key performance limits include float point throughput and
memory throughput. For GPU, it also need more parallelism to fulfill its potential.
This is why they can be so fast.
Profiler Tools
==============
For general GPU profiling, a bunch of tools are provided from both NVIDIA and third party.
:code:`nvprof` is Nvidia profiler and :code:`nvvp` is (GUI based) Nvidia visual profiler.
In this tutorial, we will focus on nvprof and nvvp.
:code:`test_GpuProfiler` from :code:`paddle/math/tests` directory will be used to evaluate
above profilers.
.. code-block:: c++
TEST(Profiler, BilinearFwdBwd) {
hl_profiler_start();
auto numSamples = 10;
auto channels = 16;
auto imgSize = 64;
testBilinearFwdBwd(numSamples, imgSize, imgSize, channels);
hl_profiler_end();
}
:code:`hl_profiler_start` and :code:`hl_profiler_end` can be used to profile only regions of interest
in PaddlePaddle. They are wrapper functions of :code:`cudaProfilerStart` and :code:`cudaProfilerStop`
respectively to avoid program crashes when CPU version of PaddlePaddle invokes them.
Hands-on Approach
=================
.. image:: nvprof.png
:align: center
:scale: 30%
.. image:: nvvp1.png
:align: center
:scale: 30%
\ No newline at end of file
doc/optimization/index.rst
0 → 100644
浏览文件 @
23bce472
Performance Tuning
==================
.. toctree::
:maxdepth: 3
gpu_profiling.rst
doc/optimization/nvprof.png
0 → 100644
浏览文件 @
23bce472
476.3 KB
doc/optimization/nvvp1.png
0 → 100644
浏览文件 @
23bce472
416.1 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录