import{s as en,o as ln,n as N}from"../chunks/scheduler.25b97de1.js";import{S as tn,i as rn,g as j,s as m,r as g,A as pn,h as i,f as t,c as u,j as sn,u as f,x as _,k as nn,y as cn,a as r,v as $,d as y,t as d,w as M}from"../chunks/index.d9030fc9.js";import{T as an}from"../chunks/Tip.baa67368.js";import{C as O}from"../chunks/CodeBlock.e6cd0d95.js";import{D as mn}from"../chunks/DocNotebookDropdown.5ea6cb78.js";import{F as Bs,M as K}from"../chunks/Markdown.d8c1b6cc.js";import{H as Ns,E as un}from"../chunks/EditOnGithub.91d95064.js";function hn(h){let a,l=`小提示：Hugging Face的基准测试工具已经不再更新，建议使用外部基准测试库来衡量Transformer模
型的速度和内存复杂度。`;return{c(){a=j("p"),a.textContent=l},l(n){a=i(n,"P",{"data-svelte-h":!0}),_(a)!=="svelte-1noh5hz"&&(a.textContent=l)},m(n,p){r(n,a,p)},p:N,d(n){n&&t(a)}}}function bn(h){let a,l="这里的<strong>推理</strong>指的是一次前向传播(forward pass)，而训练则指一次前向传播和反向传播(backward pass)。";return{c(){a=j("p"),a.innerHTML=l},l(n){a=i(n,"P",{"data-svelte-h":!0}),_(a)!=="svelte-nmhj"&&(a.innerHTML=l)},m(n,p){r(n,a,p)},p:N,d(n){n&&t(a)}}}function on(h){let a,l;return a=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFB5VG9yY2hCZW5jaG1hcmslMkMlMjBQeVRvcmNoQmVuY2htYXJrQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFB5VG9yY2hCZW5jaG1hcmtBcmd1bWVudHMobW9kZWxzJTNEJTVCJTIyZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtdW5jYXNlZCUyMiU1RCUyQyUyMGJhdGNoX3NpemVzJTNEJTVCOCU1RCUyQyUyMHNlcXVlbmNlX2xlbmd0aHMlM0QlNUI4JTJDJTIwMzIlMkMlMjAxMjglMkMlMjA1MTIlNUQpJTBBYmVuY2htYXJrJTIwJTNEJTIwUHlUb3JjaEJlbmNobWFyayhhcmdzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PyTorchBenchmark, PyTorchBenchmarkArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = PyTorchBenchmarkArguments(models=[<span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>], batch_sizes=[<span class="hljs-number">8</span>], sequence_lengths=[<span class="hljs-number">8</span>, <span class="hljs-number">32</span>, <span class="hljs-number">128</span>, <span class="hljs-number">512</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>benchmark = PyTorchBenchmark(args)`,wrap:!1}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p:N,i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function jn(h){let a,l;return a=new K({props:{$$slots:{default:[on]},$$scope:{ctx:h}}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p(n,p){const c={};p&2&&(c.$$scope={dirty:p,ctx:n}),a.$set(c)},i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function gn(h){let a,l;return a=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRlbnNvckZsb3dCZW5jaG1hcmslMkMlMjBUZW5zb3JGbG93QmVuY2htYXJrQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRlbnNvckZsb3dCZW5jaG1hcmtBcmd1bWVudHMoJTBBJTIwJTIwJTIwJTIwbW9kZWxzJTNEJTVCJTIyZ29vZ2xlLWJlcnQlMkZiZXJ0LWJhc2UtdW5jYXNlZCUyMiU1RCUyQyUyMGJhdGNoX3NpemVzJTNEJTVCOCU1RCUyQyUyMHNlcXVlbmNlX2xlbmd0aHMlM0QlNUI4JTJDJTIwMzIlMkMlMjAxMjglMkMlMjA1MTIlNUQlMEEpJTBBYmVuY2htYXJrJTIwJTNEJTIwVGVuc29yRmxvd0JlbmNobWFyayhhcmdzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TensorFlowBenchmark, TensorFlowBenchmarkArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TensorFlowBenchmarkArguments(
<span class="hljs-meta">... </span>    models=[<span class="hljs-string">&quot;google-bert/bert-base-uncased&quot;</span>], batch_sizes=[<span class="hljs-number">8</span>], sequence_lengths=[<span class="hljs-number">8</span>, <span class="hljs-number">32</span>, <span class="hljs-number">128</span>, <span class="hljs-number">512</span>]
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>benchmark = TensorFlowBenchmark(args)`,wrap:!1}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p:N,i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function fn(h){let a,l;return a=new K({props:{$$slots:{default:[gn]},$$scope:{ctx:h}}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p(n,p){const c={};p&2&&(c.$$scope={dirty:p,ctx:n}),a.$set(c)},i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function $n(h){let a,l="以下代码通过<code>PyTorchBenchmarkArguments</code>设置模型批处理大小和序列长度，然后调用<code>benchmark.run()</code>执行基准测试。",n,p,c;return p=new O({props:{code:"cmVzdWx0cyUyMCUzRCUyMGJlbmNobWFyay5ydW4oKSUwQXByaW50KHJlc3VsdHMpJTBBJTBBJTBB",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>results = benchmark.run()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(results)
====================       INFERENCE - SPEED - RESULT       ====================
--------------------------------------------------------------------------------
Model Name             Batch Size     Seq Length     Time <span class="hljs-keyword">in</span> s                  
--------------------------------------------------------------------------------
google-bert/bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.006</span>     
google-bert/bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.006</span>     
google-bert/bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.018</span>     
google-bert/bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.088</span>     
--------------------------------------------------------------------------------

====================      INFERENCE - MEMORY - RESULT       ====================
--------------------------------------------------------------------------------
Model Name             Batch Size     Seq Length    Memory <span class="hljs-keyword">in</span> MB 
--------------------------------------------------------------------------------
google-bert/bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1227</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1281</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1307</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">1539</span>
--------------------------------------------------------------------------------

====================        ENVIRONMENT INFORMATION         ====================

- transformers_version: <span class="hljs-number">2.11</span><span class="hljs-number">.0</span>
- framework: PyTorch
- use_torchscript: <span class="hljs-literal">False</span>
- framework_version: <span class="hljs-number">1.4</span><span class="hljs-number">.0</span>
- python_version: <span class="hljs-number">3.6</span><span class="hljs-number">.10</span>
- system: Linux
- cpu: x86_64
- architecture: 64bit
- date: <span class="hljs-number">2020</span>-06-<span class="hljs-number">29</span>
- time: 08:<span class="hljs-number">58</span>:<span class="hljs-number">43.371351</span>
- fp16: <span class="hljs-literal">False</span>
- use_multiprocessing: <span class="hljs-literal">True</span>
- only_pretrain_model: <span class="hljs-literal">False</span>
- cpu_ram_mb: <span class="hljs-number">32088</span>
- use_gpu: <span class="hljs-literal">True</span>
- num_gpus: <span class="hljs-number">1</span>
- gpu: TITAN RTX
- gpu_ram_mb: <span class="hljs-number">24217</span>
- gpu_power_watts: <span class="hljs-number">280.0</span>
- gpu_performance_state: <span class="hljs-number">2</span>
- use_tpu: <span class="hljs-literal">False</span>`,wrap:!1}}),{c(){a=j("p"),a.innerHTML=l,n=m(),g(p.$$.fragment)},l(b){a=i(b,"P",{"data-svelte-h":!0}),_(a)!=="svelte-85mb6o"&&(a.innerHTML=l),n=u(b),f(p.$$.fragment,b)},m(b,T){r(b,a,T),r(b,n,T),$(p,b,T),c=!0},p:N,i(b){c||(y(p.$$.fragment,b),c=!0)},o(b){d(p.$$.fragment,b),c=!1},d(b){b&&(t(a),t(n)),M(p,b)}}}function yn(h){let a,l;return a=new K({props:{$$slots:{default:[$n]},$$scope:{ctx:h}}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p(n,p){const c={};p&2&&(c.$$scope={dirty:p,ctx:n}),a.$set(c)},i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function dn(h){let a,l,n,p="接下来，只需要调用 <code>benchmark.run()</code> 就能轻松运行已经实例化的基准测试对象。",c,b,T;return a=new O({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZ0ZW5zb3JmbG93JTJGYmVuY2htYXJraW5nJTJGcnVuX2JlbmNobWFya190Zi5weSUyMC0taGVscA==",highlighted:'python examples/tensorflow/benchmarking/run_benchmark_tf.py --<span class="hljs-built_in">help</span>',wrap:!1}}),b=new O({props:{code:"cmVzdWx0cyUyMCUzRCUyMGJlbmNobWFyay5ydW4oKSUwQXByaW50KHJlc3VsdHMpJTBBcmVzdWx0cyUyMCUzRCUyMGJlbmNobWFyay5ydW4oKSUwQXByaW50KHJlc3VsdHMpJTBBJTBBJTBB",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>results = benchmark.run()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(results)
<span class="hljs-meta">&gt;&gt;&gt; </span>results = benchmark.run()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(results)
====================       INFERENCE - SPEED - RESULT       ====================
--------------------------------------------------------------------------------
Model Name             Batch Size     Seq Length     Time <span class="hljs-keyword">in</span> s                  
--------------------------------------------------------------------------------
google-bert/bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.005</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.008</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.022</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.105</span>
--------------------------------------------------------------------------------

====================      INFERENCE - MEMORY - RESULT       ====================
--------------------------------------------------------------------------------
Model Name             Batch Size     Seq Length    Memory <span class="hljs-keyword">in</span> MB 
--------------------------------------------------------------------------------
google-bert/bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1330</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1330</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1330</span>
google-bert/bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">1770</span>
--------------------------------------------------------------------------------

====================        ENVIRONMENT INFORMATION         ====================

- transformers_version: <span class="hljs-number">2.11</span><span class="hljs-number">.0</span>
- framework: Tensorflow
- use_xla: <span class="hljs-literal">False</span>
- framework_version: <span class="hljs-number">2.2</span><span class="hljs-number">.0</span>
- python_version: <span class="hljs-number">3.6</span><span class="hljs-number">.10</span>
- system: Linux
- cpu: x86_64
- architecture: 64bit
- date: <span class="hljs-number">2020</span>-06-<span class="hljs-number">29</span>
- time: 09:<span class="hljs-number">26</span>:<span class="hljs-number">35.617317</span>
- fp16: <span class="hljs-literal">False</span>
- use_multiprocessing: <span class="hljs-literal">True</span>
- only_pretrain_model: <span class="hljs-literal">False</span>
- cpu_ram_mb: <span class="hljs-number">32088</span>
- use_gpu: <span class="hljs-literal">True</span>
- num_gpus: <span class="hljs-number">1</span>
- gpu: TITAN RTX
- gpu_ram_mb: <span class="hljs-number">24217</span>
- gpu_power_watts: <span class="hljs-number">280.0</span>
- gpu_performance_state: <span class="hljs-number">2</span>
- use_tpu: <span class="hljs-literal">False</span>`,wrap:!1}}),{c(){g(a.$$.fragment),l=m(),n=j("p"),n.innerHTML=p,c=m(),g(b.$$.fragment)},l(o){f(a.$$.fragment,o),l=u(o),n=i(o,"P",{"data-svelte-h":!0}),_(n)!=="svelte-f27lw6"&&(n.innerHTML=p),c=u(o),f(b.$$.fragment,o)},m(o,w){$(a,o,w),r(o,l,w),r(o,n,w),r(o,c,w),$(b,o,w),T=!0},p:N,i(o){T||(y(a.$$.fragment,o),y(b.$$.fragment,o),T=!0)},o(o){d(a.$$.fragment,o),d(b.$$.fragment,o),T=!1},d(o){o&&(t(l),t(n),t(c)),M(a,o),M(b,o)}}}function Mn(h){let a,l;return a=new K({props:{$$slots:{default:[dn]},$$scope:{ctx:h}}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p(n,p){const c={};p&2&&(c.$$scope={dirty:p,ctx:n}),a.$set(c)},i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function _n(h){let a,l;return a=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFB5VG9yY2hCZW5jaG1hcmslMkMlMjBQeVRvcmNoQmVuY2htYXJrQXJndW1lbnRzJTJDJTIwQmVydENvbmZpZyUwQSUwQWFyZ3MlMjAlM0QlMjBQeVRvcmNoQmVuY2htYXJrQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG1vZGVscyUzRCU1QiUyMmJlcnQtYmFzZSUyMiUyQyUyMCUyMmJlcnQtMzg0LWhpZCUyMiUyQyUyMCUyMmJlcnQtNi1sYXklMjIlNUQlMkMlMjBiYXRjaF9zaXplcyUzRCU1QjglNUQlMkMlMjBzZXF1ZW5jZV9sZW5ndGhzJTNEJTVCOCUyQyUyMDMyJTJDJTIwMTI4JTJDJTIwNTEyJTVEJTBBKSUwQWNvbmZpZ19iYXNlJTIwJTNEJTIwQmVydENvbmZpZygpJTBBY29uZmlnXzM4NF9oaWQlMjAlM0QlMjBCZXJ0Q29uZmlnKGhpZGRlbl9zaXplJTNEMzg0KSUwQWNvbmZpZ182X2xheSUyMCUzRCUyMEJlcnRDb25maWcobnVtX2hpZGRlbl9sYXllcnMlM0Q2KSUwQSUwQWJlbmNobWFyayUyMCUzRCUyMFB5VG9yY2hCZW5jaG1hcmsoYXJncyUyQyUyMGNvbmZpZ3MlM0QlNUJjb25maWdfYmFzZSUyQyUyMGNvbmZpZ18zODRfaGlkJTJDJTIwY29uZmlnXzZfbGF5JTVEKSUwQWJlbmNobWFyay5ydW4oKSUwQSUwQSUwQQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> PyTorchBenchmark, PyTorchBenchmarkArguments, BertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>args = PyTorchBenchmarkArguments(
<span class="hljs-meta">... </span>    models=[<span class="hljs-string">&quot;bert-base&quot;</span>, <span class="hljs-string">&quot;bert-384-hid&quot;</span>, <span class="hljs-string">&quot;bert-6-lay&quot;</span>], batch_sizes=[<span class="hljs-number">8</span>], sequence_lengths=[<span class="hljs-number">8</span>, <span class="hljs-number">32</span>, <span class="hljs-number">128</span>, <span class="hljs-number">512</span>]
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config_base = BertConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_384_hid = BertConfig(hidden_size=<span class="hljs-number">384</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config_6_lay = BertConfig(num_hidden_layers=<span class="hljs-number">6</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>benchmark = PyTorchBenchmark(args, configs=[config_base, config_384_hid, config_6_lay])
<span class="hljs-meta">&gt;&gt;&gt; </span>benchmark.run()
====================       INFERENCE - SPEED - RESULT       ====================
--------------------------------------------------------------------------------
Model Name             Batch Size     Seq Length       Time <span class="hljs-keyword">in</span> s                  
--------------------------------------------------------------------------------
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.006</span>
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.006</span>
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.018</span>     
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.088</span>     
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.006</span>     
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.006</span>     
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.011</span>     
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.054</span>     
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.003</span>     
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.004</span>     
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.009</span>     
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.044</span>
--------------------------------------------------------------------------------

====================      INFERENCE - MEMORY - RESULT       ====================
--------------------------------------------------------------------------------
Model Name             Batch Size     Seq Length      Memory <span class="hljs-keyword">in</span> MB 
--------------------------------------------------------------------------------
bert-base                  <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1277</span>
bert-base                  <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1281</span>
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1307</span>     
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">1539</span>     
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1005</span>     
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1027</span>     
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1035</span>     
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">1255</span>     
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1097</span>     
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1101</span>     
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1127</span>     
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">1359</span>
--------------------------------------------------------------------------------

====================        ENVIRONMENT INFORMATION         ====================

- transformers_version: <span class="hljs-number">2.11</span><span class="hljs-number">.0</span>
- framework: PyTorch
- use_torchscript: <span class="hljs-literal">False</span>
- framework_version: <span class="hljs-number">1.4</span><span class="hljs-number">.0</span>
- python_version: <span class="hljs-number">3.6</span><span class="hljs-number">.10</span>
- system: Linux
- cpu: x86_64
- architecture: 64bit
- date: <span class="hljs-number">2020</span>-06-<span class="hljs-number">29</span>
- time: 09:<span class="hljs-number">35</span>:<span class="hljs-number">25.143267</span>
- fp16: <span class="hljs-literal">False</span>
- use_multiprocessing: <span class="hljs-literal">True</span>
- only_pretrain_model: <span class="hljs-literal">False</span>
- cpu_ram_mb: <span class="hljs-number">32088</span>
- use_gpu: <span class="hljs-literal">True</span>
- num_gpus: <span class="hljs-number">1</span>
- gpu: TITAN RTX
- gpu_ram_mb: <span class="hljs-number">24217</span>
- gpu_power_watts: <span class="hljs-number">280.0</span>
- gpu_performance_state: <span class="hljs-number">2</span>
- use_tpu: <span class="hljs-literal">False</span>`,wrap:!1}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p:N,i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function Tn(h){let a,l;return a=new K({props:{$$slots:{default:[_n]},$$scope:{ctx:h}}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p(n,p){const c={};p&2&&(c.$$scope={dirty:p,ctx:n}),a.$set(c)},i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function wn(h){let a,l;return a=new O({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRlbnNvckZsb3dCZW5jaG1hcmslMkMlMjBUZW5zb3JGbG93QmVuY2htYXJrQXJndW1lbnRzJTJDJTIwQmVydENvbmZpZyUwQSUwQWFyZ3MlMjAlM0QlMjBUZW5zb3JGbG93QmVuY2htYXJrQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG1vZGVscyUzRCU1QiUyMmJlcnQtYmFzZSUyMiUyQyUyMCUyMmJlcnQtMzg0LWhpZCUyMiUyQyUyMCUyMmJlcnQtNi1sYXklMjIlNUQlMkMlMjBiYXRjaF9zaXplcyUzRCU1QjglNUQlMkMlMjBzZXF1ZW5jZV9sZW5ndGhzJTNEJTVCOCUyQyUyMDMyJTJDJTIwMTI4JTJDJTIwNTEyJTVEJTBBKSUwQWNvbmZpZ19iYXNlJTIwJTNEJTIwQmVydENvbmZpZygpJTBBY29uZmlnXzM4NF9oaWQlMjAlM0QlMjBCZXJ0Q29uZmlnKGhpZGRlbl9zaXplJTNEMzg0KSUwQWNvbmZpZ182X2xheSUyMCUzRCUyMEJlcnRDb25maWcobnVtX2hpZGRlbl9sYXllcnMlM0Q2KSUwQSUwQWJlbmNobWFyayUyMCUzRCUyMFRlbnNvckZsb3dCZW5jaG1hcmsoYXJncyUyQyUyMGNvbmZpZ3MlM0QlNUJjb25maWdfYmFzZSUyQyUyMGNvbmZpZ18zODRfaGlkJTJDJTIwY29uZmlnXzZfbGF5JTVEKSUwQWJlbmNobWFyay5ydW4oKSUwQSUwQSUwQQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TensorFlowBenchmark, TensorFlowBenchmarkArguments, BertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span>args = TensorFlowBenchmarkArguments(
<span class="hljs-meta">... </span>    models=[<span class="hljs-string">&quot;bert-base&quot;</span>, <span class="hljs-string">&quot;bert-384-hid&quot;</span>, <span class="hljs-string">&quot;bert-6-lay&quot;</span>], batch_sizes=[<span class="hljs-number">8</span>], sequence_lengths=[<span class="hljs-number">8</span>, <span class="hljs-number">32</span>, <span class="hljs-number">128</span>, <span class="hljs-number">512</span>]
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config_base = BertConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span>config_384_hid = BertConfig(hidden_size=<span class="hljs-number">384</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config_6_lay = BertConfig(num_hidden_layers=<span class="hljs-number">6</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>benchmark = TensorFlowBenchmark(args, configs=[config_base, config_384_hid, config_6_lay])
<span class="hljs-meta">&gt;&gt;&gt; </span>benchmark.run()
====================       INFERENCE - SPEED - RESULT       ====================
--------------------------------------------------------------------------------
Model Name             Batch Size     Seq Length       Time <span class="hljs-keyword">in</span> s                  
--------------------------------------------------------------------------------
bert-base                  <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.005</span>
bert-base                  <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.008</span>
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.022</span>
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.106</span>
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.005</span>
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.007</span>
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.018</span>
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.064</span>
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.002</span>
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.003</span>
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.0011</span>
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">0.074</span>
--------------------------------------------------------------------------------

====================      INFERENCE - MEMORY - RESULT       ====================
--------------------------------------------------------------------------------
Model Name             Batch Size     Seq Length      Memory <span class="hljs-keyword">in</span> MB 
--------------------------------------------------------------------------------
bert-base                  <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1330</span>
bert-base                  <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1330</span>
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1330</span>
bert-base                  <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">1770</span>
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1330</span>
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1330</span>
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1330</span>
bert-<span class="hljs-number">384</span>-hid              <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">1540</span>
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1330</span>
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1330</span>
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1330</span>
bert-<span class="hljs-number">6</span>-lay                 <span class="hljs-number">8</span>              <span class="hljs-number">512</span>            <span class="hljs-number">1540</span>
--------------------------------------------------------------------------------

====================        ENVIRONMENT INFORMATION         ====================

- transformers_version: <span class="hljs-number">2.11</span><span class="hljs-number">.0</span>
- framework: Tensorflow
- use_xla: <span class="hljs-literal">False</span>
- framework_version: <span class="hljs-number">2.2</span><span class="hljs-number">.0</span>
- python_version: <span class="hljs-number">3.6</span><span class="hljs-number">.10</span>
- system: Linux
- cpu: x86_64
- architecture: 64bit
- date: <span class="hljs-number">2020</span>-06-<span class="hljs-number">29</span>
- time: 09:<span class="hljs-number">38</span>:<span class="hljs-number">15.487125</span>
- fp16: <span class="hljs-literal">False</span>
- use_multiprocessing: <span class="hljs-literal">True</span>
- only_pretrain_model: <span class="hljs-literal">False</span>
- cpu_ram_mb: <span class="hljs-number">32088</span>
- use_gpu: <span class="hljs-literal">True</span>
- num_gpus: <span class="hljs-number">1</span>
- gpu: TITAN RTX
- gpu_ram_mb: <span class="hljs-number">24217</span>
- gpu_power_watts: <span class="hljs-number">280.0</span>
- gpu_performance_state: <span class="hljs-number">2</span>
- use_tpu: <span class="hljs-literal">False</span>`,wrap:!1}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p:N,i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function Un(h){let a,l;return a=new K({props:{$$slots:{default:[wn]},$$scope:{ctx:h}}}),{c(){g(a.$$.fragment)},l(n){f(a.$$.fragment,n)},m(n,p){$(a,n,p),l=!0},p(n,p){const c={};p&2&&(c.$$scope={dirty:p,ctx:n}),a.$set(c)},i(n){l||(y(a.$$.fragment,n),l=!0)},o(n){d(a.$$.fragment,n),l=!1},d(n){M(a,n)}}}function kn(h){let a,l,n,p,c,b,T,o,w,ns,B,vs="让我们来看看如何对🤗 Transformers模型进行基准测试，以及进行测试的推荐策略和已有的基准测试结果。",as,v,Es='如果您需要更详细的回答，可以在<a href="https://github.com/huggingface/notebooks/tree/main/examples/benchmark.ipynb" rel="nofollow">这里</a>找到更多关于基准测试的内容。',es,E,ls,Q,Qs="使用<code>PyTorchBenchmark</code>和<code>TensorFlowBenchmark</code>类可以灵活地对🤗 Transformers模型进行基准测试。这些基准测试类可以衡量模型在<strong>推理</strong>和<strong>训练</strong>过程中所需的<strong>峰值内存</strong>和<strong>时间</strong>。",ts,U,rs,Z,Zs="基准测试类 <code>PyTorchBenchmark</code> 和 <code>TensorFlowBenchmark</code> 需要分别传入 <code>PyTorchBenchmarkArguments</code> 和 <code>TensorFlowBenchmarkArguments</code> 类型的对象来进行实例化。这些类是数据类型，包含了所有相关的配置参数，用于其对应的基准测试类。",ps,z,zs="在下面的示例中，我们展示了如何对类型为 <strong>bert-base-cased</strong> 的BERT模型进行基准测试：",cs,k,ms,W,Ws='在这里，基准测试的参数数据类接受了三个主要的参数，即 <code>models</code>、<code>batch_sizes</code> 和<code>sequence_lengths</code>。其中，<code>models</code> 是必需的参数，它期望一个来自<a href="https://huggingface.co/models" rel="nofollow">模型库</a>的模型标识符列表。<code>batch_sizes</code> 和 <code>sequence_lengths</code> 是列表类型的参数，定义了进行基准测试时 <code>input_ids</code> 的批量大小和序列长度。',us,F,Fs="这些是基准测试数据类中可以配置的一些主要参数。除此之外，基准测试数据类中还可以配置很多其他参数。如需要查看更详细的配置参数，可以直接查看以下文件：",hs,R,Rs="<li><code>src/transformers/benchmark/benchmark_args_utils.py</code></li> <li><code>src/transformers/benchmark/benchmark_args.py</code>（针对 PyTorch）</li> <li><code>src/transformers/benchmark/benchmark_args_tf.py</code>（针对 TensorFlow）</li>",bs,x,xs=`另外，您还可以通过在根目录下运行以下命令，查看针对 PyTorch 和 TensorFlow 的所有可配置参数的描述列表：
<code>bash python examples/pytorch/benchmarking/run_benchmark.py --help</code>
这些命令将列出所有可以配置的参数，它们可以帮助您更加灵活地进行基准测试。`,os,J,js,L,Ls="在一般情况下，基准测试会测量推理（inference）的<strong>时间</strong>和<strong>所需内存</strong>。在上面的示例输出中，前两部分显示了与<strong>推理时间</strong>和<strong>推理内存</strong>对应的结果。与此同时，关于计算环境的所有相关信息（例如 GPU 类型、系统、库版本等）会在第三部分的<strong>环境信息</strong>中打印出来。你可以通过在 <code>PyTorchBenchmarkArguments</code> 和 <code>TensorFlowBenchmarkArguments</code> 中添加 <code>save_to_csv=True</code>参数，将这些信息保存到一个 .csv 文件中。在这种情况下，每一部分的信息会分别保存在不同的 .csv 文件中。每个 .csv 文件的路径也可以通过参数数据类进行定义。",is,S,Ss="您可以选择不通过预训练模型的模型标识符（如 <code>google-bert/bert-base-uncased</code>）进行基准测试，而是对任何可用模型类的任意配置进行基准测试。在这种情况下，我们必须将一系列配置与基准测试参数一起传入，方法如下：",gs,C,fs,X,Xs="<strong>推理时间</strong>和<strong>推理所需内存</strong>会被重新测量，不过这次是针对 <code>BertModel</code> 类的自定义配置进行基准测试。这个功能在决定模型应该使用哪种配置进行训练时尤其有用。",$s,I,ys,G,Is="本节列出了一些在对模型进行基准测试时比较推荐的策略：",ds,V,Gs="<li>目前，该模块只支持单设备基准测试。在进行 GPU 基准测试时，建议用户通过设置 <code>CUDA_VISIBLE_DEVICES</code> 环境变量来指定代码应在哪个设备上运行，例如在运行代码前执行 <code>export CUDA_VISIBLE_DEVICES=0</code>。</li> <li><code>no_multi_processing</code> 选项仅应在测试和调试时设置为 <code>True</code>。为了确保内存测量的准确性，建议将每个内存基准测试单独运行在一个进程中，并确保 <code>no_multi_processing</code> 设置为 <code>True</code>。</li> <li>当您分享模型基准测试结果时，应始终提供环境信息。由于 GPU 设备、库版本等之间可能存在较大差异，单独的基准测试结果对社区的帮助有限。</li>",Ms,H,_s,P,Vs="先前的所有可用的核心模型（当时有10个）都已针对 <strong>推理时间</strong> 进行基准测试，涵盖了多种不同的设置：使用 PyTorch（包不包含 TorchScript），使用 TensorFlow（包不包含 XLA）。所有的测试都在 CPU（除了 TensorFlow XLA）和 GPU 上进行。",Ts,Y,Hs='这种方法的详细信息可以在 <a href="https://medium.com/huggingface/benchmarking-transformers-pytorch-and-tensorflow-e2917fb891c2" rel="nofollow">这篇博客</a> 中找到，测试结果可以在 <a href="https://docs.google.com/spreadsheets/d/1sryqufw2D0XlUH4sq3e9Wnxu5EAQkaohzrJbd5HdQ_w/edit?usp=sharing" rel="nofollow">这里</a> 查看。',ws,A,Ps="您可以借助新的 <strong>基准测试</strong> 工具比以往任何时候都更容易地分享您的基准测试结果！",Us,q,Ys='<li><a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/benchmarking/README.md" rel="nofollow">PyTorch 基准测试结果</a></li> <li><a href="https://github.com/huggingface/transformers/tree/main/examples/tensorflow/benchmarking/README.md" rel="nofollow">TensorFlow 基准测试结果</a></li>',ks,D,Js,ss,Cs;return c=new Ns({props:{title:"基准测试",local:"基准测试",headingTag:"h1"}}),T=new an({props:{warning:!0,$$slots:{default:[hn]},$$scope:{ctx:h}}}),w=new mn({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/zh/benchmarks.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/zh/pytorch/benchmarks.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/zh/tensorflow/benchmarks.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/zh/benchmarks.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/zh/pytorch/benchmarks.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/zh/tensorflow/benchmarks.ipynb"}]}}),E=new Ns({props:{title:"如何对🤗 Transformers模型进行基准测试",local:"如何对-transformers模型进行基准测试",headingTag:"h2"}}),U=new an({props:{$$slots:{default:[bn]},$$scope:{ctx:h}}}),k=new Bs({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[fn],pytorch:[jn]},$$scope:{ctx:h}}}),J=new Bs({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Mn],pytorch:[yn]},$$scope:{ctx:h}}}),C=new Bs({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Un],pytorch:[Tn]},$$scope:{ctx:h}}}),I=new Ns({props:{title:"基准测试的推荐策略",local:"基准测试的推荐策略",headingTag:"h2"}}),H=new Ns({props:{title:"分享您的基准测试结果",local:"分享您的基准测试结果",headingTag:"h2"}}),D=new un({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/zh/benchmarks.md"}}),{c(){a=j("meta"),l=m(),n=j("p"),p=m(),g(c.$$.fragment),b=m(),g(T.$$.fragment),o=m(),g(w.$$.fragment),ns=m(),B=j("p"),B.textContent=vs,as=m(),v=j("p"),v.innerHTML=Es,es=m(),g(E.$$.fragment),ls=m(),Q=j("p"),Q.innerHTML=Qs,ts=m(),g(U.$$.fragment),rs=m(),Z=j("p"),Z.innerHTML=Zs,ps=m(),z=j("p"),z.innerHTML=zs,cs=m(),g(k.$$.fragment),ms=m(),W=j("p"),W.innerHTML=Ws,us=m(),F=j("p"),F.textContent=Fs,hs=m(),R=j("ul"),R.innerHTML=Rs,bs=m(),x=j("p"),x.innerHTML=xs,os=m(),g(J.$$.fragment),js=m(),L=j("p"),L.innerHTML=Ls,is=m(),S=j("p"),S.innerHTML=Ss,gs=m(),g(C.$$.fragment),fs=m(),X=j("p"),X.innerHTML=Xs,$s=m(),g(I.$$.fragment),ys=m(),G=j("p"),G.textContent=Is,ds=m(),V=j("ul"),V.innerHTML=Gs,Ms=m(),g(H.$$.fragment),_s=m(),P=j("p"),P.innerHTML=Vs,Ts=m(),Y=j("p"),Y.innerHTML=Hs,ws=m(),A=j("p"),A.innerHTML=Ps,Us=m(),q=j("ul"),q.innerHTML=Ys,ks=m(),g(D.$$.fragment),Js=m(),ss=j("p"),this.h()},l(s){const e=pn("svelte-u9bgzb",document.head);a=i(e,"META",{name:!0,content:!0}),e.forEach(t),l=u(s),n=i(s,"P",{}),sn(n).forEach(t),p=u(s),f(c.$$.fragment,s),b=u(s),f(T.$$.fragment,s),o=u(s),f(w.$$.fragment,s),ns=u(s),B=i(s,"P",{"data-svelte-h":!0}),_(B)!=="svelte-3vgl82"&&(B.textContent=vs),as=u(s),v=i(s,"P",{"data-svelte-h":!0}),_(v)!=="svelte-9kt0o2"&&(v.innerHTML=Es),es=u(s),f(E.$$.fragment,s),ls=u(s),Q=i(s,"P",{"data-svelte-h":!0}),_(Q)!=="svelte-10rp26e"&&(Q.innerHTML=Qs),ts=u(s),f(U.$$.fragment,s),rs=u(s),Z=i(s,"P",{"data-svelte-h":!0}),_(Z)!=="svelte-mgrxc0"&&(Z.innerHTML=Zs),ps=u(s),z=i(s,"P",{"data-svelte-h":!0}),_(z)!=="svelte-1lozh36"&&(z.innerHTML=zs),cs=u(s),f(k.$$.fragment,s),ms=u(s),W=i(s,"P",{"data-svelte-h":!0}),_(W)!=="svelte-19ddgzb"&&(W.innerHTML=Ws),us=u(s),F=i(s,"P",{"data-svelte-h":!0}),_(F)!=="svelte-ui49s5"&&(F.textContent=Fs),hs=u(s),R=i(s,"UL",{"data-svelte-h":!0}),_(R)!=="svelte-o6s2b1"&&(R.innerHTML=Rs),bs=u(s),x=i(s,"P",{"data-svelte-h":!0}),_(x)!=="svelte-wojbtq"&&(x.innerHTML=xs),os=u(s),f(J.$$.fragment,s),js=u(s),L=i(s,"P",{"data-svelte-h":!0}),_(L)!=="svelte-zqe8jg"&&(L.innerHTML=Ls),is=u(s),S=i(s,"P",{"data-svelte-h":!0}),_(S)!=="svelte-1j76weh"&&(S.innerHTML=Ss),gs=u(s),f(C.$$.fragment,s),fs=u(s),X=i(s,"P",{"data-svelte-h":!0}),_(X)!=="svelte-1u4dkw4"&&(X.innerHTML=Xs),$s=u(s),f(I.$$.fragment,s),ys=u(s),G=i(s,"P",{"data-svelte-h":!0}),_(G)!=="svelte-zynf54"&&(G.textContent=Is),ds=u(s),V=i(s,"UL",{"data-svelte-h":!0}),_(V)!=="svelte-igohop"&&(V.innerHTML=Gs),Ms=u(s),f(H.$$.fragment,s),_s=u(s),P=i(s,"P",{"data-svelte-h":!0}),_(P)!=="svelte-g6gd81"&&(P.innerHTML=Vs),Ts=u(s),Y=i(s,"P",{"data-svelte-h":!0}),_(Y)!=="svelte-1div4zq"&&(Y.innerHTML=Hs),ws=u(s),A=i(s,"P",{"data-svelte-h":!0}),_(A)!=="svelte-1yrml7z"&&(A.innerHTML=Ps),Us=u(s),q=i(s,"UL",{"data-svelte-h":!0}),_(q)!=="svelte-953mda"&&(q.innerHTML=Ys),ks=u(s),f(D.$$.fragment,s),Js=u(s),ss=i(s,"P",{}),sn(ss).forEach(t),this.h()},h(){nn(a,"name","hf:doc:metadata"),nn(a,"content",Jn)},m(s,e){cn(document.head,a),r(s,l,e),r(s,n,e),r(s,p,e),$(c,s,e),r(s,b,e),$(T,s,e),r(s,o,e),$(w,s,e),r(s,ns,e),r(s,B,e),r(s,as,e),r(s,v,e),r(s,es,e),$(E,s,e),r(s,ls,e),r(s,Q,e),r(s,ts,e),$(U,s,e),r(s,rs,e),r(s,Z,e),r(s,ps,e),r(s,z,e),r(s,cs,e),$(k,s,e),r(s,ms,e),r(s,W,e),r(s,us,e),r(s,F,e),r(s,hs,e),r(s,R,e),r(s,bs,e),r(s,x,e),r(s,os,e),$(J,s,e),r(s,js,e),r(s,L,e),r(s,is,e),r(s,S,e),r(s,gs,e),$(C,s,e),r(s,fs,e),r(s,X,e),r(s,$s,e),$(I,s,e),r(s,ys,e),r(s,G,e),r(s,ds,e),r(s,V,e),r(s,Ms,e),$(H,s,e),r(s,_s,e),r(s,P,e),r(s,Ts,e),r(s,Y,e),r(s,ws,e),r(s,A,e),r(s,Us,e),r(s,q,e),r(s,ks,e),$(D,s,e),r(s,Js,e),r(s,ss,e),Cs=!0},p(s,[e]){const As={};e&2&&(As.$$scope={dirty:e,ctx:s}),T.$set(As);const qs={};e&2&&(qs.$$scope={dirty:e,ctx:s}),U.$set(qs);const Ds={};e&2&&(Ds.$$scope={dirty:e,ctx:s}),k.$set(Ds);const Os={};e&2&&(Os.$$scope={dirty:e,ctx:s}),J.$set(Os);const Ks={};e&2&&(Ks.$$scope={dirty:e,ctx:s}),C.$set(Ks)},i(s){Cs||(y(c.$$.fragment,s),y(T.$$.fragment,s),y(w.$$.fragment,s),y(E.$$.fragment,s),y(U.$$.fragment,s),y(k.$$.fragment,s),y(J.$$.fragment,s),y(C.$$.fragment,s),y(I.$$.fragment,s),y(H.$$.fragment,s),y(D.$$.fragment,s),Cs=!0)},o(s){d(c.$$.fragment,s),d(T.$$.fragment,s),d(w.$$.fragment,s),d(E.$$.fragment,s),d(U.$$.fragment,s),d(k.$$.fragment,s),d(J.$$.fragment,s),d(C.$$.fragment,s),d(I.$$.fragment,s),d(H.$$.fragment,s),d(D.$$.fragment,s),Cs=!1},d(s){s&&(t(l),t(n),t(p),t(b),t(o),t(ns),t(B),t(as),t(v),t(es),t(ls),t(Q),t(ts),t(rs),t(Z),t(ps),t(z),t(cs),t(ms),t(W),t(us),t(F),t(hs),t(R),t(bs),t(x),t(os),t(js),t(L),t(is),t(S),t(gs),t(fs),t(X),t($s),t(ys),t(G),t(ds),t(V),t(Ms),t(_s),t(P),t(Ts),t(Y),t(ws),t(A),t(Us),t(q),t(ks),t(Js),t(ss)),t(a),M(c,s),M(T,s),M(w,s),M(E,s),M(U,s),M(k,s),M(J,s),M(C,s),M(I,s),M(H,s),M(D,s)}}}const Jn='{"title":"基准测试","local":"基准测试","sections":[{"title":"如何对🤗 Transformers模型进行基准测试","local":"如何对-transformers模型进行基准测试","sections":[],"depth":2},{"title":"基准测试的推荐策略","local":"基准测试的推荐策略","sections":[],"depth":2},{"title":"分享您的基准测试结果","local":"分享您的基准测试结果","sections":[],"depth":2}],"depth":1}';function Cn(h){return ln(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wn extends tn{constructor(a){super(),rn(this,a,Cn,kn,en,{})}}export{Wn as component};
