import{s as we,o as _e,n as S}from"../chunks/scheduler.9bc65507.js";import{S as Te,i as ke,g as h,s as u,u as j,A as Me,h as o,f as l,c as b,j as U,v as d,y as _,k as T,o as k,a as r,w as g,d as y,t as $,x as w}from"../chunks/index.78c82d43.js";import{T as $e}from"../chunks/Tip.87d55b76.js";import{I as Ps}from"../chunks/IconCopyLink.bedaa44d.js";import{C as x}from"../chunks/CodeBlock.73e038be.js";import{D as ve}from"../chunks/DocNotebookDropdown.31840a23.js";import{F as qs,M as os}from"../chunks/Markdown.1b9b4e1c.js";function Ue(i){let a,n=`Hugging Face’s Benchmarking tools are deprecated and it is advised to use external Benchmarking libraries to measure the speed
and memory complexity of Transformer models.`;return{c(){a=h("p"),a.textContent=n},l(s){a=o(s,"P",{"data-svelte-h":!0}),_(a)!=="svelte-ef5x4f"&&(a.textContent=n)},m(s,p){r(s,a,p)},p:S,d(s){s&&l(a)}}}function Je(i){let a,n=`Hereby, <em>inference</em> is defined by a single forward pass, and <em>training</em> is defined by a single forward pass and
backward pass.`;return{c(){a=h("p"),a.innerHTML=n},l(s){a=o(s,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11dcz86"&&(a.innerHTML=n)},m(s,p){r(s,a,p)},p:S,d(s){s&&l(a)}}}function Ce(i){let a,n;return a=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFB5VG9yY2hCZW5jaG1hcmslMkMlMjBQeVRvcmNoQmVuY2htYXJrQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFB5VG9yY2hCZW5jaG1hcmtBcmd1bWVudHMobW9kZWxzJTNEJTVCJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIlNUQlMkMlMjBiYXRjaF9zaXplcyUzRCU1QjglNUQlMkMlMjBzZXF1ZW5jZV9sZW5ndGhzJTNEJTVCOCUyQyUyMDMyJTJDJTIwMTI4JTJDJTIwNTEyJTVEKSUwQWJlbmNobWFyayUyMCUzRCUyMFB5VG9yY2hCZW5jaG1hcmsoYXJncyk=",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;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(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p:S,i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function Ne(i){let a,n;return a=new os({props:{$$slots:{default:[Ce]},$$scope:{ctx:i}}}),{c(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p(s,p){const m={};p&2&&(m.$$scope={dirty:p,ctx:s}),a.$set(m)},i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function Be(i){let a,n;return a=new x({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRlbnNvckZsb3dCZW5jaG1hcmslMkMlMjBUZW5zb3JGbG93QmVuY2htYXJrQXJndW1lbnRzJTBBJTBBYXJncyUyMCUzRCUyMFRlbnNvckZsb3dCZW5jaG1hcmtBcmd1bWVudHMoJTBBJTIwJTIwJTIwJTIwbW9kZWxzJTNEJTVCJTIyYmVydC1iYXNlLXVuY2FzZWQlMjIlNUQlMkMlMjBiYXRjaF9zaXplcyUzRCU1QjglNUQlMkMlMjBzZXF1ZW5jZV9sZW5ndGhzJTNEJTVCOCUyQyUyMDMyJTJDJTIwMTI4JTJDJTIwNTEyJTVEJTBBKSUwQWJlbmNobWFyayUyMCUzRCUyMFRlbnNvckZsb3dCZW5jaG1hcmsoYXJncyk=",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;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(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p:S,i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function Ee(i){let a,n;return a=new os({props:{$$slots:{default:[Be]},$$scope:{ctx:i}}}),{c(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p(s,p){const m={};p&2&&(m.$$scope={dirty:p,ctx:s}),a.$set(m)},i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function Ze(i){let a,n,s,p="An instantiated benchmark object can then simply be run by calling <code>benchmark.run()</code>.",m,f,M;return a=new x({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGYmVuY2htYXJraW5nJTJGcnVuX2JlbmNobWFyay5weSUyMC0taGVscA==",highlighted:'python examples/pytorch/benchmarking/run_benchmark.py --<span class="hljs-built_in">help</span>',wrap:!1}}),f=new x({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                  
--------------------------------------------------------------------------------
bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.006</span>     
bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.006</span>     
bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.018</span>     
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 
--------------------------------------------------------------------------------
bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1227</span>
bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1281</span>
bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1307</span>
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(){j(a.$$.fragment),n=u(),s=h("p"),s.innerHTML=p,m=u(),j(f.$$.fragment)},l(c){d(a.$$.fragment,c),n=b(c),s=o(c,"P",{"data-svelte-h":!0}),_(s)!=="svelte-ersiz3"&&(s.innerHTML=p),m=b(c),d(f.$$.fragment,c)},m(c,v){g(a,c,v),r(c,n,v),r(c,s,v),r(c,m,v),g(f,c,v),M=!0},p:S,i(c){M||(y(a.$$.fragment,c),y(f.$$.fragment,c),M=!0)},o(c){$(a.$$.fragment,c),$(f.$$.fragment,c),M=!1},d(c){c&&(l(n),l(s),l(m)),w(a,c),w(f,c)}}}function Qe(i){let a,n;return a=new os({props:{$$slots:{default:[Ze]},$$scope:{ctx:i}}}),{c(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p(s,p){const m={};p&2&&(m.$$scope={dirty:p,ctx:s}),a.$set(m)},i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function ze(i){let a,n,s,p="An instantiated benchmark object can then simply be run by calling <code>benchmark.run()</code>.",m,f,M;return a=new x({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZ0ZW5zb3JmbG93JTJGYmVuY2htYXJraW5nJTJGcnVuX2JlbmNobWFya190Zi5weSUyMC0taGVscA==",highlighted:'python examples/tensorflow/benchmarking/run_benchmark_tf.py --<span class="hljs-built_in">help</span>',wrap:!1}}),f=new x({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                  
--------------------------------------------------------------------------------
bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">0.005</span>
bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">0.008</span>
bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">0.022</span>
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 
--------------------------------------------------------------------------------
bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">8</span>             <span class="hljs-number">1330</span>
bert-base-uncased          <span class="hljs-number">8</span>               <span class="hljs-number">32</span>            <span class="hljs-number">1330</span>
bert-base-uncased          <span class="hljs-number">8</span>              <span class="hljs-number">128</span>            <span class="hljs-number">1330</span>
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(){j(a.$$.fragment),n=u(),s=h("p"),s.innerHTML=p,m=u(),j(f.$$.fragment)},l(c){d(a.$$.fragment,c),n=b(c),s=o(c,"P",{"data-svelte-h":!0}),_(s)!=="svelte-ersiz3"&&(s.innerHTML=p),m=b(c),d(f.$$.fragment,c)},m(c,v){g(a,c,v),r(c,n,v),r(c,s,v),r(c,m,v),g(f,c,v),M=!0},p:S,i(c){M||(y(a.$$.fragment,c),y(f.$$.fragment,c),M=!0)},o(c){$(a.$$.fragment,c),$(f.$$.fragment,c),M=!1},d(c){c&&(l(n),l(s),l(m)),w(a,c),w(f,c)}}}function Fe(i){let a,n;return a=new os({props:{$$slots:{default:[ze]},$$scope:{ctx:i}}}),{c(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p(s,p){const m={};p&2&&(m.$$scope={dirty:p,ctx:s}),a.$set(m)},i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function We(i){let a,n;return a=new x({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(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p:S,i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function Re(i){let a,n;return a=new os({props:{$$slots:{default:[We]},$$scope:{ctx:i}}}),{c(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p(s,p){const m={};p&2&&(m.$$scope={dirty:p,ctx:s}),a.$set(m)},i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function xe(i){let a,n;return a=new x({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(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p:S,i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function Se(i){let a,n;return a=new os({props:{$$slots:{default:[xe]},$$scope:{ctx:i}}}),{c(){j(a.$$.fragment)},l(s){d(a.$$.fragment,s)},m(s,p){g(a,s,p),n=!0},p(s,p){const m={};p&2&&(m.$$scope={dirty:p,ctx:s}),a.$set(m)},i(s){n||(y(a.$$.fragment,s),n=!0)},o(s){$(a.$$.fragment,s),n=!1},d(s){w(a,s)}}}function Ie(i){let a,n,s,p,m,f,M,c,v,ps,Ds="Benchmarks",ys,B,$s,I,ws,X,Os="Let’s take a look at how 🤗 Transformers models can be benchmarked, best practices, and already available benchmarks.",_s,V,Ks='A notebook explaining in more detail how to benchmark 🤗 Transformers models can be found <a href="https://github.com/huggingface/notebooks/tree/main/examples/benchmark.ipynb" rel="nofollow">here</a>.',Ts,J,E,us,G,Ys,cs,se="How to benchmark 🤗 Transformers models",ks,L,ee="The classes <code>PyTorchBenchmark</code> and <code>TensorFlowBenchmark</code> allow to flexibly benchmark 🤗 Transformers models. The benchmark classes allow us to measure the <em>peak memory usage</em> and <em>required time</em> for both <em>inference</em> and <em>training</em>.",Ms,Z,vs,P,ae=`The benchmark classes <code>PyTorchBenchmark</code> and <code>TensorFlowBenchmark</code> expect an object of type <code>PyTorchBenchmarkArguments</code> and
<code>TensorFlowBenchmarkArguments</code>, respectively, for instantiation. <code>PyTorchBenchmarkArguments</code> and <code>TensorFlowBenchmarkArguments</code> are data classes and contain all relevant configurations for their corresponding benchmark class. In the following example, it is shown how a BERT model of type <em>bert-base-cased</em> can be benchmarked.`,Us,Q,Js,Y,ne=`Here, three arguments are given to the benchmark argument data classes, namely <code>models</code>, <code>batch_sizes</code>, and
<code>sequence_lengths</code>. The argument <code>models</code> is required and expects a <code>list</code> of model identifiers from the
<a href="https://huggingface.co/models" rel="nofollow">model hub</a> The <code>list</code> arguments <code>batch_sizes</code> and <code>sequence_lengths</code> define
the size of the <code>input_ids</code> on which the model is benchmarked. There are many more parameters that can be configured
via the benchmark argument data classes. For more detail on these one can either directly consult the files
<code>src/transformers/benchmark/benchmark_args_utils.py</code>, <code>src/transformers/benchmark/benchmark_args.py</code> (for PyTorch)
and <code>src/transformers/benchmark/benchmark_args_tf.py</code> (for Tensorflow). Alternatively, running the following shell
commands from root will print out a descriptive list of all configurable parameters for PyTorch and Tensorflow
respectively.`,Cs,z,Ns,A,le=`By default, the <em>time</em> and the <em>required memory</em> for <em>inference</em> are benchmarked. In the example output above the first
two sections show the result corresponding to <em>inference time</em> and <em>inference memory</em>. In addition, all relevant
information about the computing environment, <em>e.g.</em> the GPU type, the system, the library versions, etc… are printed
out in the third section under <em>ENVIRONMENT INFORMATION</em>. This information can optionally be saved in a <em>.csv</em> file
when adding the argument <code>save_to_csv=True</code> to <code>PyTorchBenchmarkArguments</code> and
<code>TensorFlowBenchmarkArguments</code> respectively. In this case, every section is saved in a separate
<em>.csv</em> file. The path to each <em>.csv</em> file can optionally be defined via the argument data classes.`,Bs,H,te=`Instead of benchmarking pre-trained models via their model identifier, <em>e.g.</em> <code>bert-base-uncased</code>, the user can
alternatively benchmark an arbitrary configuration of any available model class. In this case, a <code>list</code> of
configurations must be inserted with the benchmark args as follows.`,Es,F,Zs,q,re=`Again, <em>inference time</em> and <em>required memory</em> for <em>inference</em> are measured, but this time for customized configurations
of the <code>BertModel</code> class. This feature can especially be helpful when deciding for which configuration the model
should be trained.`,Qs,C,W,bs,D,As,ms,pe="Benchmark best practices",zs,O,ce="This section lists a couple of best practices one should be aware of when benchmarking a model.",Fs,K,me=`<li>Currently, only single device benchmarking is supported. When benchmarking on GPU, it is recommended that the user
specifies on which device the code should be run by setting the <code>CUDA_VISIBLE_DEVICES</code> environment variable in the
shell, <em>e.g.</em> <code>export CUDA_VISIBLE_DEVICES=0</code> before running the code.</li> <li>The option <code>no_multi_processing</code> should only be set to <code>True</code> for testing and debugging. To ensure accurate
memory measurement it is recommended to run each memory benchmark in a separate process by making sure
<code>no_multi_processing</code> is set to <code>True</code>.</li> <li>One should always state the environment information when sharing the results of a model benchmark. Results can vary
heavily between different GPU devices, library versions, etc., so that benchmark results on their own are not very
useful for the community.</li>`,Ws,N,R,is,ss,Hs,hs,he="Sharing your benchmark",Rs,es,oe=`Previously all available core models (10 at the time) have been benchmarked for <em>inference time</em>, across many different
settings: using PyTorch, with and without TorchScript, using TensorFlow, with and without XLA. All of those tests were
done across CPUs (except for TensorFlow XLA) and GPUs.`,xs,as,ue=`The approach is detailed in the <a href="https://medium.com/huggingface/benchmarking-transformers-pytorch-and-tensorflow-e2917fb891c2" rel="nofollow">following blogpost</a> and the results are
available <a href="https://docs.google.com/spreadsheets/d/1sryqufw2D0XlUH4sq3e9Wnxu5EAQkaohzrJbd5HdQ_w/edit?usp=sharing" rel="nofollow">here</a>.`,Ss,ns,be="With the new <em>benchmark</em> tools, it is easier than ever to share your benchmark results with the community",Is,ls,ie='<li><a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/benchmarking/README.md" rel="nofollow">PyTorch Benchmarking Results</a>.</li> <li><a href="https://github.com/huggingface/transformers/tree/main/examples/tensorflow/benchmarking/README.md" rel="nofollow">TensorFlow Benchmarking Results</a>.</li>',Xs,fs,Vs;return c=new Ps({}),B=new $e({props:{warning:!0,$$slots:{default:[Ue]},$$scope:{ctx:i}}}),I=new ve({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/en/benchmarks.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/benchmarks.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/benchmarks.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/benchmarks.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/benchmarks.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/benchmarks.ipynb"}]}}),G=new Ps({}),Z=new $e({props:{$$slots:{default:[Je]},$$scope:{ctx:i}}}),Q=new qs({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Ee],pytorch:[Ne]},$$scope:{ctx:i}}}),z=new qs({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Fe],pytorch:[Qe]},$$scope:{ctx:i}}}),F=new qs({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Se],pytorch:[Re]},$$scope:{ctx:i}}}),D=new Ps({}),ss=new Ps({}),{c(){a=h("meta"),n=u(),s=h("p"),p=u(),m=h("h1"),f=h("a"),M=h("span"),j(c.$$.fragment),v=u(),ps=h("span"),ps.textContent=Ds,ys=u(),j(B.$$.fragment),$s=u(),j(I.$$.fragment),ws=u(),X=h("p"),X.textContent=Os,_s=u(),V=h("p"),V.innerHTML=Ks,Ts=u(),J=h("h2"),E=h("a"),us=h("span"),j(G.$$.fragment),Ys=u(),cs=h("span"),cs.textContent=se,ks=u(),L=h("p"),L.innerHTML=ee,Ms=u(),j(Z.$$.fragment),vs=u(),P=h("p"),P.innerHTML=ae,Us=u(),j(Q.$$.fragment),Js=u(),Y=h("p"),Y.innerHTML=ne,Cs=u(),j(z.$$.fragment),Ns=u(),A=h("p"),A.innerHTML=le,Bs=u(),H=h("p"),H.innerHTML=te,Es=u(),j(F.$$.fragment),Zs=u(),q=h("p"),q.innerHTML=re,Qs=u(),C=h("h2"),W=h("a"),bs=h("span"),j(D.$$.fragment),As=u(),ms=h("span"),ms.textContent=pe,zs=u(),O=h("p"),O.textContent=ce,Fs=u(),K=h("ul"),K.innerHTML=me,Ws=u(),N=h("h2"),R=h("a"),is=h("span"),j(ss.$$.fragment),Hs=u(),hs=h("span"),hs.textContent=he,Rs=u(),es=h("p"),es.innerHTML=oe,xs=u(),as=h("p"),as.innerHTML=ue,Ss=u(),ns=h("p"),ns.innerHTML=be,Is=u(),ls=h("ul"),ls.innerHTML=ie,Xs=u(),fs=h("p"),this.h()},l(e){const t=Me("svelte-1phssyn",document.head);a=o(t,"META",{name:!0,content:!0}),t.forEach(l),n=b(e),s=o(e,"P",{}),U(s).forEach(l),p=b(e),m=o(e,"H1",{class:!0});var ts=U(m);f=o(ts,"A",{id:!0,class:!0,href:!0});var js=U(f);M=o(js,"SPAN",{});var ds=U(M);d(c.$$.fragment,ds),ds.forEach(l),js.forEach(l),v=b(ts),ps=o(ts,"SPAN",{"data-svelte-h":!0}),_(ps)!=="svelte-ruxki9"&&(ps.textContent=Ds),ts.forEach(l),ys=b(e),d(B.$$.fragment,e),$s=b(e),d(I.$$.fragment,e),ws=b(e),X=o(e,"P",{"data-svelte-h":!0}),_(X)!=="svelte-13lcah"&&(X.textContent=Os),_s=b(e),V=o(e,"P",{"data-svelte-h":!0}),_(V)!=="svelte-r2a0pt"&&(V.innerHTML=Ks),Ts=b(e),J=o(e,"H2",{class:!0});var rs=U(J);E=o(rs,"A",{id:!0,class:!0,href:!0});var gs=U(E);us=o(gs,"SPAN",{});var fe=U(us);d(G.$$.fragment,fe),fe.forEach(l),gs.forEach(l),Ys=b(rs),cs=o(rs,"SPAN",{"data-svelte-h":!0}),_(cs)!=="svelte-1kl12aa"&&(cs.textContent=se),rs.forEach(l),ks=b(e),L=o(e,"P",{"data-svelte-h":!0}),_(L)!=="svelte-1flsss8"&&(L.innerHTML=ee),Ms=b(e),d(Z.$$.fragment,e),vs=b(e),P=o(e,"P",{"data-svelte-h":!0}),_(P)!=="svelte-1ehry66"&&(P.innerHTML=ae),Us=b(e),d(Q.$$.fragment,e),Js=b(e),Y=o(e,"P",{"data-svelte-h":!0}),_(Y)!=="svelte-1eubt8z"&&(Y.innerHTML=ne),Cs=b(e),d(z.$$.fragment,e),Ns=b(e),A=o(e,"P",{"data-svelte-h":!0}),_(A)!=="svelte-44z1ex"&&(A.innerHTML=le),Bs=b(e),H=o(e,"P",{"data-svelte-h":!0}),_(H)!=="svelte-12amasz"&&(H.innerHTML=te),Es=b(e),d(F.$$.fragment,e),Zs=b(e),q=o(e,"P",{"data-svelte-h":!0}),_(q)!=="svelte-ztfcrc"&&(q.innerHTML=re),Qs=b(e),C=o(e,"H2",{class:!0});var Gs=U(C);W=o(Gs,"A",{id:!0,class:!0,href:!0});var je=U(W);bs=o(je,"SPAN",{});var de=U(bs);d(D.$$.fragment,de),de.forEach(l),je.forEach(l),As=b(Gs),ms=o(Gs,"SPAN",{"data-svelte-h":!0}),_(ms)!=="svelte-h1irm"&&(ms.textContent=pe),Gs.forEach(l),zs=b(e),O=o(e,"P",{"data-svelte-h":!0}),_(O)!=="svelte-c3uya"&&(O.textContent=ce),Fs=b(e),K=o(e,"UL",{"data-svelte-h":!0}),_(K)!=="svelte-119jn1b"&&(K.innerHTML=me),Ws=b(e),N=o(e,"H2",{class:!0});var Ls=U(N);R=o(Ls,"A",{id:!0,class:!0,href:!0});var ge=U(R);is=o(ge,"SPAN",{});var ye=U(is);d(ss.$$.fragment,ye),ye.forEach(l),ge.forEach(l),Hs=b(Ls),hs=o(Ls,"SPAN",{"data-svelte-h":!0}),_(hs)!=="svelte-18c8knd"&&(hs.textContent=he),Ls.forEach(l),Rs=b(e),es=o(e,"P",{"data-svelte-h":!0}),_(es)!=="svelte-wholqk"&&(es.innerHTML=oe),xs=b(e),as=o(e,"P",{"data-svelte-h":!0}),_(as)!=="svelte-mk4cui"&&(as.innerHTML=ue),Ss=b(e),ns=o(e,"P",{"data-svelte-h":!0}),_(ns)!=="svelte-15vqju9"&&(ns.innerHTML=be),Is=b(e),ls=o(e,"UL",{"data-svelte-h":!0}),_(ls)!=="svelte-1q9j466"&&(ls.innerHTML=ie),Xs=b(e),fs=o(e,"P",{}),U(fs).forEach(l),this.h()},h(){T(a,"name","hf:doc:metadata"),T(a,"content",JSON.stringify(Xe)),T(f,"id","benchmarks"),T(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),T(f,"href","#benchmarks"),T(m,"class","relative group"),T(E,"id","how-to-benchmark-transformers-models"),T(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),T(E,"href","#how-to-benchmark-transformers-models"),T(J,"class","relative group"),T(W,"id","benchmark-best-practices"),T(W,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),T(W,"href","#benchmark-best-practices"),T(C,"class","relative group"),T(R,"id","sharing-your-benchmark"),T(R,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),T(R,"href","#sharing-your-benchmark"),T(N,"class","relative group")},m(e,t){k(document.head,a),r(e,n,t),r(e,s,t),r(e,p,t),r(e,m,t),k(m,f),k(f,M),g(c,M,null),k(m,v),k(m,ps),r(e,ys,t),g(B,e,t),r(e,$s,t),g(I,e,t),r(e,ws,t),r(e,X,t),r(e,_s,t),r(e,V,t),r(e,Ts,t),r(e,J,t),k(J,E),k(E,us),g(G,us,null),k(J,Ys),k(J,cs),r(e,ks,t),r(e,L,t),r(e,Ms,t),g(Z,e,t),r(e,vs,t),r(e,P,t),r(e,Us,t),g(Q,e,t),r(e,Js,t),r(e,Y,t),r(e,Cs,t),g(z,e,t),r(e,Ns,t),r(e,A,t),r(e,Bs,t),r(e,H,t),r(e,Es,t),g(F,e,t),r(e,Zs,t),r(e,q,t),r(e,Qs,t),r(e,C,t),k(C,W),k(W,bs),g(D,bs,null),k(C,As),k(C,ms),r(e,zs,t),r(e,O,t),r(e,Fs,t),r(e,K,t),r(e,Ws,t),r(e,N,t),k(N,R),k(R,is),g(ss,is,null),k(N,Hs),k(N,hs),r(e,Rs,t),r(e,es,t),r(e,xs,t),r(e,as,t),r(e,Ss,t),r(e,ns,t),r(e,Is,t),r(e,ls,t),r(e,Xs,t),r(e,fs,t),Vs=!0},p(e,[t]){const ts={};t&2&&(ts.$$scope={dirty:t,ctx:e}),B.$set(ts);const js={};t&2&&(js.$$scope={dirty:t,ctx:e}),Z.$set(js);const ds={};t&2&&(ds.$$scope={dirty:t,ctx:e}),Q.$set(ds);const rs={};t&2&&(rs.$$scope={dirty:t,ctx:e}),z.$set(rs);const gs={};t&2&&(gs.$$scope={dirty:t,ctx:e}),F.$set(gs)},i(e){Vs||(y(c.$$.fragment,e),y(B.$$.fragment,e),y(I.$$.fragment,e),y(G.$$.fragment,e),y(Z.$$.fragment,e),y(Q.$$.fragment,e),y(z.$$.fragment,e),y(F.$$.fragment,e),y(D.$$.fragment,e),y(ss.$$.fragment,e),Vs=!0)},o(e){$(c.$$.fragment,e),$(B.$$.fragment,e),$(I.$$.fragment,e),$(G.$$.fragment,e),$(Z.$$.fragment,e),$(Q.$$.fragment,e),$(z.$$.fragment,e),$(F.$$.fragment,e),$(D.$$.fragment,e),$(ss.$$.fragment,e),Vs=!1},d(e){e&&(l(n),l(s),l(p),l(m),l(ys),l($s),l(ws),l(X),l(_s),l(V),l(Ts),l(J),l(ks),l(L),l(Ms),l(vs),l(P),l(Us),l(Js),l(Y),l(Cs),l(Ns),l(A),l(Bs),l(H),l(Es),l(Zs),l(q),l(Qs),l(C),l(zs),l(O),l(Fs),l(K),l(Ws),l(N),l(Rs),l(es),l(xs),l(as),l(Ss),l(ns),l(Is),l(ls),l(Xs),l(fs)),l(a),w(c),w(B,e),w(I,e),w(G),w(Z,e),w(Q,e),w(z,e),w(F,e),w(D),w(ss)}}}const Xe={local:"benchmarks",sections:[{local:"how-to-benchmark-transformers-models",title:"How to benchmark 🤗 Transformers models"},{local:"benchmark-best-practices",title:"Benchmark best practices"},{local:"sharing-your-benchmark",title:"Sharing your benchmark"}],title:"Benchmarks"};function Ve(i){return _e(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class De extends Te{constructor(a){super(),ke(this,a,Ve,Ie,we,{})}}export{De as component};
