import{S as wt,i as kt,s as $t,e as o,k as d,w as T,t as l,M as vt,c,d as a,m as j,a as p,x as M,h as r,b as _,G as s,g as b,y as U,q as J,o as B,B as C,v as Et,L as Us}from"../chunks/vendor-hf-doc-builder.js";import{T as _t}from"../chunks/Tip-hf-doc-builder.js";import{I as da}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as hs}from"../chunks/CodeBlock-hf-doc-builder.js";import{D as Tt}from"../chunks/DocNotebookDropdown-hf-doc-builder.js";import{F as ar,M as Js}from"../chunks/Markdown-hf-doc-builder.js";function Mt(v){let t,m;return{c(){t=o("p"),m=l(`Hugging Face\u2019s Benchmarking tools are deprecated and it is advised to use external Benchmarking libraries to measure the speed
and memory complexity of Transformer models.`)},l(n){t=c(n,"P",{});var h=p(t);m=r(h,`Hugging Face\u2019s Benchmarking tools are deprecated and it is advised to use external Benchmarking libraries to measure the speed
and memory complexity of Transformer models.`),h.forEach(a)},m(n,h){b(n,t,h),s(t,m)},d(n){n&&a(t)}}}function Ut(v){let t,m,n,h,f,F,W,Q;return{c(){t=o("p"),m=l("Hereby, "),n=o("em"),h=l("inference"),f=l(" is defined by a single forward pass, and "),F=o("em"),W=l("training"),Q=l(` is defined by a single forward pass and
backward pass.`)},l(E){t=c(E,"P",{});var N=p(t);m=r(N,"Hereby, "),n=c(N,"EM",{});var i=p(n);h=r(i,"inference"),i.forEach(a),f=r(N," is defined by a single forward pass, and "),F=c(N,"EM",{});var w=p(F);W=r(w,"training"),w.forEach(a),Q=r(N,` is defined by a single forward pass and
backward pass.`),N.forEach(a)},m(E,N){b(E,t,N),s(t,m),s(t,n),s(n,h),s(t,f),s(t,F),s(F,W),s(t,Q)},d(E){E&&a(t)}}}function Jt(v){let t,m;return t=new hs({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)`}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p:Us,i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function Bt(v){let t,m;return t=new Js({props:{$$slots:{default:[Jt]},$$scope:{ctx:v}}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p(n,h){const f={};h&2&&(f.$$scope={dirty:h,ctx:n}),t.$set(f)},i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function Ct(v){let t,m;return t=new hs({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)`}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p:Us,i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function Nt(v){let t,m;return t=new Js({props:{$$slots:{default:[Ct]},$$scope:{ctx:v}}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p(n,h){const f={};h&2&&(f.$$scope={dirty:h,ctx:n}),t.$set(f)},i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function Ft(v){let t,m,n,h,f,F,W,Q,E,N;return t=new hs({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZweXRvcmNoJTJGYmVuY2htYXJraW5nJTJGcnVuX2JlbmNobWFyay5weSUyMC0taGVscA==",highlighted:'python examples/pytorch/benchmarking/run_benchmark.py --<span class="hljs-built_in">help</span>'}}),E=new hs({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>`}}),{c(){T(t.$$.fragment),m=d(),n=o("p"),h=l("An instantiated benchmark object can then simply be run by calling "),f=o("code"),F=l("benchmark.run()"),W=l("."),Q=d(),T(E.$$.fragment)},l(i){M(t.$$.fragment,i),m=j(i),n=c(i,"P",{});var w=p(n);h=r(w,"An instantiated benchmark object can then simply be run by calling "),f=c(w,"CODE",{});var A=p(f);F=r(A,"benchmark.run()"),A.forEach(a),W=r(w,"."),w.forEach(a),Q=j(i),M(E.$$.fragment,i)},m(i,w){U(t,i,w),b(i,m,w),b(i,n,w),s(n,h),s(n,f),s(f,F),s(n,W),b(i,Q,w),U(E,i,w),N=!0},p:Us,i(i){N||(J(t.$$.fragment,i),J(E.$$.fragment,i),N=!0)},o(i){B(t.$$.fragment,i),B(E.$$.fragment,i),N=!1},d(i){C(t,i),i&&a(m),i&&a(n),i&&a(Q),C(E,i)}}}function Zt(v){let t,m;return t=new Js({props:{$$slots:{default:[Ft]},$$scope:{ctx:v}}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p(n,h){const f={};h&2&&(f.$$scope={dirty:h,ctx:n}),t.$set(f)},i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function Qt(v){let t,m,n,h,f,F,W,Q,E,N;return t=new hs({props:{code:"cHl0aG9uJTIwZXhhbXBsZXMlMkZ0ZW5zb3JmbG93JTJGYmVuY2htYXJraW5nJTJGcnVuX2JlbmNobWFya190Zi5weSUyMC0taGVscA==",highlighted:'python examples/tensorflow/benchmarking/run_benchmark_tf.py --<span class="hljs-built_in">help</span>'}}),E=new hs({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>`}}),{c(){T(t.$$.fragment),m=d(),n=o("p"),h=l("An instantiated benchmark object can then simply be run by calling "),f=o("code"),F=l("benchmark.run()"),W=l("."),Q=d(),T(E.$$.fragment)},l(i){M(t.$$.fragment,i),m=j(i),n=c(i,"P",{});var w=p(n);h=r(w,"An instantiated benchmark object can then simply be run by calling "),f=c(w,"CODE",{});var A=p(f);F=r(A,"benchmark.run()"),A.forEach(a),W=r(w,"."),w.forEach(a),Q=j(i),M(E.$$.fragment,i)},m(i,w){U(t,i,w),b(i,m,w),b(i,n,w),s(n,h),s(n,f),s(f,F),s(n,W),b(i,Q,w),U(E,i,w),N=!0},p:Us,i(i){N||(J(t.$$.fragment,i),J(E.$$.fragment,i),N=!0)},o(i){B(t.$$.fragment,i),B(E.$$.fragment,i),N=!1},d(i){C(t,i),i&&a(m),i&&a(n),i&&a(Q),C(E,i)}}}function Rt(v){let t,m;return t=new Js({props:{$$slots:{default:[Qt]},$$scope:{ctx:v}}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p(n,h){const f={};h&2&&(f.$$scope={dirty:h,ctx:n}),t.$set(f)},i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function It(v){let t,m;return t=new hs({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>`}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p:Us,i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function Wt(v){let t,m;return t=new Js({props:{$$slots:{default:[It]},$$scope:{ctx:v}}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p(n,h){const f={};h&2&&(f.$$scope={dirty:h,ctx:n}),t.$set(f)},i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function zt(v){let t,m;return t=new hs({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>`}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p:Us,i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function St(v){let t,m;return t=new Js({props:{$$slots:{default:[zt]},$$scope:{ctx:v}}}),{c(){T(t.$$.fragment)},l(n){M(t.$$.fragment,n)},m(n,h){U(t,n,h),m=!0},p(n,h){const f={};h&2&&(f.$$scope={dirty:h,ctx:n}),t.$set(f)},i(n){m||(J(t.$$.fragment,n),m=!0)},o(n){B(t.$$.fragment,n),m=!1},d(n){C(t,n)}}}function At(v){let t,m,n,h,f,F,W,Q,E,N,i,w,A,Ae,ks,ja,Xe,H,ga,us,ya,_a,Ve,x,K,Bs,is,wa,Cs,ka,Pe,R,$a,Ns,va,Ea,Fs,Ta,Ma,Zs,Ua,Ja,Qs,Ba,Ca,Rs,Na,Fa,Is,Za,Qa,De,ss,Ge,Z,Ra,Ws,Ia,Wa,zs,za,Sa,Ss,Aa,Xa,As,Va,Pa,Xs,Da,Ga,Vs,Oa,Ya,Ps,xa,qa,Oe,es,Ye,g,La,Ds,Ha,Ka,Gs,sn,en,Os,an,nn,Ys,ln,rn,xs,tn,on,bs,cn,pn,qs,mn,hn,Ls,un,bn,Hs,fn,dn,Ks,jn,gn,se,yn,_n,ee,wn,kn,ae,$n,vn,xe,as,qe,y,En,ne,Tn,Mn,le,Un,Jn,re,Bn,Cn,te,Nn,Fn,oe,Zn,Qn,ce,Rn,In,pe,Wn,zn,me,Sn,An,he,Xn,Vn,ue,Pn,Dn,ie,Gn,On,be,Yn,xn,fe,qn,Ln,Le,V,Hn,de,Kn,sl,je,el,al,ge,nl,ll,He,ns,Ke,z,rl,ye,tl,ol,_e,cl,pl,we,ml,hl,ke,ul,il,sa,q,ls,$e,fs,bl,ve,fl,ea,$s,dl,aa,D,P,jl,Ee,gl,yl,Te,_l,wl,Me,kl,$l,vl,X,El,Ue,Tl,Ml,Je,Ul,Jl,Be,Bl,Cl,Ce,Nl,Fl,Zl,Ne,Ql,na,L,rs,Fe,ds,Rl,Ze,Il,la,ts,Wl,Qe,zl,Sl,ra,G,Al,js,Xl,Vl,gs,Pl,Dl,ta,os,Gl,Re,Ol,Yl,oa,cs,vs,ys,xl,ql,Ll,Es,_s,Hl,Kl,ca;return F=new da({}),i=new _t({props:{warning:!0,$$slots:{default:[Mt]},$$scope:{ctx:v}}}),A=new Tt({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"}]}}),is=new da({}),ss=new _t({props:{$$slots:{default:[Ut]},$$scope:{ctx:v}}}),es=new ar({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Nt],pytorch:[Bt]},$$scope:{ctx:v}}}),as=new ar({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Rt],pytorch:[Zt]},$$scope:{ctx:v}}}),ns=new ar({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[St],pytorch:[Wt]},$$scope:{ctx:v}}}),fs=new da({}),ds=new da({}),{c(){t=o("meta"),m=d(),n=o("h1"),h=o("a"),f=o("span"),T(F.$$.fragment),W=d(),Q=o("span"),E=l("Benchmarks"),N=d(),T(i.$$.fragment),w=d(),T(A.$$.fragment),Ae=d(),ks=o("p"),ja=l("Let\u2019s take a look at how \u{1F917} Transformers models can be benchmarked, best practices, and already available benchmarks."),Xe=d(),H=o("p"),ga=l("A notebook explaining in more detail how to benchmark \u{1F917} Transformers models can be found "),us=o("a"),ya=l("here"),_a=l("."),Ve=d(),x=o("h2"),K=o("a"),Bs=o("span"),T(is.$$.fragment),wa=d(),Cs=o("span"),ka=l("How to benchmark \u{1F917} Transformers models"),Pe=d(),R=o("p"),$a=l("The classes "),Ns=o("code"),va=l("PyTorchBenchmark"),Ea=l(" and "),Fs=o("code"),Ta=l("TensorFlowBenchmark"),Ma=l(" allow to flexibly benchmark \u{1F917} Transformers models. The benchmark classes allow us to measure the "),Zs=o("em"),Ua=l("peak memory usage"),Ja=l(" and "),Qs=o("em"),Ba=l("required time"),Ca=l(" for both "),Rs=o("em"),Na=l("inference"),Fa=l(" and "),Is=o("em"),Za=l("training"),Qa=l("."),De=d(),T(ss.$$.fragment),Ge=d(),Z=o("p"),Ra=l("The benchmark classes "),Ws=o("code"),Ia=l("PyTorchBenchmark"),Wa=l(" and "),zs=o("code"),za=l("TensorFlowBenchmark"),Sa=l(" expect an object of type "),Ss=o("code"),Aa=l("PyTorchBenchmarkArguments"),Xa=l(` and
`),As=o("code"),Va=l("TensorFlowBenchmarkArguments"),Pa=l(", respectively, for instantiation. "),Xs=o("code"),Da=l("PyTorchBenchmarkArguments"),Ga=l(" and "),Vs=o("code"),Oa=l("TensorFlowBenchmarkArguments"),Ya=l(" 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 "),Ps=o("em"),xa=l("bert-base-cased"),qa=l(" can be benchmarked."),Oe=d(),T(es.$$.fragment),Ye=d(),g=o("p"),La=l("Here, three arguments are given to the benchmark argument data classes, namely "),Ds=o("code"),Ha=l("models"),Ka=l(", "),Gs=o("code"),sn=l("batch_sizes"),en=l(`, and
`),Os=o("code"),an=l("sequence_lengths"),nn=l(". The argument "),Ys=o("code"),ln=l("models"),rn=l(" is required and expects a "),xs=o("code"),tn=l("list"),on=l(` of model identifiers from the
`),bs=o("a"),cn=l("model hub"),pn=l(" The "),qs=o("code"),mn=l("list"),hn=l(" arguments "),Ls=o("code"),un=l("batch_sizes"),bn=l(" and "),Hs=o("code"),fn=l("sequence_lengths"),dn=l(` define
the size of the `),Ks=o("code"),jn=l("input_ids"),gn=l(` 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
`),se=o("code"),yn=l("src/transformers/benchmark/benchmark_args_utils.py"),_n=l(", "),ee=o("code"),wn=l("src/transformers/benchmark/benchmark_args.py"),kn=l(` (for PyTorch)
and `),ae=o("code"),$n=l("src/transformers/benchmark/benchmark_args_tf.py"),vn=l(` (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.`),xe=d(),T(as.$$.fragment),qe=d(),y=o("p"),En=l("By default, the "),ne=o("em"),Tn=l("time"),Mn=l(" and the "),le=o("em"),Un=l("required memory"),Jn=l(" for "),re=o("em"),Bn=l("inference"),Cn=l(` are benchmarked. In the example output above the first
two sections show the result corresponding to `),te=o("em"),Nn=l("inference time"),Fn=l(" and "),oe=o("em"),Zn=l("inference memory"),Qn=l(`. In addition, all relevant
information about the computing environment, `),ce=o("em"),Rn=l("e.g."),In=l(` the GPU type, the system, the library versions, etc\u2026 are printed
out in the third section under `),pe=o("em"),Wn=l("ENVIRONMENT INFORMATION"),zn=l(". This information can optionally be saved in a "),me=o("em"),Sn=l(".csv"),An=l(` file
when adding the argument `),he=o("code"),Xn=l("save_to_csv=True"),Vn=l(" to "),ue=o("code"),Pn=l("PyTorchBenchmarkArguments"),Dn=l(` and
`),ie=o("code"),Gn=l("TensorFlowBenchmarkArguments"),On=l(` respectively. In this case, every section is saved in a separate
`),be=o("em"),Yn=l(".csv"),xn=l(" file. The path to each "),fe=o("em"),qn=l(".csv"),Ln=l(" file can optionally be defined via the argument data classes."),Le=d(),V=o("p"),Hn=l("Instead of benchmarking pre-trained models via their model identifier, "),de=o("em"),Kn=l("e.g."),sl=d(),je=o("code"),el=l("bert-base-uncased"),al=l(`, the user can
alternatively benchmark an arbitrary configuration of any available model class. In this case, a `),ge=o("code"),nl=l("list"),ll=l(` of
configurations must be inserted with the benchmark args as follows.`),He=d(),T(ns.$$.fragment),Ke=d(),z=o("p"),rl=l("Again, "),ye=o("em"),tl=l("inference time"),ol=l(" and "),_e=o("em"),cl=l("required memory"),pl=l(" for "),we=o("em"),ml=l("inference"),hl=l(` are measured, but this time for customized configurations
of the `),ke=o("code"),ul=l("BertModel"),il=l(` class. This feature can especially be helpful when deciding for which configuration the model
should be trained.`),sa=d(),q=o("h2"),ls=o("a"),$e=o("span"),T(fs.$$.fragment),bl=d(),ve=o("span"),fl=l("Benchmark best practices"),ea=d(),$s=o("p"),dl=l("This section lists a couple of best practices one should be aware of when benchmarking a model."),aa=d(),D=o("ul"),P=o("li"),jl=l(`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 `),Ee=o("code"),gl=l("CUDA_VISIBLE_DEVICES"),yl=l(` environment variable in the
shell, `),Te=o("em"),_l=l("e.g."),wl=d(),Me=o("code"),kl=l("export CUDA_VISIBLE_DEVICES=0"),$l=l(" before running the code."),vl=d(),X=o("li"),El=l("The option "),Ue=o("code"),Tl=l("no_multi_processing"),Ml=l(" should only be set to "),Je=o("code"),Ul=l("True"),Jl=l(` for testing and debugging. To ensure accurate
memory measurement it is recommended to run each memory benchmark in a separate process by making sure
`),Be=o("code"),Bl=l("no_multi_processing"),Cl=l(" is set to "),Ce=o("code"),Nl=l("True"),Fl=l("."),Zl=d(),Ne=o("li"),Ql=l(`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.`),na=d(),L=o("h2"),rs=o("a"),Fe=o("span"),T(ds.$$.fragment),Rl=d(),Ze=o("span"),Il=l("Sharing your benchmark"),la=d(),ts=o("p"),Wl=l("Previously all available core models (10 at the time) have been benchmarked for "),Qe=o("em"),zl=l("inference time"),Sl=l(`, 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.`),ra=d(),G=o("p"),Al=l("The approach is detailed in the "),js=o("a"),Xl=l("following blogpost"),Vl=l(` and the results are
available `),gs=o("a"),Pl=l("here"),Dl=l("."),ta=d(),os=o("p"),Gl=l("With the new "),Re=o("em"),Ol=l("benchmark"),Yl=l(" tools, it is easier than ever to share your benchmark results with the community"),oa=d(),cs=o("ul"),vs=o("li"),ys=o("a"),xl=l("PyTorch Benchmarking Results"),ql=l("."),Ll=d(),Es=o("li"),_s=o("a"),Hl=l("TensorFlow Benchmarking Results"),Kl=l("."),this.h()},l(e){const u=vt('[data-svelte="svelte-1phssyn"]',document.head);t=c(u,"META",{name:!0,content:!0}),u.forEach(a),m=j(e),n=c(e,"H1",{class:!0});var ws=p(n);h=c(ws,"A",{id:!0,class:!0,href:!0});var Ie=p(h);f=c(Ie,"SPAN",{});var We=p(f);M(F.$$.fragment,We),We.forEach(a),Ie.forEach(a),W=j(ws),Q=c(ws,"SPAN",{});var ze=p(Q);E=r(ze,"Benchmarks"),ze.forEach(a),ws.forEach(a),N=j(e),M(i.$$.fragment,e),w=j(e),M(A.$$.fragment,e),Ae=j(e),ks=c(e,"P",{});var Se=p(ks);ja=r(Se,"Let\u2019s take a look at how \u{1F917} Transformers models can be benchmarked, best practices, and already available benchmarks."),Se.forEach(a),Xe=j(e),H=c(e,"P",{});var pa=p(H);ga=r(pa,"A notebook explaining in more detail how to benchmark \u{1F917} Transformers models can be found "),us=c(pa,"A",{href:!0,rel:!0});var nr=p(us);ya=r(nr,"here"),nr.forEach(a),_a=r(pa,"."),pa.forEach(a),Ve=j(e),x=c(e,"H2",{class:!0});var ma=p(x);K=c(ma,"A",{id:!0,class:!0,href:!0});var lr=p(K);Bs=c(lr,"SPAN",{});var rr=p(Bs);M(is.$$.fragment,rr),rr.forEach(a),lr.forEach(a),wa=j(ma),Cs=c(ma,"SPAN",{});var tr=p(Cs);ka=r(tr,"How to benchmark \u{1F917} Transformers models"),tr.forEach(a),ma.forEach(a),Pe=j(e),R=c(e,"P",{});var S=p(R);$a=r(S,"The classes "),Ns=c(S,"CODE",{});var or=p(Ns);va=r(or,"PyTorchBenchmark"),or.forEach(a),Ea=r(S," and "),Fs=c(S,"CODE",{});var cr=p(Fs);Ta=r(cr,"TensorFlowBenchmark"),cr.forEach(a),Ma=r(S," allow to flexibly benchmark \u{1F917} Transformers models. The benchmark classes allow us to measure the "),Zs=c(S,"EM",{});var pr=p(Zs);Ua=r(pr,"peak memory usage"),pr.forEach(a),Ja=r(S," and "),Qs=c(S,"EM",{});var mr=p(Qs);Ba=r(mr,"required time"),mr.forEach(a),Ca=r(S," for both "),Rs=c(S,"EM",{});var hr=p(Rs);Na=r(hr,"inference"),hr.forEach(a),Fa=r(S," and "),Is=c(S,"EM",{});var ur=p(Is);Za=r(ur,"training"),ur.forEach(a),Qa=r(S,"."),S.forEach(a),De=j(e),M(ss.$$.fragment,e),Ge=j(e),Z=c(e,"P",{});var I=p(Z);Ra=r(I,"The benchmark classes "),Ws=c(I,"CODE",{});var ir=p(Ws);Ia=r(ir,"PyTorchBenchmark"),ir.forEach(a),Wa=r(I," and "),zs=c(I,"CODE",{});var br=p(zs);za=r(br,"TensorFlowBenchmark"),br.forEach(a),Sa=r(I," expect an object of type "),Ss=c(I,"CODE",{});var fr=p(Ss);Aa=r(fr,"PyTorchBenchmarkArguments"),fr.forEach(a),Xa=r(I,` and
`),As=c(I,"CODE",{});var dr=p(As);Va=r(dr,"TensorFlowBenchmarkArguments"),dr.forEach(a),Pa=r(I,", respectively, for instantiation. "),Xs=c(I,"CODE",{});var jr=p(Xs);Da=r(jr,"PyTorchBenchmarkArguments"),jr.forEach(a),Ga=r(I," and "),Vs=c(I,"CODE",{});var gr=p(Vs);Oa=r(gr,"TensorFlowBenchmarkArguments"),gr.forEach(a),Ya=r(I," 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 "),Ps=c(I,"EM",{});var yr=p(Ps);xa=r(yr,"bert-base-cased"),yr.forEach(a),qa=r(I," can be benchmarked."),I.forEach(a),Oe=j(e),M(es.$$.fragment,e),Ye=j(e),g=c(e,"P",{});var k=p(g);La=r(k,"Here, three arguments are given to the benchmark argument data classes, namely "),Ds=c(k,"CODE",{});var _r=p(Ds);Ha=r(_r,"models"),_r.forEach(a),Ka=r(k,", "),Gs=c(k,"CODE",{});var wr=p(Gs);sn=r(wr,"batch_sizes"),wr.forEach(a),en=r(k,`, and
`),Os=c(k,"CODE",{});var kr=p(Os);an=r(kr,"sequence_lengths"),kr.forEach(a),nn=r(k,". The argument "),Ys=c(k,"CODE",{});var $r=p(Ys);ln=r($r,"models"),$r.forEach(a),rn=r(k," is required and expects a "),xs=c(k,"CODE",{});var vr=p(xs);tn=r(vr,"list"),vr.forEach(a),on=r(k,` of model identifiers from the
`),bs=c(k,"A",{href:!0,rel:!0});var Er=p(bs);cn=r(Er,"model hub"),Er.forEach(a),pn=r(k," The "),qs=c(k,"CODE",{});var Tr=p(qs);mn=r(Tr,"list"),Tr.forEach(a),hn=r(k," arguments "),Ls=c(k,"CODE",{});var Mr=p(Ls);un=r(Mr,"batch_sizes"),Mr.forEach(a),bn=r(k," and "),Hs=c(k,"CODE",{});var Ur=p(Hs);fn=r(Ur,"sequence_lengths"),Ur.forEach(a),dn=r(k,` define
the size of the `),Ks=c(k,"CODE",{});var Jr=p(Ks);jn=r(Jr,"input_ids"),Jr.forEach(a),gn=r(k,` 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
`),se=c(k,"CODE",{});var Br=p(se);yn=r(Br,"src/transformers/benchmark/benchmark_args_utils.py"),Br.forEach(a),_n=r(k,", "),ee=c(k,"CODE",{});var Cr=p(ee);wn=r(Cr,"src/transformers/benchmark/benchmark_args.py"),Cr.forEach(a),kn=r(k,` (for PyTorch)
and `),ae=c(k,"CODE",{});var Nr=p(ae);$n=r(Nr,"src/transformers/benchmark/benchmark_args_tf.py"),Nr.forEach(a),vn=r(k,` (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.`),k.forEach(a),xe=j(e),M(as.$$.fragment,e),qe=j(e),y=c(e,"P",{});var $=p(y);En=r($,"By default, the "),ne=c($,"EM",{});var Fr=p(ne);Tn=r(Fr,"time"),Fr.forEach(a),Mn=r($," and the "),le=c($,"EM",{});var Zr=p(le);Un=r(Zr,"required memory"),Zr.forEach(a),Jn=r($," for "),re=c($,"EM",{});var Qr=p(re);Bn=r(Qr,"inference"),Qr.forEach(a),Cn=r($,` are benchmarked. In the example output above the first
two sections show the result corresponding to `),te=c($,"EM",{});var Rr=p(te);Nn=r(Rr,"inference time"),Rr.forEach(a),Fn=r($," and "),oe=c($,"EM",{});var Ir=p(oe);Zn=r(Ir,"inference memory"),Ir.forEach(a),Qn=r($,`. In addition, all relevant
information about the computing environment, `),ce=c($,"EM",{});var Wr=p(ce);Rn=r(Wr,"e.g."),Wr.forEach(a),In=r($,` the GPU type, the system, the library versions, etc\u2026 are printed
out in the third section under `),pe=c($,"EM",{});var zr=p(pe);Wn=r(zr,"ENVIRONMENT INFORMATION"),zr.forEach(a),zn=r($,". This information can optionally be saved in a "),me=c($,"EM",{});var Sr=p(me);Sn=r(Sr,".csv"),Sr.forEach(a),An=r($,` file
when adding the argument `),he=c($,"CODE",{});var Ar=p(he);Xn=r(Ar,"save_to_csv=True"),Ar.forEach(a),Vn=r($," to "),ue=c($,"CODE",{});var Xr=p(ue);Pn=r(Xr,"PyTorchBenchmarkArguments"),Xr.forEach(a),Dn=r($,` and
`),ie=c($,"CODE",{});var Vr=p(ie);Gn=r(Vr,"TensorFlowBenchmarkArguments"),Vr.forEach(a),On=r($,` respectively. In this case, every section is saved in a separate
`),be=c($,"EM",{});var Pr=p(be);Yn=r(Pr,".csv"),Pr.forEach(a),xn=r($," file. The path to each "),fe=c($,"EM",{});var Dr=p(fe);qn=r(Dr,".csv"),Dr.forEach(a),Ln=r($," file can optionally be defined via the argument data classes."),$.forEach(a),Le=j(e),V=c(e,"P",{});var ps=p(V);Hn=r(ps,"Instead of benchmarking pre-trained models via their model identifier, "),de=c(ps,"EM",{});var Gr=p(de);Kn=r(Gr,"e.g."),Gr.forEach(a),sl=j(ps),je=c(ps,"CODE",{});var Or=p(je);el=r(Or,"bert-base-uncased"),Or.forEach(a),al=r(ps,`, the user can
alternatively benchmark an arbitrary configuration of any available model class. In this case, a `),ge=c(ps,"CODE",{});var Yr=p(ge);nl=r(Yr,"list"),Yr.forEach(a),ll=r(ps,` of
configurations must be inserted with the benchmark args as follows.`),ps.forEach(a),He=j(e),M(ns.$$.fragment,e),Ke=j(e),z=c(e,"P",{});var O=p(z);rl=r(O,"Again, "),ye=c(O,"EM",{});var xr=p(ye);tl=r(xr,"inference time"),xr.forEach(a),ol=r(O," and "),_e=c(O,"EM",{});var qr=p(_e);cl=r(qr,"required memory"),qr.forEach(a),pl=r(O," for "),we=c(O,"EM",{});var Lr=p(we);ml=r(Lr,"inference"),Lr.forEach(a),hl=r(O,` are measured, but this time for customized configurations
of the `),ke=c(O,"CODE",{});var Hr=p(ke);ul=r(Hr,"BertModel"),Hr.forEach(a),il=r(O,` class. This feature can especially be helpful when deciding for which configuration the model
should be trained.`),O.forEach(a),sa=j(e),q=c(e,"H2",{class:!0});var ha=p(q);ls=c(ha,"A",{id:!0,class:!0,href:!0});var Kr=p(ls);$e=c(Kr,"SPAN",{});var st=p($e);M(fs.$$.fragment,st),st.forEach(a),Kr.forEach(a),bl=j(ha),ve=c(ha,"SPAN",{});var et=p(ve);fl=r(et,"Benchmark best practices"),et.forEach(a),ha.forEach(a),ea=j(e),$s=c(e,"P",{});var at=p($s);dl=r(at,"This section lists a couple of best practices one should be aware of when benchmarking a model."),at.forEach(a),aa=j(e),D=c(e,"UL",{});var Ts=p(D);P=c(Ts,"LI",{});var ms=p(P);jl=r(ms,`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 `),Ee=c(ms,"CODE",{});var nt=p(Ee);gl=r(nt,"CUDA_VISIBLE_DEVICES"),nt.forEach(a),yl=r(ms,` environment variable in the
shell, `),Te=c(ms,"EM",{});var lt=p(Te);_l=r(lt,"e.g."),lt.forEach(a),wl=j(ms),Me=c(ms,"CODE",{});var rt=p(Me);kl=r(rt,"export CUDA_VISIBLE_DEVICES=0"),rt.forEach(a),$l=r(ms," before running the code."),ms.forEach(a),vl=j(Ts),X=c(Ts,"LI",{});var Y=p(X);El=r(Y,"The option "),Ue=c(Y,"CODE",{});var tt=p(Ue);Tl=r(tt,"no_multi_processing"),tt.forEach(a),Ml=r(Y," should only be set to "),Je=c(Y,"CODE",{});var ot=p(Je);Ul=r(ot,"True"),ot.forEach(a),Jl=r(Y,` for testing and debugging. To ensure accurate
memory measurement it is recommended to run each memory benchmark in a separate process by making sure
`),Be=c(Y,"CODE",{});var ct=p(Be);Bl=r(ct,"no_multi_processing"),ct.forEach(a),Cl=r(Y," is set to "),Ce=c(Y,"CODE",{});var pt=p(Ce);Nl=r(pt,"True"),pt.forEach(a),Fl=r(Y,"."),Y.forEach(a),Zl=j(Ts),Ne=c(Ts,"LI",{});var mt=p(Ne);Ql=r(mt,`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.`),mt.forEach(a),Ts.forEach(a),na=j(e),L=c(e,"H2",{class:!0});var ua=p(L);rs=c(ua,"A",{id:!0,class:!0,href:!0});var ht=p(rs);Fe=c(ht,"SPAN",{});var ut=p(Fe);M(ds.$$.fragment,ut),ut.forEach(a),ht.forEach(a),Rl=j(ua),Ze=c(ua,"SPAN",{});var it=p(Ze);Il=r(it,"Sharing your benchmark"),it.forEach(a),ua.forEach(a),la=j(e),ts=c(e,"P",{});var ia=p(ts);Wl=r(ia,"Previously all available core models (10 at the time) have been benchmarked for "),Qe=c(ia,"EM",{});var bt=p(Qe);zl=r(bt,"inference time"),bt.forEach(a),Sl=r(ia,`, 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.`),ia.forEach(a),ra=j(e),G=c(e,"P",{});var Ms=p(G);Al=r(Ms,"The approach is detailed in the "),js=c(Ms,"A",{href:!0,rel:!0});var ft=p(js);Xl=r(ft,"following blogpost"),ft.forEach(a),Vl=r(Ms,` and the results are
available `),gs=c(Ms,"A",{href:!0,rel:!0});var dt=p(gs);Pl=r(dt,"here"),dt.forEach(a),Dl=r(Ms,"."),Ms.forEach(a),ta=j(e),os=c(e,"P",{});var ba=p(os);Gl=r(ba,"With the new "),Re=c(ba,"EM",{});var jt=p(Re);Ol=r(jt,"benchmark"),jt.forEach(a),Yl=r(ba," tools, it is easier than ever to share your benchmark results with the community"),ba.forEach(a),oa=j(e),cs=c(e,"UL",{});var fa=p(cs);vs=c(fa,"LI",{});var sr=p(vs);ys=c(sr,"A",{href:!0,rel:!0});var gt=p(ys);xl=r(gt,"PyTorch Benchmarking Results"),gt.forEach(a),ql=r(sr,"."),sr.forEach(a),Ll=j(fa),Es=c(fa,"LI",{});var er=p(Es);_s=c(er,"A",{href:!0,rel:!0});var yt=p(_s);Hl=r(yt,"TensorFlow Benchmarking Results"),yt.forEach(a),Kl=r(er,"."),er.forEach(a),fa.forEach(a),this.h()},h(){_(t,"name","hf:doc:metadata"),_(t,"content",JSON.stringify(Xt)),_(h,"id","benchmarks"),_(h,"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"),_(h,"href","#benchmarks"),_(n,"class","relative group"),_(us,"href","https://github.com/huggingface/notebooks/tree/main/examples/benchmark.ipynb"),_(us,"rel","nofollow"),_(K,"id","how-to-benchmark-transformers-models"),_(K,"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"),_(K,"href","#how-to-benchmark-transformers-models"),_(x,"class","relative group"),_(bs,"href","https://huggingface.co/models"),_(bs,"rel","nofollow"),_(ls,"id","benchmark-best-practices"),_(ls,"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"),_(ls,"href","#benchmark-best-practices"),_(q,"class","relative group"),_(rs,"id","sharing-your-benchmark"),_(rs,"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"),_(rs,"href","#sharing-your-benchmark"),_(L,"class","relative group"),_(js,"href","https://medium.com/huggingface/benchmarking-transformers-pytorch-and-tensorflow-e2917fb891c2"),_(js,"rel","nofollow"),_(gs,"href","https://docs.google.com/spreadsheets/d/1sryqufw2D0XlUH4sq3e9Wnxu5EAQkaohzrJbd5HdQ_w/edit?usp=sharing"),_(gs,"rel","nofollow"),_(ys,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/benchmarking/README.md"),_(ys,"rel","nofollow"),_(_s,"href","https://github.com/huggingface/transformers/tree/main/examples/tensorflow/benchmarking/README.md"),_(_s,"rel","nofollow")},m(e,u){s(document.head,t),b(e,m,u),b(e,n,u),s(n,h),s(h,f),U(F,f,null),s(n,W),s(n,Q),s(Q,E),b(e,N,u),U(i,e,u),b(e,w,u),U(A,e,u),b(e,Ae,u),b(e,ks,u),s(ks,ja),b(e,Xe,u),b(e,H,u),s(H,ga),s(H,us),s(us,ya),s(H,_a),b(e,Ve,u),b(e,x,u),s(x,K),s(K,Bs),U(is,Bs,null),s(x,wa),s(x,Cs),s(Cs,ka),b(e,Pe,u),b(e,R,u),s(R,$a),s(R,Ns),s(Ns,va),s(R,Ea),s(R,Fs),s(Fs,Ta),s(R,Ma),s(R,Zs),s(Zs,Ua),s(R,Ja),s(R,Qs),s(Qs,Ba),s(R,Ca),s(R,Rs),s(Rs,Na),s(R,Fa),s(R,Is),s(Is,Za),s(R,Qa),b(e,De,u),U(ss,e,u),b(e,Ge,u),b(e,Z,u),s(Z,Ra),s(Z,Ws),s(Ws,Ia),s(Z,Wa),s(Z,zs),s(zs,za),s(Z,Sa),s(Z,Ss),s(Ss,Aa),s(Z,Xa),s(Z,As),s(As,Va),s(Z,Pa),s(Z,Xs),s(Xs,Da),s(Z,Ga),s(Z,Vs),s(Vs,Oa),s(Z,Ya),s(Z,Ps),s(Ps,xa),s(Z,qa),b(e,Oe,u),U(es,e,u),b(e,Ye,u),b(e,g,u),s(g,La),s(g,Ds),s(Ds,Ha),s(g,Ka),s(g,Gs),s(Gs,sn),s(g,en),s(g,Os),s(Os,an),s(g,nn),s(g,Ys),s(Ys,ln),s(g,rn),s(g,xs),s(xs,tn),s(g,on),s(g,bs),s(bs,cn),s(g,pn),s(g,qs),s(qs,mn),s(g,hn),s(g,Ls),s(Ls,un),s(g,bn),s(g,Hs),s(Hs,fn),s(g,dn),s(g,Ks),s(Ks,jn),s(g,gn),s(g,se),s(se,yn),s(g,_n),s(g,ee),s(ee,wn),s(g,kn),s(g,ae),s(ae,$n),s(g,vn),b(e,xe,u),U(as,e,u),b(e,qe,u),b(e,y,u),s(y,En),s(y,ne),s(ne,Tn),s(y,Mn),s(y,le),s(le,Un),s(y,Jn),s(y,re),s(re,Bn),s(y,Cn),s(y,te),s(te,Nn),s(y,Fn),s(y,oe),s(oe,Zn),s(y,Qn),s(y,ce),s(ce,Rn),s(y,In),s(y,pe),s(pe,Wn),s(y,zn),s(y,me),s(me,Sn),s(y,An),s(y,he),s(he,Xn),s(y,Vn),s(y,ue),s(ue,Pn),s(y,Dn),s(y,ie),s(ie,Gn),s(y,On),s(y,be),s(be,Yn),s(y,xn),s(y,fe),s(fe,qn),s(y,Ln),b(e,Le,u),b(e,V,u),s(V,Hn),s(V,de),s(de,Kn),s(V,sl),s(V,je),s(je,el),s(V,al),s(V,ge),s(ge,nl),s(V,ll),b(e,He,u),U(ns,e,u),b(e,Ke,u),b(e,z,u),s(z,rl),s(z,ye),s(ye,tl),s(z,ol),s(z,_e),s(_e,cl),s(z,pl),s(z,we),s(we,ml),s(z,hl),s(z,ke),s(ke,ul),s(z,il),b(e,sa,u),b(e,q,u),s(q,ls),s(ls,$e),U(fs,$e,null),s(q,bl),s(q,ve),s(ve,fl),b(e,ea,u),b(e,$s,u),s($s,dl),b(e,aa,u),b(e,D,u),s(D,P),s(P,jl),s(P,Ee),s(Ee,gl),s(P,yl),s(P,Te),s(Te,_l),s(P,wl),s(P,Me),s(Me,kl),s(P,$l),s(D,vl),s(D,X),s(X,El),s(X,Ue),s(Ue,Tl),s(X,Ml),s(X,Je),s(Je,Ul),s(X,Jl),s(X,Be),s(Be,Bl),s(X,Cl),s(X,Ce),s(Ce,Nl),s(X,Fl),s(D,Zl),s(D,Ne),s(Ne,Ql),b(e,na,u),b(e,L,u),s(L,rs),s(rs,Fe),U(ds,Fe,null),s(L,Rl),s(L,Ze),s(Ze,Il),b(e,la,u),b(e,ts,u),s(ts,Wl),s(ts,Qe),s(Qe,zl),s(ts,Sl),b(e,ra,u),b(e,G,u),s(G,Al),s(G,js),s(js,Xl),s(G,Vl),s(G,gs),s(gs,Pl),s(G,Dl),b(e,ta,u),b(e,os,u),s(os,Gl),s(os,Re),s(Re,Ol),s(os,Yl),b(e,oa,u),b(e,cs,u),s(cs,vs),s(vs,ys),s(ys,xl),s(vs,ql),s(cs,Ll),s(cs,Es),s(Es,_s),s(_s,Hl),s(Es,Kl),ca=!0},p(e,[u]){const ws={};u&2&&(ws.$$scope={dirty:u,ctx:e}),i.$set(ws);const Ie={};u&2&&(Ie.$$scope={dirty:u,ctx:e}),ss.$set(Ie);const We={};u&2&&(We.$$scope={dirty:u,ctx:e}),es.$set(We);const ze={};u&2&&(ze.$$scope={dirty:u,ctx:e}),as.$set(ze);const Se={};u&2&&(Se.$$scope={dirty:u,ctx:e}),ns.$set(Se)},i(e){ca||(J(F.$$.fragment,e),J(i.$$.fragment,e),J(A.$$.fragment,e),J(is.$$.fragment,e),J(ss.$$.fragment,e),J(es.$$.fragment,e),J(as.$$.fragment,e),J(ns.$$.fragment,e),J(fs.$$.fragment,e),J(ds.$$.fragment,e),ca=!0)},o(e){B(F.$$.fragment,e),B(i.$$.fragment,e),B(A.$$.fragment,e),B(is.$$.fragment,e),B(ss.$$.fragment,e),B(es.$$.fragment,e),B(as.$$.fragment,e),B(ns.$$.fragment,e),B(fs.$$.fragment,e),B(ds.$$.fragment,e),ca=!1},d(e){a(t),e&&a(m),e&&a(n),C(F),e&&a(N),C(i,e),e&&a(w),C(A,e),e&&a(Ae),e&&a(ks),e&&a(Xe),e&&a(H),e&&a(Ve),e&&a(x),C(is),e&&a(Pe),e&&a(R),e&&a(De),C(ss,e),e&&a(Ge),e&&a(Z),e&&a(Oe),C(es,e),e&&a(Ye),e&&a(g),e&&a(xe),C(as,e),e&&a(qe),e&&a(y),e&&a(Le),e&&a(V),e&&a(He),C(ns,e),e&&a(Ke),e&&a(z),e&&a(sa),e&&a(q),C(fs),e&&a(ea),e&&a($s),e&&a(aa),e&&a(D),e&&a(na),e&&a(L),C(ds),e&&a(la),e&&a(ts),e&&a(ra),e&&a(G),e&&a(ta),e&&a(os),e&&a(oa),e&&a(cs)}}}const Xt={local:"benchmarks",sections:[{local:"how-to-benchmark-transformers-models",title:"How to benchmark \u{1F917} Transformers models"},{local:"benchmark-best-practices",title:"Benchmark best practices"},{local:"sharing-your-benchmark",title:"Sharing your benchmark"}],title:"Benchmarks"};function Vt(v){return Et(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qt extends wt{constructor(t){super();kt(this,t,Vt,At,$t,{})}}export{qt as default,Xt as metadata};
