Skip to content

Commit ea2ed59

Browse files
tink2123shanyi15
authored andcommitted
modify yxt (PaddlePaddle#37)
* updata_yxt * update_yxt * add_yxt * update_yxt * update_yxt * update_yxt
1 parent c46c7ba commit ea2ed59

23 files changed

+2446
-73
lines changed

source/advanced_usage/deploy/anakin_arm_benchmark.md

-1
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,3 @@
5454
3. 接着在测试机含有Anakin model的目录中运行'./benchmark_arm ./ anakin_model.anakin.bin 1 10 10 1' 命令
5555
4. 最后,终端显示器上将会打印该模型的运行时间
5656
5. 其中运行命令的参数个数和含义可以通过运行'./benchmark_arm'看到
57-
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
../../../anakin/examples/example_introduction_cn.md
1+
# Example
2+
Anakin目前只支持NCHW的格式
3+
示例文件在test/framework/net下
4+
5+
## 在NV的GPU上运行CNN模型
6+
示例文件为打开example_nv_cnn_net.cpp,整体流程如下:
7+
- 将模型的的path设置为anakin模型的路径,初始化NV平台的图对象。 anakin模型可以通过转换器转化caffe或fluid的模型得到
8+
- 根据模型设置网络图的输入尺寸,进行图优化
9+
- 根据优化后的网络图初始化网络执行器
10+
- 取出网络的输入tensor,将数据拷贝到输入tensor
11+
- 运行推导
12+
- 取出网络的输出tensor
13+
14+
以NV平台为例演示Anakin框架的使用方法,注意编译时需要打开GPU编译开关
15+
16+
## 在X86上运行RNN模型
17+
示例文件为example_x86_rnn_net.cpp
18+
整体流程与在NV的GPU上运行CNN模型相似,不同之处如下:
19+
- 使用X86标识初始化图对象和网络执行器对象
20+
- rnn模型的输入尺寸是可变的,初始化图时的输入维度是维度的最大值,输入维度N代表总的词的个数。还需要设置输入tensor的seq_offset来标示这些词是如何划分为句子的,如{0,5,12}表示共有12个词,其中第0到第4个词是第一句话,第5到第11个词是第二句话
21+
22+
以X86平台为例演示Anakin框架的使用方法,注意编译时需要打开X86编译开关
23+
24+
## 在NV的GPU上使用Anakin的线程池运行CNN模型
25+
示例文件为example_nv_cnn_net_multi_thread.cpp ,示例使用worker的同步预测接口
26+
整体流程与在NV的GPU上运行CNN模型相似,不同之处如下:
27+
- 用模型地址和线程池大小初始化worker对象
28+
- 将输入tensor注入任务队列,获得输出tensor

source/advanced_usage/deploy/anakin_gpu_benchmark.md

-5
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,3 @@ We tested them on single-GPU with single-thread.
168168
> 2. Switch to *source_root/benchmark/CNN* directory. Use 'mkdir ./models' to create ./models and put anakin models into this file.
169169
> 3. Use command 'sh run.sh', we will create files in logs to save model log with different batch size. Finally, model latency summary will be displayed on the screen.
170170
> 4. If you want to get more detailed information with op time, you can modify CMakeLists.txt with setting `ENABLE_OP_TIMER` to `YES`, then recompile and run. You will find detailed information in model log file.
171-
172-
173-
174-
175-

0 commit comments

Comments
 (0)