index.html 14.8 KB
Newer Older
1
<!DOCTYPE html>
2 3 4 5 6 7 8 9
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  
10 11
  <link rel="shortcut icon" href="../img/favicon.ico">
  <title>硬件延时评估表 - PaddleSlim Docs</title>
12
  <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
13

14 15
  <link rel="stylesheet" href="../css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
16
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
17
  <link href="../extra.css" rel="stylesheet">
18 19 20 21
  
  <script>
    // Current page data
    var mkdocs_page_name = "\u786c\u4ef6\u5ef6\u65f6\u8bc4\u4f30\u8868";
22
    var mkdocs_page_input_path = "table_latency.md";
23 24 25
    var mkdocs_page_url = null;
  </script>
  
26 27
  <script src="../js/jquery-2.1.1.min.js" defer></script>
  <script src="../js/modernizr-2.8.3.min.js" defer></script>
28 29 30 31
  <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script> 
  
</head>
32

33
<body class="wy-body-for-nav" role="document">
34

35
  <div class="wy-grid-for-nav">
36

37 38 39
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
      <div class="wy-side-nav-search">
40
        <a href=".." class="icon icon-home"> PaddleSlim Docs</a>
41
        <div role="search">
42
  <form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
43 44 45 46
    <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
  </form>
</div>
      </div>
47

48 49 50 51 52 53
      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
	<ul class="current">
	  
          
            <li class="toctree-l1">
		
54
    <a class="" href="..">Home</a>
55 56 57 58
	    </li>
          
            <li class="toctree-l1">
		
59 60 61 62 63
    <a class="" href="../model_zoo/">模型库</a>
	    </li>
          
            <li class="toctree-l1">
		
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
    <span class="caption-text">教程</span>
    <ul class="subnav">
                <li class="">
                    
    <a class="" href="../tutorials/quant_post_demo/">离线量化</a>
                </li>
                <li class="">
                    
    <a class="" href="../tutorials/quant_aware_demo/">量化训练</a>
                </li>
                <li class="">
                    
    <a class="" href="../tutorials/quant_embedding_demo/">Embedding量化</a>
                </li>
                <li class="">
                    
    <a class="" href="../tutorials/nas_demo/">SA搜索</a>
                </li>
                <li class="">
                    
84 85 86 87
    <a class="" href="../tutorials/search_space.md">搜索空间</a>
                </li>
                <li class="">
                    
88 89 90 91 92 93 94
    <a class="" href="../tutorials/distillation_demo/">知识蒸馏</a>
                </li>
    </ul>
	    </li>
          
            <li class="toctree-l1">
		
95
    <span class="caption-text">API</span>
96
    <ul class="subnav">
97
                <li class="">
98
                    
99
    <a class="" href="../api/quantization_api/">量化</a>
100
                </li>
101
                <li class="">
102
                    
103
    <a class="" href="../api/prune_api/">剪枝与敏感度</a>
104
                </li>
105
                <li class="">
106
                    
107
    <a class="" href="../api/analysis_api/">模型分析</a>
108
                </li>
109
                <li class="">
110
                    
111
    <a class="" href="../api/single_distiller_api/">知识蒸馏</a>
112
                </li>
113
                <li class="">
114
                    
115
    <a class="" href="../api/nas_api/">SA搜索</a>
116
                </li>
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
                <li class=" current">
                    
    <a class="current" href="./">硬件延时评估表</a>
    <ul class="subnav">
            
    <li class="toctree-l3"><a href="#_1">硬件延时评估表</a></li>
    
        <ul>
        
            <li><a class="toctree-l4" href="#_2">概述</a></li>
        
            <li><a class="toctree-l4" href="#_3">整体格式</a></li>
        
            <li><a class="toctree-l4" href="#_4">版本信息</a></li>
        
            <li><a class="toctree-l4" href="#_5">操作信息</a></li>
        
        </ul>
    

    </ul>
                </li>
139 140 141
    </ul>
	    </li>
          
142 143 144 145 146
            <li class="toctree-l1">
		
    <a class="" href="../algo/algo/">算法原理</a>
	    </li>
          
147 148 149 150
        </ul>
      </div>
      &nbsp;
    </nav>
151

152
    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
153

154 155 156
      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
157
        <a href="..">PaddleSlim Docs</a>
158
      </nav>
159

160 161 162 163 164
      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
165
    <li><a href="..">Docs</a> &raquo;</li>
166 167
    
      
168 169 170 171
        
          <li>API &raquo;</li>
        
      
172 173 174 175
    
    <li>硬件延时评估表</li>
    <li class="wy-breadcrumbs-aside">
      
176
        <a href="https://github.com/PaddlePaddle/PaddleSlim/edit/master/docs/table_latency.md"
177 178
          class="icon icon-github"> Edit on GitHub</a>
      
179 180 181 182 183 184 185
    </li>
  </ul>
  <hr/>
</div>
          <div role="main">
            <div class="section">
              
186
                <h1 id="_1">硬件延时评估表<a class="headerlink" href="#_1" title="Permanent link">#</a></h1>
187 188
<p>硬件延时评估表用于快速评估一个模型在特定硬件环境和推理引擎上的推理速度。
该文档主要用于定义PaddleSlim支持的硬件延时评估表的格式。</p>
189
<h2 id="_2">概述<a class="headerlink" href="#_2" title="Permanent link">#</a></h2>
190 191
<p>硬件延时评估表中存放着所有可能的操作对应的延时信息,该表中的一个操作包括操作类型和操作参数,比如:操作类型可以是<code>conv2d</code>,对应的操作参数有输入特征图的大小、卷积核个数、卷积核大小等。
给定操作的延时依赖于硬件环境和推理引擎。</p>
192
<h2 id="_3">整体格式<a class="headerlink" href="#_3" title="Permanent link">#</a></h2>
193 194
<p>硬件延时评估表以文件或多行字符串的形式保存。</p>
<p>硬件延时评估表第一行保存版本信息,后续每行为一个操作和对应的延时信息。</p>
195
<h2 id="_4">版本信息<a class="headerlink" href="#_4" title="Permanent link">#</a></h2>
196 197 198 199 200 201 202 203 204 205 206 207
<p>版本信息以英文字符逗号分割,内容依次为硬件环境名称、推理引擎名称和时间戳。</p>
<ul>
<li>
<p><strong>硬件环境名称:</strong> 用于标识硬件环境,可以包含计算架构类型、版本号等信息。</p>
</li>
<li>
<p><strong>推理引擎名称:</strong> 用于标识推理引擎,可以包含推理引擎名称、版本号、优化选项等信息。</p>
</li>
<li>
<p><strong>时间戳:</strong> 该评估表的创建时间。</p>
</li>
</ul>
208
<h2 id="_5">操作信息<a class="headerlink" href="#_5" title="Permanent link">#</a></h2>
209
<p>操作信息字段之间以逗号分割。操作信息与延迟信息之间以制表符分割。</p>
210
<h3 id="conv2d">conv2d<a class="headerlink" href="#conv2d" title="Permanent link">#</a></h3>
211
<p><strong>格式</strong></p>
212
<div class="codehilite"><pre><span></span>op_type,flag_bias,flag_relu,n_in,c_in,h_in,w_in,c_out,groups,kernel,padding,stride,dilation\tlatency
213
</pre></div>
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231

<p><strong>字段解释</strong></p>
<ul>
<li><strong>op_type(str)</strong> - 当前op类型。</li>
<li><strong>flag_bias (int)</strong> - 是否有 bias(0:无,1:有)。</li>
<li><strong>flag_relu (int)</strong> - 是否有 relu(0:无,1:有)。</li>
<li><strong>n_in (int)</strong> - 输入 Tensor 的批尺寸 (batch size)。</li>
<li><strong>c_in (int)</strong> - 输入 Tensor 的通道 (channel) 数。</li>
<li><strong>h_in (int)</strong> - 输入 Tensor 的特征高度。</li>
<li><strong>w_in (int)</strong> - 输入 Tensor 的特征宽度。</li>
<li><strong>c_out (int)</strong> - 输出 Tensor 的通道 (channel) 数。</li>
<li><strong>groups (int)</strong> - 卷积二维层(Conv2D Layer)的组数。</li>
<li><strong>kernel (int)</strong> - 卷积核大小。</li>
<li><strong>padding (int)</strong> - 填充 (padding) 大小。</li>
<li><strong>stride (int)</strong> - 步长 (stride) 大小。</li>
<li><strong>dilation (int)</strong> - 膨胀 (dilation) 大小。</li>
<li><strong>latency (float)</strong> - 当前op的延时时间</li>
</ul>
232
<h3 id="activation">activation<a class="headerlink" href="#activation" title="Permanent link">#</a></h3>
233
<p><strong>格式</strong></p>
234
<div class="codehilite"><pre><span></span>op_type,n_in,c_in,h_in,w_in\tlatency
235
</pre></div>
236 237 238 239 240 241 242 243 244 245

<p><strong>字段解释</strong></p>
<ul>
<li><strong>op_type(str)</strong> - 当前op类型。</li>
<li><strong>n_in (int)</strong> - 输入 Tensor 的批尺寸 (batch size)。</li>
<li><strong>c_in (int)</strong> - 输入 Tensor 的通道 (channel) 数。</li>
<li><strong>h_in (int)</strong> - 输入 Tensor 的特征高度。</li>
<li><strong>w_in (int)</strong> - 输入 Tensor 的特征宽度。</li>
<li><strong>latency (float)</strong> - 当前op的延时时间</li>
</ul>
246
<h3 id="batch_norm">batch_norm<a class="headerlink" href="#batch_norm" title="Permanent link">#</a></h3>
247
<p><strong>格式</strong></p>
248
<div class="codehilite"><pre><span></span>op_type,active_type,n_in,c_in,h_in,w_in\tlatency
249
</pre></div>
250 251 252 253

<p><strong>字段解释</strong></p>
<ul>
<li><strong>op_type(str)</strong> - 当前op类型。</li>
254
<li><strong>active_type (string|None)</strong> - 激活函数类型,包含:relu, prelu, sigmoid, relu6, tanh。</li>
255 256 257 258 259 260
<li><strong>n_in (int)</strong> - 输入 Tensor 的批尺寸 (batch size)。</li>
<li><strong>c_in (int)</strong> - 输入 Tensor 的通道 (channel) 数。</li>
<li><strong>h_in (int)</strong> - 输入 Tensor 的特征高度。</li>
<li><strong>w_in (int)</strong> - 输入 Tensor 的特征宽度。</li>
<li><strong>latency (float)</strong> - 当前op的延时时间</li>
</ul>
261
<h3 id="eltwise">eltwise<a class="headerlink" href="#eltwise" title="Permanent link">#</a></h3>
262
<p><strong>格式</strong></p>
263
<div class="codehilite"><pre><span></span>op_type,n_in,c_in,h_in,w_in\tlatency
264
</pre></div>
265 266 267 268 269 270 271 272 273 274

<p><strong>字段解释</strong></p>
<ul>
<li><strong>op_type(str)</strong> - 当前op类型。</li>
<li><strong>n_in (int)</strong> - 输入 Tensor 的批尺寸 (batch size)。</li>
<li><strong>c_in (int)</strong> - 输入 Tensor 的通道 (channel) 数。</li>
<li><strong>h_in (int)</strong> - 输入 Tensor 的特征高度。</li>
<li><strong>w_in (int)</strong> - 输入 Tensor 的特征宽度。</li>
<li><strong>latency (float)</strong> - 当前op的延时时间</li>
</ul>
275
<h3 id="pooling">pooling<a class="headerlink" href="#pooling" title="Permanent link">#</a></h3>
276
<p><strong>格式</strong></p>
277
<div class="codehilite"><pre><span></span>op_type,flag_global_pooling,n_in,c_in,h_in,w_in,kernel,padding,stride,ceil_mode,pool_type\tlatency
278
</pre></div>
279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294

<p><strong>字段解释</strong></p>
<ul>
<li><strong>op_type(str)</strong> - 当前op类型。</li>
<li><strong>flag_global_pooling (int)</strong> - 是否为全局池化(0:不是,1:是)。</li>
<li><strong>n_in (int)</strong> - 输入 Tensor 的批尺寸 (batch size)。</li>
<li><strong>c_in (int)</strong> - 输入 Tensor 的通道 (channel) 数。</li>
<li><strong>h_in (int)</strong> - 输入 Tensor 的特征高度。</li>
<li><strong>w_in (int)</strong> - 输入 Tensor 的特征宽度。</li>
<li><strong>kernel (int)</strong> - 卷积核大小。</li>
<li><strong>padding (int)</strong> - 填充 (padding) 大小。</li>
<li><strong>stride (int)</strong> - 步长 (stride) 大小。</li>
<li><strong>ceil_mode (int)</strong> - 是否用 ceil 函数计算输出高度和宽度。0 表示使用 floor 函数,1 表示使用 ceil 函数。</li>
<li><strong>pool_type (int)</strong> - 池化类型,其中 1 表示 pooling_max,2 表示 pooling_average_include_padding,3 表示 pooling_average_exclude_padding。</li>
<li><strong>latency (float)</strong> - 当前op的延时时间</li>
</ul>
295
<h3 id="softmax">softmax<a class="headerlink" href="#softmax" title="Permanent link">#</a></h3>
296
<p><strong>格式</strong></p>
297
<div class="codehilite"><pre><span></span>op_type,axis,n_in,c_in,h_in,w_in\tlatency
298
</pre></div>
299 300 301 302 303 304 305 306 307 308

<p><strong>字段解释</strong></p>
<ul>
<li><strong>op_type(str)</strong> - 当前op类型。</li>
<li><strong>axis (int)</strong> - 执行 softmax 计算的维度索引,应该在 [−1,rank − 1] 范围内,其中 rank 是输入变量的秩。</li>
<li><strong>n_in (int)</strong> - 输入 Tensor 的批尺寸 (batch size)。</li>
<li><strong>c_in (int)</strong> - 输入 Tensor 的通道 (channel) 数。</li>
<li><strong>h_in (int)</strong> - 输入 Tensor 的特征高度。</li>
<li><strong>w_in (int)</strong> - 输入 Tensor 的特征宽度。</li>
<li><strong>latency (float)</strong> - 当前op的延时时间</li>
309 310
</ul>
              
311
            </div>
312 313 314
          </div>
          <footer>
  
315 316
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
317
        <a href="../algo/algo/" class="btn btn-neutral float-right" title="算法原理">Next <span class="icon icon-circle-arrow-right"></span></a>
318 319
      
      
320
        <a href="../api/nas_api/" class="btn btn-neutral" title="SA搜索"><span class="icon icon-circle-arrow-left"></span> Previous</a>
321 322 323
      
    </div>
  
324 325 326 327 328 329 330 331 332 333 334

  <hr/>

  <div role="contentinfo">
    <!-- Copyright etc -->
    
  </div>

  Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
      
335
        </div>
336 337 338 339 340 341 342 343 344
      </div>

    </section>

  </div>

  <div class="rst-versions" role="note" style="cursor: pointer">
    <span class="rst-current-version" data-toggle="rst-current-version">
      
345
          <a href="https://github.com/PaddlePaddle/PaddleSlim/" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
346 347
      
      
348
        <span><a href="../api/nas_api/" style="color: #fcfcfc;">&laquo; Previous</a></span>
349 350
      
      
351
        <span style="margin-left: 15px"><a href="../algo/algo/" style="color: #fcfcfc">Next &raquo;</a></span>
352 353
      
    </span>
354
</div>
355 356 357
    <script>var base_url = '..';</script>
    <script src="../js/theme.js" defer></script>
      <script src="../mathjax-config.js" defer></script>
358
      <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" defer></script>
359
      <script src="../search/main.js" defer></script>
360

361
</body>
362
</html>