Skip to content

Commit 29b6a75

Browse files
authored
Merge pull request #482 from gangliao/profiler
Add GPU Profiler in PaddlePaddle
2 parents c46261b + e488001 commit 29b6a75

File tree

17 files changed

+465
-20
lines changed

17 files changed

+465
-20
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ addons:
4242
before_install:
4343
- |
4444
if [ ${JOB} == "BUILD_AND_TEST" ]; then
45-
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)'
45+
if ! git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.md$)|(\.rst$)|(\.jpg$)|(\.png$)'
4646
then
4747
echo "Only markdown docs were updated, stopping build process."
4848
exit

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ option(WITH_RDMA "Compile PaddlePaddle with rdma support" OFF)
3636
option(WITH_GLOG "Compile PaddlePaddle use glog, otherwise use a log implement internally" ${LIBGLOG_FOUND})
3737
option(WITH_GFLAGS "Compile PaddlePaddle use gflags, otherwise use a flag implement internally" ${GFLAGS_FOUND})
3838
option(WITH_TIMER "Compile PaddlePaddle use timer" OFF)
39+
option(WITH_PROFILER "Compile PaddlePaddle use gpu profiler" OFF)
3940
option(WITH_TESTING "Compile and run unittest for PaddlePaddle" ${GTEST_FOUND})
4041
option(WITH_DOC "Compile PaddlePaddle with documentation" OFF)
4142
option(WITH_SWIG_PY "Compile PaddlePaddle with py PaddlePaddle prediction api" ${SWIG_FOUND})
@@ -115,7 +116,6 @@ else()
115116
endif(WITH_AVX)
116117

117118
if(WITH_DSO)
118-
set(CUDA_LIBRARIES "")
119119
add_definitions(-DPADDLE_USE_DSO)
120120
endif(WITH_DSO)
121121

@@ -135,6 +135,10 @@ if(NOT WITH_TIMER)
135135
add_definitions(-DPADDLE_DISABLE_TIMER)
136136
endif(NOT WITH_TIMER)
137137

138+
if(NOT WITH_PROFILER)
139+
add_definitions(-DPADDLE_DISABLE_PROFILER)
140+
endif(NOT WITH_PROFILER)
141+
138142
if(WITH_AVX)
139143
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AVX_FLAG}")
140144
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${AVX_FLAG}")

doc/build/build_from_source.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ As a simple example, consider the following:
9595
```bash
9696
# necessary
9797
sudo apt-get update
98-
sudo apt-get install -y g++ make cmake build-essential libatlas-base-dev python python-pip libpython-dev m4 libprotobuf-dev protobuf-compiler python-protobuf python-numpy git
98+
sudo apt-get install -y g++ make cmake swig build-essential libatlas-base-dev python python-pip libpython-dev m4 libprotobuf-dev protobuf-compiler python-protobuf python-numpy git
9999
# optional
100100
sudo apt-get install libgoogle-glog-dev
101101
sudo apt-get install libgflags-dev
@@ -149,15 +149,15 @@ If still not found, you can manually set it based on CMake error information fro
149149

150150
As a simple example, consider the following:
151151

152-
- **Only CPU**
152+
- **Only CPU with swig**
153153

154154
```bash
155-
cmake .. -DWITH_GPU=OFF
155+
cmake .. -DWITH_GPU=OFF -DWITH_SWIG_PY=ON
156156
```
157-
- **GPU**
157+
- **GPU with swig**
158158

159159
```bash
160-
cmake .. -DWITH_GPU=ON
160+
cmake .. -DWITH_GPU=ON -DWITH_SWIG_PY=ON
161161
```
162162

163163
- **GPU with doc and swig**
@@ -170,15 +170,13 @@ Finally, you can build PaddlePaddle:
170170

171171
```bash
172172
# you can add build option here, such as:
173-
cmake .. -DWITH_GPU=ON -DCMAKE_INSTALL_PREFIX=<path to install>
173+
cmake .. -DWITH_GPU=ON -DCMAKE_INSTALL_PREFIX=<path to install> -DWITH_SWIG_PY=ON
174174
# please use sudo make install, if you want to install PaddlePaddle into the system
175175
make -j `nproc` && make install
176176
# set PaddlePaddle installation path in ~/.bashrc
177177
export PATH=<path to install>/bin:$PATH
178178
```
179179

180-
**Note:**
181-
182180
If you set `WITH_SWIG_PY=ON`, related python dependencies also need to be installed.
183181
Otherwise, PaddlePaddle will automatically install python dependencies
184182
at first time when user run paddle commands, such as `paddle version`, `paddle train`.

doc/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ PaddlePaddle Documentation
88
user_guide.rst
99
dev/index.rst
1010
algorithm/index.rst
11+
optimization/index.rst

doc/optimization/gpu_profiling.rst

Lines changed: 237 additions & 0 deletions
Large diffs are not rendered by default.

doc/optimization/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Performance Tuning
2+
==================
3+
4+
.. toctree::
5+
:maxdepth: 3
6+
7+
gpu_profiling.rst

doc/optimization/nvvp1.png

416 KB
Loading

doc/optimization/nvvp2.png

484 KB
Loading

doc/optimization/nvvp3.png

248 KB
Loading

doc/optimization/nvvp4.png

277 KB
Loading

0 commit comments

Comments
 (0)