Skip to content

Commit

Permalink
Update v1.2 Doc (PaddlePaddle#448)
Browse files Browse the repository at this point in the history
* add_api_cn (PaddlePaddle#437)

* add gpu benchmark page (PaddlePaddle#436)

* add gpu benchmark

* fix comments

* add chinese link in gen_doc.py (PaddlePaddle#439)

* modified gen_doc.py

* Update gen_doc.py

* update gen_doc.py

* Update mobile doc (PaddlePaddle#440)

* update_en_structure

* update_Paddle_commitid

* delete_DS

* update_mobile_doc

* Update book commit (PaddlePaddle#438)

* update_en_structure

* update_Paddle_commitid

* delete_DS

* update_book_commit_id

* update_api_rst

* Adjust structure of advanced usage (PaddlePaddle#442)

* adjust_structure_of_advanced_usage

* Update paddle_gpu_benchmark.md

* adjust_toctree_hidden

* fix_api_guide

* Update index.rst

* fix deadlinkes (PaddlePaddle#443)

* add_toctree (PaddlePaddle#445)

* adjust_beginners_structure (PaddlePaddle#446)

* adjust_beginners_structure

* Update index.rst

* update install_doc for python3 (PaddlePaddle#418)

* update install_doc for python3

* update python3.5+ info,test=develop

* fix review, test=develop

* fix_pic (PaddlePaddle#447)
  • Loading branch information
shanyi15 committed Dec 7, 2018
1 parent 757b96f commit 8755edd
Show file tree
Hide file tree
Showing 132 changed files with 17,949 additions and 393 deletions.
13 changes: 13 additions & 0 deletions doc/fluid/advanced_usage/deploy/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
########
预测部署
########

- `原生预测引擎 <inference/index_cn.html>`_ :介绍了支持模型部署上线的Fluid C++ API

- `移动端部署 <mobile/index_cn.html>`_:介绍了 PaddlePaddle组织下的嵌入式平台深度学习框架Paddle-Mobile

.. toctree::
:hidden:

inference/index_cn.rst
mobile/index_cn.rst
8 changes: 0 additions & 8 deletions doc/fluid/advanced_usage/deploy/index_mobile.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
############
预测部署
原生预测引擎
############

PaddlePaddle Fluid 提供了 C++ API 来支持模型的部署上线

.. toctree::
:maxdepth: 2
:hidden:

build_and_install_lib_cn.rst
native_infer.md
paddle_tensorrt_infer.md
paddle_gpu_benchmark.md
windows_cpp_inference.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Paddle 预测 API
# C++ 预测 API介绍

为了更简单方便的预测部署,Fluid 提供了一套高层 API 用来隐藏底层不同的优化实现。

Expand Down
48 changes: 48 additions & 0 deletions doc/fluid/advanced_usage/deploy/inference/paddle_gpu_benchmark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# TensorRT库性能测试

## 测试环境
- CPU:Intel(R) Xeon(R) Gold 5117 CPU @ 2.00GHz GPU:Tesla P4
- TensorRT4.0, CUDA8.0, CUDNNV7
- 测试模型 ResNet50,MobileNet,ResNet101, Inception V3.

## 测试对象
**PaddlePaddle, Pytorch, Tensorflow**

- 在测试中,PaddlePaddle使用子图优化的方式集成了TensorRT, 模型[地址](https://github.com/PaddlePaddle/models/tree/develop/fluid/PaddleCV/image_classification/models)
- Pytorch使用了原生的实现, 模型[地址1](https://github.com/pytorch/vision/tree/master/torchvision/models)[地址2](https://github.com/marvis/pytorch-mobilenet)
- 对TensorFlow测试包括了对TF的原生的测试,和对TF—TRT的测试,**对TF—TRT的测试并没有达到预期的效果,后期会对其进行补充**, 模型[地址](https://github.com/tensorflow/models)


### ResNet50

|batch_size|PaddlePaddle(ms)|Pytorch(ms)|TensorFlow(ms)|
|---|---|---|---|
|1|4.64117 |16.3|10.878|
|5|6.90622| 22.9 |20.62|
|10|7.9758 |40.6|34.36|

### MobileNet
|batch_size|PaddlePaddle(ms)|Pytorch(ms)|TensorFlow(ms)|
|---|---|---|---|
|1| 1.7541 | 7.8 |2.72|
|5| 3.04666 | 7.8 |3.19|
|10|4.19478 | 14.47 |4.25|

### ResNet101
|batch_size|PaddlePaddle(ms)|Pytorch(ms)|TensorFlow(ms)|
|---|---|---|---|
|1|8.95767| 22.48 |18.78|
|5|12.9811 | 33.88 |34.84|
|10|14.1463| 61.97 |57.94|


### Inception v3
|batch_size|PaddlePaddle(ms)|Pytorch(ms)|TensorFlow(ms)|
|---|---|---|---|
|1|15.1613 | 24.2 |19.1|
|5|18.5373 | 34.8 |27.2|
|10|19.2781| 54.8 |36.7|




Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 使用Paddle TensorRT预测
# 使用TensorRT库预测

NVIDIA TensorRT 是一个高性能的深度学习预测库,可为深度学习推理应用程序提供低延迟和高吞吐量。Paddle 1.0 采用了子图的形式对TensorRT进行了初步集成,即我们可以使用该模块来提升Paddle模型的预测性能。该模块依旧在持续开发中,目前已支持的模型有:AlexNet, MobileNet, ResNet50, VGG19, ResNext, Se-ReNext, GoogleNet, DPN, ICNET, MobileNet-SSD等。在这篇文档中,我们将会对Paddle-TensorRT库的获取、使用和原理进行介绍。

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Windows环境模型预测使用说明
Windows环境模型预测
===========================

环境部署
Expand Down
15 changes: 15 additions & 0 deletions doc/fluid/advanced_usage/deploy/mobile/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
##########
移动端部署
##########

本模块介绍了 PaddlePaddle 组织下的嵌入式平台深度学习框架——Paddle-Mobile,包括:

* `项目简介 <mobile_readme.html>`_:简要介绍了 Paddle-Mobile 的应用效果,特点以及使用说明

* `环境搭建 <mobile_build.html>`_:分别介绍如何在Docker和非Docker下搭建环境

.. toctree::
:hidden:

mobile_readme.md
mobile_build.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 环境搭建
## 使用 docker
### 1. 安装 docker
安装 docker 的方式,参考官方文档 [https://docs.docker.com/install/](https://docs.docker.com/install/)
安装 docker 的方式,参考 [官方文档](https://docs.docker.com/install/)
### 2. 使用 docker 搭建构建环境
首先进入 paddle-mobile 的目录下,执行 `docker build`
以 Linux/Mac 为例 (windows 建议在 'Docker Quickstart Terminal' 中执行)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@

开发文档主要是关于编译、运行等问题。作为开发者,它可以和贡献文档共同结合使用

[iOS](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_ios.md)

[Android](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_android.md)

[FPGA](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_fpga.md)

[ARM_LINUX](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_arm_linux.md)
* [iOS](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_ios.md)
* [Android_CPU](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_android.md)
* [Android_GPU](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_android_GPU.md)
* [FPGA](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_fpga.md)
* [ARM_LINUX](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/doc/development_arm_linux.md)

### 贡献代码

Expand Down Expand Up @@ -71,10 +69,6 @@ ONNX全称为“Open Neural Network Exchange”,即“开放的神经网络切

[下载链接](http://mms-graph.bj.bcebos.com/paddle-mobile%2FmodelsAndImages.zip)

如下gif是简单搜索app的线上主体检测应用效果

![ezgif-1-050a733dfb](http://otkwwi4x8.bkt.clouddn.com/2018-07-05-ezgif-1-050a733dfb.gif)

## 问题解决

欢迎提出或解决我们的问题,有疑问可以发[Issue](https://github.com/PaddlePaddle/paddle-mobile/issues)
Expand All @@ -85,3 +79,4 @@ Paddle-Mobile 提供相对宽松的Apache-2.0开源协议 [Apache-2.0 license](L

## 旧版 Mobile-Deep-Learning
原MDL(Mobile-Deep-Learning)工程被迁移到了这里 [Mobile-Deep-Learning](https://github.com/allonli/mobile-deep-learning)

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fluid设计思想
# 设计思想

## 简介

Expand All @@ -17,7 +17,7 @@ Fluid使用一种编译器式的执行流程,分为编译时和运行时两个

本地训练任务执行流程图如下所示:
<p align="center">
<img src="https://raw.githubusercontent.com/PaddlePaddle/FluidDoc/develop/doc/fluid/user_guides/design_idea/image/fluid_process.png" width=800>
<img src="https://raw.githubusercontent.com/PaddlePaddle/FluidDoc/develop/doc/fluid/advanced_usage/design_idea/image/fluid_process.png" width=800>
</p>

1. 编译时,用户编写一段python程序,通过调用 Fluid 提供的算子,向一段 Program 中添加变量(Tensor)以及对变量的操作(Operators 或者 Layers)。用户只需要描述核心的前向计算,不需要关心反向计算、分布式下以及异构设备下如何计算。
Expand Down Expand Up @@ -153,7 +153,7 @@ Executor 在运行时将接受一个`ProgramDesc`、一个`block_id`和一个`Sc
完成的编译执行的具体过程如下图所示:

<p align="center">
<img src="https://raw.githubusercontent.com/PaddlePaddle/FluidDoc/develop/doc/fluid/user_guides/design_idea/image/executor_design.png" width=600>
<img src="https://raw.githubusercontent.com/PaddlePaddle/FluidDoc/develop/doc/fluid/advanced_usage/design_idea/image/executor_design.png" width=600>
</p>

1. Executor 为每一个block创建一个Scope,Block是可嵌套的,因此Scope也是可嵌套的
Expand Down Expand Up @@ -359,5 +359,5 @@ Fluid使用Executor.run来运行一段Program。
[6.099215 ]], dtype=float32), array([1.6935859], dtype=float32)]
```

至此您已经了解了Fluid 内部的执行流程的核心概念,更多框架使用细节请参考[使用指南](../../user_guides/index.html)相关内容,[模型库](../../user_guides/models/index.html
至此您已经了解了Fluid 内部的执行流程的核心概念,更多框架使用细节请参考[使用指南](../../user_guides/index.html)相关内容,[模型库](../../user_guides/models/index_cn.html
)中也为您提供了丰富的模型示例以供参考。
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
########
############
如何贡献代码
########
############

.. toctree::
:maxdepth: 2
:maxdepth: 1

local_dev_guide.md
submit_pr_guide.md
1 change: 0 additions & 1 deletion doc/fluid/advanced_usage/development/new_op.md

This file was deleted.

13 changes: 13 additions & 0 deletions doc/fluid/advanced_usage/development/new_op/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#############
新增operator
#############

- `如何写新的operator <../../../advanced_usage/development/new_op.html>`_ :介绍如何在 Fluid 中添加新的 Operator

- `op相关的一些注意事项 <../../../advanced_usage/development/op_notes.html>`_ :介绍op相关的一些注意事项

.. toctree::
:hidden:

new_op_cn.md
op_notes.md
1 change: 1 addition & 0 deletions doc/fluid/advanced_usage/development/new_op/new_op_cn.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Op相关的一些注意事项
# op相关的一些注意事项

## Fluid中Op的构建逻辑
### 1.Fluid中Op的构建逻辑
Expand All @@ -9,7 +9,7 @@ Op的核心方法是Run,Run方法需要两方面的资源:数据资源和计
Fluid框架的设计理念是可以在多种设备及第三方库上运行,有些Op的实现可能会因为设备或者第三方库的不同而不同。为此,Fluid引入了OpKernel的方式,即一个Op可以有多个OpKernel,这类Op继承自`OperatorWithKernel`,这类Op的代表是conv,conv_op的OpKerne有:`GemmConvKernel``CUDNNConvOpKernel``ConvMKLDNNOpKernel`,且每个OpKernel都有double和float两种数据类型。不需要OpKernel的代表有`WhileOp`等。

Operator继承关系图:
![op_inheritance_relation_diagram](../pics/op_inheritance_relation_diagram.png)
![op_inheritance_relation_diagram](../../pics/op_inheritance_relation_diagram.png)

进一步了解可参考:[multi_devices](https://github.com/PaddlePaddle/FluidDoc/tree/develop/doc/fluid/design/multi_devices)[scope](https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/design/concepts/scope.md)[Developer's_Guide_to_Paddle_Fluid](https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/getstarted/Developer's_Guide_to_Paddle_Fluid.md)

Expand Down Expand Up @@ -92,7 +92,7 @@ Operator继承关系图:
5. 框架没有提供默认的op_infer_var_type方法,用户需要根据实际情况添加op_infer_var_shape。严格来说每个Op都应该注册一个InferVarType,op_infer_var_type根据输入的Var的type和dtype推断输出Var的type和dtype。**注意:**在Python端的LayerHelper中create_variable_for_type_inference操作返回的Variable里面是LoDTensor,C++端的InferVarType可以修改`Variable`的type和dtype。


更多内容请参考: [如何写新的Op](./new_op.html)
更多内容请参考: [如何写新的Op](../new_op.html)

## 写Op注意事项
### 1.Op可以支持输入输出类型
Expand Down Expand Up @@ -183,4 +183,4 @@ def fc(input,
act=None,
is_test=False,
name=None)
```
```
10 changes: 0 additions & 10 deletions doc/fluid/advanced_usage/development/profiling/index.rst

This file was deleted.

21 changes: 21 additions & 0 deletions doc/fluid/advanced_usage/development/profiling/index_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
##########
性能调优
##########

本模块介绍 Fluid 使用过程中的调优方法,包括:

- `如何进行基准测试 <benchmark.html>`_:介绍如何选择基准模型,从而验证模型的精度和性能
- `CPU性能调优 <cpu_profiling_cn.html>`_:介绍如何使用 cProfile 包、yep库、Google perftools 进行性能分析与调优
- `GPU性能调优 <gpu_profiling_cn.html>`_:介绍如何使用 Fluid 内置的定时工具、nvprof 或 nvvp 进行性能分析和调优
- `堆内存分析和优化 <host_memory_profiling_cn.html>`_:介绍如何使用 gperftool 进行堆内存分析和优化,以解决内存泄漏的问题
- `Timeline工具简介 <timeline_cn.html>`_ :介绍如何使用 Timeline 工具进行性能分析和调优


.. toctree::
:hidden:

benchmark.rst
cpu_profiling_cn.md
gpu_profiling_cn.rst
host_memory_profiling_cn.md
timeline_cn.md
41 changes: 10 additions & 31 deletions doc/fluid/advanced_usage/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,30 @@
进阶使用
########

=====================
概览
=====================
.. todo::

如果您非常熟悉 Fluid,期望获得更高效的模型或者定义自己的Operator,请阅读:

- `移动端部署 <../advanced_usage/deploy/index_mobile.html>`_:介绍了 PaddlePaddle 组织下的嵌入式平台深度学习框架——Paddle-Mobile,包括:
- `Fluid 设计思想 <../advanced_usage/design_idea/fluid_design_idea.html>`_:介绍 Fluid 底层的设计思想,帮助您更好的理解框架运作过程

- `简介 <../advanced_usage/deploy/mobile_readme.html>`_:简要介绍了 Paddle-Mobile 的应用效果,特点以及使用说明
- `环境搭建 <../advanced_usage/deploy/mobile_build.html>`_:从使用 Docker 和不使用 Docker 两种方法下分别介绍如何搭建环境
- `ios开发文档 <../advanced_usage/deploy/mobile_dev.html>`_:介绍如何在 ios 系统下运用 Paddle-Mobile 进行开发
- `预测部署 <../advanced_usage/deploy/index_cn.html>`_ :介绍如何应用训练好的模型进行预测

- `Anakin预测引擎 <../advanced_usage/deploy/index_anakin.html>`_:介绍如何使用 Anakin 在不同硬件平台实现深度学习的高速预测

- `如何写新的Operator <../advanced_usage/development/new_op.html>`_ :介绍如何在 Fluid 中添加新的 Operator

- `Op相关的一些注意事项 <../advanced_usage/development/op_notes.html>`_ :介绍Op相关的一些注意事项

- `性能调优 <../advanced_usage/development/profiling/index.html>`_ :介绍 Fluid 使用过程中的调优方法,包括:

- `如何进行基准测试 <../advanced_usage/development/profiling/benchmark.html>`_:介绍如何选择基准模型,从而验证模型的精度和性能
- `CPU性能调优 <../advanced_usage/development/profiling/cpu_profiling_cn.html>`_:介绍如何使用 cProfile 包、yep库、Google perftools 进行性能分析与调优
- `GPU性能调优 <../advanced_usage/development/profiling/gpu_profiling_cn.html>`_:介绍如何使用 Fluid 内置的定时工具、nvprof 或 nvvp 进行性能分析和调优
- `堆内存分析和优化 <../advanced_usage/development/profiling/host_memory_profiling_cn.html>`_:介绍如何使用 gperftool 进行堆内存分析和优化,以解决内存泄漏的问题
- `Timeline工具简介 <../advanced_usage/development/profiling/timeline_cn.html>`_ :介绍如何使用 Timeline 工具进行性能分析和调优
- `新增operator <../advanced_usage/development/new_op/index_cn.html>`_ :介绍新增operator的方法及注意事项

- `性能调优 <../advanced_usage/development/profiling/index.html>`_ :介绍 Fluid 使用过程中的调优方法

非常欢迎您为我们的开源社区做出贡献,关于如何贡献您的代码或文档,请阅读:

- `如何贡献代码 <../advanced_usage/development/contribute_to_paddle.html>`_:介绍如何向 PaddlePaddle 开源社区贡献代码
- `如何贡献代码 <../advanced_usage/development/contribute_to_paddle/index_cn.html>`_:介绍如何向 PaddlePaddle 开源社区贡献代码

- `如何贡献文档 <../advanced_usage/development/write_docs_cn.html>`_:介绍如何向 PaddlePaddle 开源社区贡献文档

=====================
目录
=====================

.. toctree::
:maxdepth: 2
:hidden:

deploy/index_mobile.rst
deploy/index_anakin.rst
design_idea/fluid_design_idea.md
deploy/index_cn.rst
development/new_op/index_cn.rst
development/profiling/index_cn.rst
development/contribute_to_paddle/index_cn.rst
development/write_docs_cn.md
development/new_op.md
development/op_notes.md
development/profiling/index.rst
2 changes: 2 additions & 0 deletions doc/fluid/api/average.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ WeightedAverage
:members:
:noindex:

Read Chinese Version: :ref:`cn_api_fluid_average_WeightedAverage`

2 changes: 2 additions & 0 deletions doc/fluid/api/backward.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ append_backward
.. autofunction:: paddle.fluid.backward.append_backward
:noindex:

Read Chinese Version: :ref:`cn_api_fluid_backward_append_backward`

Loading

0 comments on commit 8755edd

Please sign in to comment.