import{s as rs,o as os,n as S}from"../chunks/scheduler.defa9a21.js";import{S as cs,i as is,g as m,s as j,r as U,A as Is,h as A,f as n,c as J,j as Us,u as T,x as u,k as Ts,y as Cs,a as y,v as r,d as o,t as c,w as i}from"../chunks/index.fe795e71.js";import{C as f}from"../chunks/CodeBlock.204b6c34.js";import{H as nl,E as ms}from"../chunks/getInferenceSnippets.2234a8dd.js";import{H as yl,a as d}from"../chunks/HfOption.3c290b0f.js";function As(I){let M,a;return M=new f({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaHZpc2lvbi5tb2RlbHMlMjBhcyUyMG1vZGVscyUwQWZyb20lMjB0b3JjaC5wcm9maWxlciUyMGltcG9ydCUyMHByb2ZpbGUlMkMlMjByZWNvcmRfZnVuY3Rpb24lMkMlMjBQcm9maWxlckFjdGl2aXR5JTBBJTBBbW9kZWwlMjAlM0QlMjBtb2RlbHMucmVzbmV0MTgoKSUwQWlucHV0cyUyMCUzRCUyMHRvcmNoLnJhbmRuKDUlMkMlMjAzJTJDJTIwMjI0JTJDJTIwMjI0KSUwQSUwQXdpdGglMjBwcm9maWxlKGFjdGl2aXRpZXMlM0QlNUJQcm9maWxlckFjdGl2aXR5LkNQVSU1RCUyQyUyMHJlY29yZF9zaGFwZXMlM0RUcnVlKSUyMGFzJTIwcHJvZiUzQSUwQSUyMCUyMCUyMCUyMG1vZGVsKGlucHV0cyklMEElMEFwcmludChwcm9mLmtleV9hdmVyYWdlcygpLnRhYmxlKHNvcnRfYnklM0QlMjJjcHVfdGltZV90b3RhbCUyMiUyQyUyMHJvd19saW1pdCUzRDEwKSk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> torchvision.models <span class="hljs-keyword">as</span> models
<span class="hljs-keyword">from</span> torch.profiler <span class="hljs-keyword">import</span> profile, record_function, ProfilerActivity

model = models.resnet18()
inputs = torch.randn(<span class="hljs-number">5</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>)

<span class="hljs-keyword">with</span> profile(activities=[ProfilerActivity.CPU], record_shapes=<span class="hljs-literal">True</span>) <span class="hljs-keyword">as</span> prof:
    model(inputs)

<span class="hljs-built_in">print</span>(prof.key_averages().table(sort_by=<span class="hljs-string">&quot;cpu_time_total&quot;</span>, row_limit=<span class="hljs-number">10</span>))`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function us(I){let M,a;return M=new f({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUyQyUyMFByb2ZpbGVLd2FyZ3MlMEFpbXBvcnQlMjB0b3JjaCUwQWltcG9ydCUyMHRvcmNodmlzaW9uLm1vZGVscyUyMGFzJTIwbW9kZWxzJTBBJTBBbW9kZWwlMjAlM0QlMjBtb2RlbHMucmVzbmV0MTgoKSUwQWlucHV0cyUyMCUzRCUyMHRvcmNoLnJhbmRuKDUlMkMlMjAzJTJDJTIwMjI0JTJDJTIwMjI0KSUwQSUwQXByb2ZpbGVfa3dhcmdzJTIwJTNEJTIwUHJvZmlsZUt3YXJncyglMEElMjAlMjAlMjAlMjBhY3Rpdml0aWVzJTNEJTVCJTIyY3B1JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwcmVjb3JkX3NoYXBlcyUzRFRydWUlMEEpJTBBJTBBYWNjZWxlcmF0b3IlMjAlM0QlMjBBY2NlbGVyYXRvcihjcHUlM0RUcnVlJTJDJTIwa3dhcmdzX2hhbmRsZXJzJTNEJTVCcHJvZmlsZV9rd2FyZ3MlNUQpJTBBbW9kZWwlMjAlM0QlMjBhY2NlbGVyYXRvci5wcmVwYXJlKG1vZGVsKSUwQSUwQXdpdGglMjBhY2NlbGVyYXRvci5wcm9maWxlKCklMjBhcyUyMHByb2YlM0ElMEElMjAlMjAlMjAlMjB3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbW9kZWwoaW5wdXRzKSUwQSUwQXByaW50KHByb2Yua2V5X2F2ZXJhZ2VzKCkudGFibGUoc29ydF9ieSUzRCUyMmNwdV90aW1lX3RvdGFsJTIyJTJDJTIwcm93X2xpbWl0JTNEMTApKQ==",highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator, ProfileKwargs
<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> torchvision.models <span class="hljs-keyword">as</span> models

model = models.resnet18()
inputs = torch.randn(<span class="hljs-number">5</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>)

profile_kwargs = ProfileKwargs(
    activities=[<span class="hljs-string">&quot;cpu&quot;</span>],
    record_shapes=<span class="hljs-literal">True</span>
)

accelerator = Accelerator(cpu=<span class="hljs-literal">True</span>, kwargs_handlers=[profile_kwargs])
model = accelerator.prepare(model)

<span class="hljs-keyword">with</span> accelerator.profile() <span class="hljs-keyword">as</span> prof:
    <span class="hljs-keyword">with</span> torch.no_grad():
        model(inputs)

<span class="hljs-built_in">print</span>(prof.key_averages().table(sort_by=<span class="hljs-string">&quot;cpu_time_total&quot;</span>, row_limit=<span class="hljs-number">10</span>))`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function hs(I){let M,a,s,w;return M=new d({props:{id:"cpu execution time",option:"PyTorch",$$slots:{default:[As]},$$scope:{ctx:I}}}),s=new d({props:{id:"cpu execution time",option:"Accelerate",$$slots:{default:[us]},$$scope:{ctx:I}}}),{c(){U(M.$$.fragment),a=j(),U(s.$$.fragment)},l(t){T(M.$$.fragment,t),a=J(t),T(s.$$.fragment,t)},m(t,p){r(M,t,p),y(t,a,p),r(s,t,p),w=!0},p(t,p){const C={};p&2&&(C.$$scope={dirty:p,ctx:t}),M.$set(C);const h={};p&2&&(h.$$scope={dirty:p,ctx:t}),s.$set(h)},i(t){w||(o(M.$$.fragment,t),o(s.$$.fragment,t),w=!0)},o(t){c(M.$$.fragment,t),c(s.$$.fragment,t),w=!1},d(t){t&&n(a),i(M,t),i(s,t)}}}function fs(I){let M,a;return M=new f({props:{code:"bW9kZWwlMjAlM0QlMjBtb2RlbHMucmVzbmV0MTgoKSUwQWlucHV0cyUyMCUzRCUyMHRvcmNoLnJhbmRuKDUlMkMlMjAzJTJDJTIwMjI0JTJDJTIwMjI0KSUwQSUwQXdpdGglMjBwcm9maWxlKGFjdGl2aXRpZXMlM0QlNUJQcm9maWxlckFjdGl2aXR5LkNQVSU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByb2ZpbGVfbWVtb3J5JTNEVHJ1ZSUyQyUyMHJlY29yZF9zaGFwZXMlM0RUcnVlKSUyMGFzJTIwcHJvZiUzQSUwQSUyMCUyMCUyMCUyMG1vZGVsKGlucHV0cyklMEElMEFwcmludChwcm9mLmtleV9hdmVyYWdlcygpLnRhYmxlKHNvcnRfYnklM0QlMjJzZWxmX2NwdV9tZW1vcnlfdXNhZ2UlMjIlMkMlMjByb3dfbGltaXQlM0QxMCkp",highlighted:`model = models.resnet18()
inputs = torch.randn(<span class="hljs-number">5</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>)

<span class="hljs-keyword">with</span> profile(activities=[ProfilerActivity.CPU],
        profile_memory=<span class="hljs-literal">True</span>, record_shapes=<span class="hljs-literal">True</span>) <span class="hljs-keyword">as</span> prof:
    model(inputs)

<span class="hljs-built_in">print</span>(prof.key_averages().table(sort_by=<span class="hljs-string">&quot;self_cpu_memory_usage&quot;</span>, row_limit=<span class="hljs-number">10</span>))`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function ds(I){let M,a;return M=new f({props:{code:"bW9kZWwlMjAlM0QlMjBtb2RlbHMucmVzbmV0MTgoKSUwQWlucHV0cyUyMCUzRCUyMHRvcmNoLnJhbmRuKDUlMkMlMjAzJTJDJTIwMjI0JTJDJTIwMjI0KSUwQSUwQXByb2ZpbGVfa3dhcmdzJTIwJTNEJTIwUHJvZmlsZUt3YXJncyglMEElMjAlMjAlMjAlMjBhY3Rpdml0aWVzJTNEJTVCJTIyY3B1JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwcHJvZmlsZV9tZW1vcnklM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwcmVjb3JkX3NoYXBlcyUzRFRydWUlMEEpJTBBJTBBYWNjZWxlcmF0b3IlMjAlM0QlMjBBY2NlbGVyYXRvcihjcHUlM0RUcnVlJTJDJTIwa3dhcmdzX2hhbmRsZXJzJTNEJTVCcHJvZmlsZV9rd2FyZ3MlNUQpJTBBbW9kZWwlMjAlM0QlMjBhY2NlbGVyYXRvci5wcmVwYXJlKG1vZGVsKSUwQSUwQXdpdGglMjBhY2NlbGVyYXRvci5wcm9maWxlKCklMjBhcyUyMHByb2YlM0ElMEElMjAlMjAlMjAlMjBtb2RlbChpbnB1dHMpJTBBJTBBcHJpbnQocHJvZi5rZXlfYXZlcmFnZXMoKS50YWJsZShzb3J0X2J5JTNEJTIyc2VsZl9jcHVfbWVtb3J5X3VzYWdlJTIyJTJDJTIwcm93X2xpbWl0JTNEMTApKQ==",highlighted:`model = models.resnet18()
inputs = torch.randn(<span class="hljs-number">5</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>)

profile_kwargs = ProfileKwargs(
    activities=[<span class="hljs-string">&quot;cpu&quot;</span>],
    profile_memory=<span class="hljs-literal">True</span>,
    record_shapes=<span class="hljs-literal">True</span>
)

accelerator = Accelerator(cpu=<span class="hljs-literal">True</span>, kwargs_handlers=[profile_kwargs])
model = accelerator.prepare(model)

<span class="hljs-keyword">with</span> accelerator.profile() <span class="hljs-keyword">as</span> prof:
    model(inputs)

<span class="hljs-built_in">print</span>(prof.key_averages().table(sort_by=<span class="hljs-string">&quot;self_cpu_memory_usage&quot;</span>, row_limit=<span class="hljs-number">10</span>))`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function Ss(I){let M,a,s,w;return M=new d({props:{id:"memory consumption",option:"PyTorch",$$slots:{default:[fs]},$$scope:{ctx:I}}}),s=new d({props:{id:"memory consumption",option:"Accelerate",$$slots:{default:[ds]},$$scope:{ctx:I}}}),{c(){U(M.$$.fragment),a=j(),U(s.$$.fragment)},l(t){T(M.$$.fragment,t),a=J(t),T(s.$$.fragment,t)},m(t,p){r(M,t,p),y(t,a,p),r(s,t,p),w=!0},p(t,p){const C={};p&2&&(C.$$scope={dirty:p,ctx:t}),M.$set(C);const h={};p&2&&(h.$$scope={dirty:p,ctx:t}),s.$set(h)},i(t){w||(o(M.$$.fragment,t),o(s.$$.fragment,t),w=!0)},o(t){c(M.$$.fragment,t),c(s.$$.fragment,t),w=!1},d(t){t&&n(a),i(M,t),i(s,t)}}}function bs(I){let M,a;return M=new f({props:{code:"bW9kZWwlMjAlM0QlMjBtb2RlbHMucmVzbmV0MTgoKS5jdWRhKCklMEFpbnB1dHMlMjAlM0QlMjB0b3JjaC5yYW5kbig1JTJDJTIwMyUyQyUyMDIyNCUyQyUyMDIyNCkuY3VkYSgpJTBBJTBBd2l0aCUyMHByb2ZpbGUoYWN0aXZpdGllcyUzRCU1QlByb2ZpbGVyQWN0aXZpdHkuQ1BVJTJDJTIwUHJvZmlsZXJBY3Rpdml0eS5DVURBJTVEKSUyMGFzJTIwcHJvZiUzQSUwQSUyMCUyMCUyMCUyMG1vZGVsKGlucHV0cyklMEElMEFwcm9mLmV4cG9ydF9jaHJvbWVfdHJhY2UoJTIydHJhY2UuanNvbiUyMik=",highlighted:`model = models.resnet18().cuda()
inputs = torch.randn(<span class="hljs-number">5</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>).cuda()

<span class="hljs-keyword">with</span> profile(activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA]) <span class="hljs-keyword">as</span> prof:
    model(inputs)

prof.export_chrome_trace(<span class="hljs-string">&quot;trace.json&quot;</span>)`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function $s(I){let M,a,s,w="For other hardware accelerators, e.g. XPU, you can change <code>cuda</code> to <code>xpu</code> in the above example code.",t;return M=new f({props:{code:"bW9kZWwlMjAlM0QlMjBtb2RlbHMucmVzbmV0MTgoKSUwQWlucHV0cyUyMCUzRCUyMHRvcmNoLnJhbmRuKDUlMkMlMjAzJTJDJTIwMjI0JTJDJTIwMjI0KS5jdWRhKCklMEFwcm9maWxlX2t3YXJncyUyMCUzRCUyMFByb2ZpbGVLd2FyZ3MoJTBBJTIwJTIwJTIwJTIwYWN0aXZpdGllcyUzRCU1QiUyMmNwdSUyMiUyQyUyMCUyMmN1ZGElMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBvdXRwdXRfdHJhY2VfZGlyJTNEJTIydHJhY2UlMjIlMEEpJTBBJTBBYWNjZWxlcmF0b3IlMjAlM0QlMjBBY2NlbGVyYXRvcihrd2FyZ3NfaGFuZGxlcnMlM0QlNUJwcm9maWxlX2t3YXJncyU1RCklMEFtb2RlbCUyMCUzRCUyMGFjY2VsZXJhdG9yLnByZXBhcmUobW9kZWwpJTBBJTBBd2l0aCUyMGFjY2VsZXJhdG9yLnByb2ZpbGUoKSUyMGFzJTIwcHJvZiUzQSUwQSUyMCUyMCUyMCUyMG1vZGVsKGlucHV0cyklMEElMEElMjMlMjBUaGUlMjB0cmFjZSUyMHdpbGwlMjBiZSUyMHNhdmVkJTIwdG8lMjB0aGUlMjBzcGVjaWZpZWQlMjBkaXJlY3Rvcnk=",highlighted:`model = models.resnet18()
inputs = torch.randn(<span class="hljs-number">5</span>, <span class="hljs-number">3</span>, <span class="hljs-number">224</span>, <span class="hljs-number">224</span>).cuda()
profile_kwargs = ProfileKwargs(
    activities=[<span class="hljs-string">&quot;cpu&quot;</span>, <span class="hljs-string">&quot;cuda&quot;</span>],
    output_trace_dir=<span class="hljs-string">&quot;trace&quot;</span>
)

accelerator = Accelerator(kwargs_handlers=[profile_kwargs])
model = accelerator.prepare(model)

<span class="hljs-keyword">with</span> accelerator.profile() <span class="hljs-keyword">as</span> prof:
    model(inputs)

<span class="hljs-comment"># The trace will be saved to the specified directory</span>`,wrap:!1}}),{c(){U(M.$$.fragment),a=j(),s=m("p"),s.innerHTML=w},l(p){T(M.$$.fragment,p),a=J(p),s=A(p,"P",{"data-svelte-h":!0}),u(s)!=="svelte-1yfjemg"&&(s.innerHTML=w)},m(p,C){r(M,p,C),y(p,a,C),y(p,s,C),t=!0},p:S,i(p){t||(o(M.$$.fragment,p),t=!0)},o(p){c(M.$$.fragment,p),t=!1},d(p){p&&(n(a),n(s)),i(M,p)}}}function gs(I){let M,a,s,w;return M=new d({props:{id:"exporting chrome trace",option:"PyTorch",$$slots:{default:[bs]},$$scope:{ctx:I}}}),s=new d({props:{id:"exporting chrome trace",option:"Accelerate",$$slots:{default:[$s]},$$scope:{ctx:I}}}),{c(){U(M.$$.fragment),a=j(),U(s.$$.fragment)},l(t){T(M.$$.fragment,t),a=J(t),T(s.$$.fragment,t)},m(t,p){r(M,t,p),y(t,a,p),r(s,t,p),w=!0},p(t,p){const C={};p&2&&(C.$$scope={dirty:p,ctx:t}),M.$set(C);const h={};p&2&&(h.$$scope={dirty:p,ctx:t}),s.$set(h)},i(t){w||(o(M.$$.fragment,t),o(s.$$.fragment,t),w=!0)},o(t){c(M.$$.fragment,t),c(s.$$.fragment,t),w=!1},d(t){t&&n(a),i(M,t),i(s,t)}}}function Ls(I){let M,a;return M=new f({props:{code:"ZnJvbSUyMHRvcmNoLnByb2ZpbGVyJTIwaW1wb3J0JTIwc2NoZWR1bGUlMEElMEFteV9zY2hlZHVsZSUyMCUzRCUyMHNjaGVkdWxlKCUwQSUyMCUyMCUyMCUyMHNraXBfZmlyc3QlM0QxJTJDJTBBJTIwJTIwJTIwJTIwd2FpdCUzRDUlMkMlMEElMjAlMjAlMjAlMjB3YXJtdXAlM0QxJTJDJTBBJTIwJTIwJTIwJTIwYWN0aXZlJTNEMyUyQyUwQSUyMCUyMCUyMCUyMHJlcGVhdCUzRDIlMEEpJTBBJTBBZGVmJTIwdHJhY2VfaGFuZGxlcihwKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dCUyMCUzRCUyMHAua2V5X2F2ZXJhZ2VzKCkudGFibGUoc29ydF9ieSUzRCUyMnNlbGZfY3VkYV90aW1lX3RvdGFsJTIyJTJDJTIwcm93X2xpbWl0JTNEMTApJTBBJTIwJTIwJTIwJTIwcHJpbnQob3V0cHV0KSUwQSUyMCUyMCUyMCUyMHAuZXhwb3J0X2Nocm9tZV90cmFjZSglMjIlMkZ0bXAlMkZ0cmFjZV8lMjIlMjAlMkIlMjBzdHIocC5zdGVwX251bSklMjAlMkIlMjAlMjIuanNvbiUyMiklMEElMEF3aXRoJTIwcHJvZmlsZSglMEElMjAlMjAlMjAlMjBhY3Rpdml0aWVzJTNEJTVCUHJvZmlsZXJBY3Rpdml0eS5DUFUlMkMlMjBQcm9maWxlckFjdGl2aXR5LkNVREElNUQlMkMlMEElMjAlMjAlMjAlMjBzY2hlZHVsZSUzRG15X3NjaGVkdWxlJTJDJTBBJTIwJTIwJTIwJTIwb25fdHJhY2VfcmVhZHklM0R0cmFjZV9oYW5kbGVyJTBBKSUyMGFzJTIwcCUzQSUwQSUyMCUyMCUyMCUyMGZvciUyMGlkeCUyMGluJTIwcmFuZ2UoOCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtb2RlbChpbnB1dHMpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcC5zdGVwKCk=",highlighted:`<span class="hljs-keyword">from</span> torch.profiler <span class="hljs-keyword">import</span> schedule

my_schedule = schedule(
    skip_first=<span class="hljs-number">1</span>,
    wait=<span class="hljs-number">5</span>,
    warmup=<span class="hljs-number">1</span>,
    active=<span class="hljs-number">3</span>,
    repeat=<span class="hljs-number">2</span>
)

<span class="hljs-keyword">def</span> <span class="hljs-title function_">trace_handler</span>(<span class="hljs-params">p</span>):
    output = p.key_averages().table(sort_by=<span class="hljs-string">&quot;self_cuda_time_total&quot;</span>, row_limit=<span class="hljs-number">10</span>)
    <span class="hljs-built_in">print</span>(output)
    p.export_chrome_trace(<span class="hljs-string">&quot;/tmp/trace_&quot;</span> + <span class="hljs-built_in">str</span>(p.step_num) + <span class="hljs-string">&quot;.json&quot;</span>)

<span class="hljs-keyword">with</span> profile(
    activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
    schedule=my_schedule,
    on_trace_ready=trace_handler
) <span class="hljs-keyword">as</span> p:
    <span class="hljs-keyword">for</span> idx <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">8</span>):
        model(inputs)
        p.step()`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function Bs(I){let M,a;return M=new f({props:{code:"ZGVmJTIwdHJhY2VfaGFuZGxlcihwKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dCUyMCU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MCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByb2Yuc3RlcCgp",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">trace_handler</span>(<span class="hljs-params">p</span>):
    output = p.key_averages().table(sort_by=<span class="hljs-string">&quot;self_cuda_time_total&quot;</span>, row_limit=<span class="hljs-number">10</span>)
    <span class="hljs-built_in">print</span>(output)
    p.export_chrome_trace(<span class="hljs-string">&quot;/tmp/trace_&quot;</span> + <span class="hljs-built_in">str</span>(p.step_num) + <span class="hljs-string">&quot;.json&quot;</span>)

profile_kwargs = ProfileKwargs(
    activities=[<span class="hljs-string">&quot;cpu&quot;</span>, <span class="hljs-string">&quot;cuda&quot;</span>],
    schedule_option={<span class="hljs-string">&quot;wait&quot;</span>: <span class="hljs-number">5</span>, <span class="hljs-string">&quot;warmup&quot;</span>: <span class="hljs-number">1</span>, <span class="hljs-string">&quot;active&quot;</span>: <span class="hljs-number">3</span>, <span class="hljs-string">&quot;repeat&quot;</span>: <span class="hljs-number">2</span>, <span class="hljs-string">&quot;skip_first&quot;</span>: <span class="hljs-number">1</span>},
    on_trace_ready=trace_handler
)

accelerator = Accelerator(kwargs_handlers=[profile_kwargs])
model = accelerator.prepare(model)

<span class="hljs-keyword">with</span> accelerator.profile() <span class="hljs-keyword">as</span> prof:
    <span class="hljs-keyword">for</span> idx <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-number">8</span>):
        model(inputs)
        prof.step()`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function _s(I){let M,a,s,w;return M=new d({props:{id:"custom handler",option:"PyTorch",$$slots:{default:[Ls]},$$scope:{ctx:I}}}),s=new d({props:{id:"custom handler",option:"Accelerate",$$slots:{default:[Bs]},$$scope:{ctx:I}}}),{c(){U(M.$$.fragment),a=j(),U(s.$$.fragment)},l(t){T(M.$$.fragment,t),a=J(t),T(s.$$.fragment,t)},m(t,p){r(M,t,p),y(t,a,p),r(s,t,p),w=!0},p(t,p){const C={};p&2&&(C.$$scope={dirty:p,ctx:t}),M.$set(C);const h={};p&2&&(h.$$scope={dirty:p,ctx:t}),s.$set(h)},i(t){w||(o(M.$$.fragment,t),o(s.$$.fragment,t),w=!0)},o(t){c(M.$$.fragment,t),c(s.$$.fragment,t),w=!1},d(t){t&&n(a),i(M,t),i(s,t)}}}function Zs(I){let M,a;return M=new f({props:{code:"d2l0aCUyMHByb2ZpbGUoJTBBJTIwJTIwJTIwJTIwYWN0aXZpdGllcyUzRCU1QlByb2ZpbGVyQWN0aXZpdHkuQ1BVJTJDJTIwUHJvZmlsZXJBY3Rpdml0eS5DVURBJTVEJTJDJTBBJTIwJTIwJTIwJTIwd2l0aF9mbG9wcyUzRFRydWUlMEEpJTIwYXMlMjBwcm9mJTNBJTBBJTIwJTIwJTIwJTIwbW9kZWwoaW5wdXRzKSUwQSUwQXByaW50KHByb2Yua2V5X2F2ZXJhZ2VzKCkudGFibGUoc29ydF9ieSUzRCUyMmZsb3BzJTIyJTJDJTIwcm93X2xpbWl0JTNEMTApKQ==",highlighted:`<span class="hljs-keyword">with</span> profile(
    activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
    with_flops=<span class="hljs-literal">True</span>
) <span class="hljs-keyword">as</span> prof:
    model(inputs)

<span class="hljs-built_in">print</span>(prof.key_averages().table(sort_by=<span class="hljs-string">&quot;flops&quot;</span>, row_limit=<span class="hljs-number">10</span>))`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function Vs(I){let M,a;return M=new f({props:{code:"cHJvZmlsZV9rd2FyZ3MlMjAlM0QlMjBQcm9maWxlS3dhcmdzKCUwQSUyMCUyMCUyMCUyMHdpdGhfZmxvcHMlM0RUcnVlJTBBKSUwQWFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b3Ioa3dhcmdzX2hhbmRsZXJzJTNEJTVCcHJvZmlsZV9rd2FyZ3MlNUQpJTBBJTBBd2l0aCUyMGFjY2VsZXJhdG9yLnByb2ZpbGUoKSUyMGFzJTIwcHJvZiUzQSUwQSUyMCUyMCUyMCUyMG1vZGVsKGlucHV0cyklMEElMEFwcmludChwcm9mLmtleV9hdmVyYWdlcygpLnRhYmxlKHNvcnRfYnklM0QlMjJmbG9wcyUyMiUyQyUyMHJvd19saW1pdCUzRDEwKSk=",highlighted:`profile_kwargs = ProfileKwargs(
    with_flops=<span class="hljs-literal">True</span>
)
accelerator = Accelerator(kwargs_handlers=[profile_kwargs])

<span class="hljs-keyword">with</span> accelerator.profile() <span class="hljs-keyword">as</span> prof:
    model(inputs)

<span class="hljs-built_in">print</span>(prof.key_averages().table(sort_by=<span class="hljs-string">&quot;flops&quot;</span>, row_limit=<span class="hljs-number">10</span>))`,wrap:!1}}),{c(){U(M.$$.fragment)},l(s){T(M.$$.fragment,s)},m(s,w){r(M,s,w),a=!0},p:S,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function vs(I){let M,a,s,w;return M=new d({props:{id:"FLOPS",option:"PyTorch",$$slots:{default:[Zs]},$$scope:{ctx:I}}}),s=new d({props:{id:"FLOPS",option:"Accelerate",$$slots:{default:[Vs]},$$scope:{ctx:I}}}),{c(){U(M.$$.fragment),a=j(),U(s.$$.fragment)},l(t){T(M.$$.fragment,t),a=J(t),T(s.$$.fragment,t)},m(t,p){r(M,t,p),y(t,a,p),r(s,t,p),w=!0},p(t,p){const C={};p&2&&(C.$$scope={dirty:p,ctx:t}),M.$set(C);const h={};p&2&&(h.$$scope={dirty:p,ctx:t}),s.$set(h)},i(t){w||(o(M.$$.fragment,t),o(s.$$.fragment,t),w=!0)},o(t){c(M.$$.fragment,t),c(s.$$.fragment,t),w=!1},d(t){t&&n(a),i(M,t),i(s,t)}}}function ks(I){let M,a,s,w,t,p,C,h="Profiler is a tool that allows the collection of performance metrics during training and inference. Profiler’s context manager API can be used to better understand what model operators are the most expensive, examine their input shapes and stack traces, study device kernel activity, and visualize the execution trace. It provides insights into the performance of your model, allowing you to optimize and improve it.",wl,_,Rl="This guide explains how to use PyTorch Profiler to measure the time and memory consumption of the model’s operators and how to integrate this with Accelerate. We will cover various use cases and provide examples for each.",jl,Z,Jl,V,Hl="Profiler allows one to check which operators were called during the execution of a code range wrapped with a profiler context manager.",Ul,v,Yl="Let’s see how we can use profiler to analyze the execution time:",Tl,b,rl,k,Fl="The resulting table output (omitting some columns):",ol,G,cl,N,xl="To get a finer granularity of results and include operator input shapes, pass <code>group_by_input_shape=True</code> (note: this requires running the profiler with <code>record_shapes=True</code>):",il,z,Il,E,Cl,X,Dl="Profiler can also show the amount of memory (used by the model’s tensors) that was allocated (or released) during the execution of the model’s operators. To enable memory profiling functionality pass <code>profile_memory=True</code>.",ml,$,Al,Q,Pl="The resulting table output (omitting some columns):",ul,W,hl,R,fl,H,Kl="You can examine the sequence of profiled operators and CUDA kernels in Chrome trace viewer (<code>chrome://tracing</code>):",dl,Y,ql='<img src="https://github.com/huggingface/accelerate/assets/100389977/5acb193f-6d11-4f7b-9873-c600c19e8172" alt="profile_export"/>',Sl,g,bl,F,$l,x,Ol="Profiler offers an additional API to handle long-running jobs (such as training loops). Tracing all of the execution can be slow and result in very large trace files. To avoid this, use optional arguments:",gl,D,ls="<li><code>schedule_option</code>: Scheduling options allow you to control when profiling is active. This is useful for long-running jobs to avoid collecting too much data. Available keys are <code>wait</code>, <code>warmup</code>, <code>active</code>, <code>repeat</code> and <code>skip_first</code>. The profiler will skip the first <code>skip_first</code> steps, then wait for <code>wait</code> steps, then do the warmup for the next <code>warmup</code> steps, then do the active recording for the next <code>active</code> steps and then repeat the cycle starting with <code>wait</code> steps. The optional number of cycles is specified with the <code>repeat</code> parameter, the zero value means that the cycles will continue until the profiling is finished.</li> <li><code>on_trace_ready</code>: specifies a function that takes a reference to the profiler as an input and is called by the profiler each time the new trace is ready.</li>",Ll,P,ss="To illustrate how the API works, consider the following example:",Bl,L,_l,K,Zl,q,Ms="Use formula to estimate the FLOPs (floating point operations) of specific operators (matrix multiplication and 2D convolution).",Vl,O,ts="To measure floating-point operations (FLOPS):",vl,B,kl,ll,es="The resulting table output (omitting some columns):",Gl,sl,Nl,Ml,zl,tl,as="PyTorch Profiler is a powerful tool for analyzing the performance of your models. By integrating it with Accelerate, you can easily profile your models and gain insights into their performance, helping you to optimize and improve them.",El,el,ns='For more detailed information, refer to the <a href="https://pytorch.org/docs/stable/profiler.html" rel="nofollow">PyTorch Profiler documentation</a>.',Xl,al,Ql,pl,Wl;return t=new nl({props:{title:"Profiler",local:"profiler",headingTag:"h1"}}),Z=new nl({props:{title:"Using profiler to analyze execution time",local:"using-profiler-to-analyze-execution-time",headingTag:"h2"}}),b=new yl({props:{id:"cpu execution time",options:["PyTorch","Accelerate"],$$slots:{default:[hs]},$$scope:{ctx:I}}}),G=new f({props:{code:"LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwTmFtZSUyMCUyMCUyMCUyMCUyMCUyMFNlbGYlMjBDUFUlMjAlMjAlMjAlMjAlMjBDUFUlMjB0b3RhbCUyMCUyMENQVSUyMHRpbWUlMjBhdmclMjAlMjAlMjAlMjAlMjMlMjBvZiUyMENhbGxzJTIwJTIwJTBB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UyMCUyMDQuMDA4bXMlMjAlMjAlMjAlMjAlMjAlMjAlMjA0LjAwOG1zJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwMSUyMCUyMCUwQSUyMCUyMCUyMCUyMGF0ZW4lM0ElM0FtYXhfcG9vbDJkX3dpdGhfaW5kaWNlcyUyMCUyMCUyMCUyMCUyMCUyMCUyMDMuOTY4bXMlMjAlMjAlMjAlMjAlMjAlMjAlMjAzLjk2OG1zJTIwJTIwJTIwJTIwJTIwJTIwJTIwMy45NjhtcyUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMDElMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBhdGVuJTNBJTNBYWRkXyUyMCUyMCUyMCUyMCUyMDc4MC4wMDB1cyUyMCUyMCUyMCUyMCUyMDc4MC4wMDB1cyUyMCUyMCUyMCUyMCUyMCUyMDI3Ljg1N3VzJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwMjglMjAlMjAlMEEtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0lMjAlMjAtLS0tLS0tLS0tLS0lMjAlMjAtLS0tLS0tLS0tLS0lMjAlMjAtLS0tLS0tLS0tLS0lMjAlMjAtLS0tLS0tLS0tLS0lMjAlMjAlMEFTZWxmJTIwQ1BVJTIwdGltZSUyMHRvdGFsJTNBJTIwNjcuMDE2bXM=",highlighted:`<span class="hljs-params">---------------------------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  
                             Name      Self CPU     CPU total  CPU time avg    <span class="hljs-comment"># of Calls  </span>
<span class="hljs-params">---------------------------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  
                     aten:<span class="hljs-function">:conv2d</span>     171.000us      52.260ms       2.613ms            20  
                aten:<span class="hljs-function">:convolution</span>     227.000us      52.089ms       2.604ms            20  
               aten:<span class="hljs-function">:_convolution</span>     270.000us      51.862ms       2.593ms            20  
         aten:<span class="hljs-function">:mkldnn_convolution</span>      51.273ms      51.592ms       2.580ms            20  
                 aten:<span class="hljs-function">:batch_norm</span>     118.000us       7.059ms     352.950us            20  
     aten:<span class="hljs-function">:_batch_norm_impl_index</span>     315.000us       6.941ms     347.050us            20  
          aten:<span class="hljs-function">:native_batch_norm</span>       6.305ms       6.599ms     329.950us            20  
                 aten:<span class="hljs-function">:max_pool2d</span>      40.000us       4.008ms       4.008ms             1  
    aten:<span class="hljs-function">:max_pool2d_with_indices</span>       3.968ms       3.968ms       3.968ms             1  
                       aten:<span class="hljs-function">:add_</span>     780.000us     780.000us      27.857us            28  
<span class="hljs-params">---------------------------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  <span class="hljs-params">------------</span>  
Self CPU time total: 67.016ms`,wrap:!1}}),z=new f({props:{code:"cHJpbnQocHJvZi5rZXlfYXZlcmFnZXMoZ3JvdXBfYnlfaW5wdXRfc2hhcGUlM0RUcnVlKS50YWJsZShzb3J0X2J5JTNEJTIyY3B1X3RpbWVfdG90YWwlMjIlMkMlMjByb3dfbGltaXQlM0QxMCkp",highlighted:'<span class="hljs-built_in">print</span>(prof.key_averages(group_by_input_shape=<span class="hljs-literal">True</span>).table(sort_by=<span class="hljs-string">&quot;cpu_time_total&quot;</span>, row_limit=<span class="hljs-number">10</span>))',wrap:!1}}),E=new nl({props:{title:"Using profiler to analyze memory consumption",local:"using-profiler-to-analyze-memory-consumption",headingTag:"h2"}}),$=new yl({props:{id:"memory consumption",options:["PyTorch","Accelerate"],$$slots:{default:[Ss]},$$scope:{ctx:I}}}),W=new f({props:{code:"LS0tLS0tLS0tLS0tLS0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S0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwJTBBU2VsZiUyMENQVSUyMHRpbWUlMjB0b3RhbCUzQSUyMDY5LjMzMm1z",highlighted:`---------------------------------  ------------  ------------  ------------  
                             Name       CPU Mem  Self CPU Mem    <span class="hljs-comment"># of Calls  </span>
---------------------------------  ------------  ------------  ------------  
                      aten::empty      94.85 Mb      94.85 Mb          <span class="hljs-number"> 205 </span> 
    aten::max_pool2d_with_indices      11.48 Mb      11.48 Mb            <span class="hljs-number"> 1 </span> 
                      aten::addmm      19.53 Kb      19.53 Kb            <span class="hljs-number"> 1 </span> 
                       aten::mean      10.00 Kb      10.00 Kb            <span class="hljs-number"> 1 </span> 
              aten::empty_strided        <span class="hljs-number"> 492 </span>b        <span class="hljs-number"> 492 </span>b            <span class="hljs-number"> 5 </span> 
                        aten::cat        <span class="hljs-number"> 240 </span>b        <span class="hljs-number"> 240 </span>b            <span class="hljs-number"> 6 </span> 
                        aten::abs        <span class="hljs-number"> 480 </span>b        <span class="hljs-number"> 240 </span>b            <span class="hljs-number"> 4 </span> 
              aten::masked_select        <span class="hljs-number"> 120 </span>b        <span class="hljs-number"> 112 </span>b            <span class="hljs-number"> 1 </span> 
                         aten::ne         <span class="hljs-number"> 61 </span>b         <span class="hljs-number"> 53 </span>b            <span class="hljs-number"> 3 </span> 
                         aten::eq         <span class="hljs-number"> 30 </span>b         <span class="hljs-number"> 30 </span>b            <span class="hljs-number"> 1 </span> 
---------------------------------  ------------  ------------  ------------  
Self CPU time total: 69.332ms`,wrap:!1}}),R=new nl({props:{title:"Exporting chrome trace",local:"exporting-chrome-trace",headingTag:"h2"}}),g=new yl({props:{id:"exporting chrome trace",options:["PyTorch","Accelerate"],$$slots:{default:[gs]},$$scope:{ctx:I}}}),F=new nl({props:{title:"Using Profiler to Analyze Long-Running Jobs",local:"using-profiler-to-analyze-long-running-jobs",headingTag:"h2"}}),L=new yl({props:{id:"custom handler",options:["PyTorch","Accelerate"],$$slots:{default:[_s]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span>  <span class="hljs-literal">------------</span>  <span class="hljs-literal">------------</span>  <span class="hljs-literal">------------</span>  
                                                   <span class="hljs-comment">Name      Self CPU     Self CUDA    Total FLOPs</span>  
<span class="hljs-literal">-------------------------------------------------------</span>  <span class="hljs-literal">------------</span>  <span class="hljs-literal">------------</span>  <span class="hljs-literal">------------</span>  
                                           <span class="hljs-comment">aten::conv2d     197</span><span class="hljs-string">.</span><span class="hljs-comment">000us       0</span><span class="hljs-string">.</span><span class="hljs-comment">000us  18135613440</span><span class="hljs-string">.</span><span class="hljs-comment">000</span>  
                                            <span class="hljs-comment">aten::addmm     103</span><span class="hljs-string">.</span><span class="hljs-comment">000us      17</span><span class="hljs-string">.</span><span class="hljs-comment">000us     5120000</span><span class="hljs-string">.</span><span class="hljs-comment">000</span>  
                                              <span class="hljs-comment">aten::mul      29</span><span class="hljs-string">.</span><span class="hljs-comment">000us       2</span><span class="hljs-string">.</span><span class="hljs-comment">000us          30</span><span class="hljs-string">.</span><span class="hljs-comment">000</span>  
                                      <span class="hljs-comment">aten::convolution     409</span><span class="hljs-string">.</span><span class="hljs-comment">000us       0</span><span class="hljs-string">.</span><span class="hljs-comment">000us</span>            <span class="hljs-literal">--</span>  
                                     <span class="hljs-comment">aten::_convolution     253</span><span class="hljs-string">.</span><span class="hljs-comment">000us       0</span><span class="hljs-string">.</span><span class="hljs-comment">000us</span>            <span class="hljs-literal">--</span>  
                                <span class="hljs-comment">aten::cudnn_convolution       5</span><span class="hljs-string">.</span><span class="hljs-comment">465ms       2</span><span class="hljs-string">.</span><span class="hljs-comment">970ms</span>            <span class="hljs-literal">--</span>  
                                        <span class="hljs-comment">cudaEventRecord     138</span><span class="hljs-string">.</span><span class="hljs-comment">000us       0</span><span class="hljs-string">.</span><span class="hljs-comment">000us</span>            <span class="hljs-literal">--</span>  
                                  <span class="hljs-comment">cudaStreamIsCapturing      43</span><span class="hljs-string">.</span><span class="hljs-comment">000us       0</span><span class="hljs-string">.</span><span class="hljs-comment">000us</span>            <span class="hljs-literal">--</span>  
                                  <span class="hljs-comment">cudaStreamGetPriority      40</span><span class="hljs-string">.</span><span class="hljs-comment">000us       0</span><span class="hljs-string">.</span><span class="hljs-comment">000us</span>            <span class="hljs-literal">--</span>  
                       <span class="hljs-comment">cudaDeviceGetStreamPriorityRange      10</span><span class="hljs-string">.</span><span class="hljs-comment">000us       0</span><span class="hljs-string">.</span><span class="hljs-comment">000us</span>            <span class="hljs-literal">--</span>  
<span class="hljs-literal">-------------------------------------------------------</span>  <span class="hljs-literal">------------</span>  <span class="hljs-literal">------------</span>  <span class="hljs-literal">------------</span>  
<span class="hljs-comment">Self CPU time total: 21</span><span class="hljs-string">.</span><span class="hljs-comment">938ms</span>
<span class="hljs-comment">Self CUDA time total: 4</span><span class="hljs-string">.</span><span class="hljs-comment">165ms</span>`,wrap:!1}}),Ml=new nl({props:{title:"Conclusion and Further Information",local:"conclusion-and-further-information",headingTag:"h2"}}),al=new ms({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/usage_guides/profiler.md"}}),{c(){M=m("meta"),a=j(),s=m("p"),w=j(),U(t.$$.fragment),p=j(),C=m("p"),C.textContent=h,wl=j(),_=m("p"),_.textContent=Rl,jl=j(),U(Z.$$.fragment),Jl=j(),V=m("p"),V.textContent=Hl,Ul=j(),v=m("p"),v.textContent=Yl,Tl=j(),U(b.$$.fragment),rl=j(),k=m("p"),k.textContent=Fl,ol=j(),U(G.$$.fragment),cl=j(),N=m("p"),N.innerHTML=xl,il=j(),U(z.$$.fragment),Il=j(),U(E.$$.fragment),Cl=j(),X=m("p"),X.innerHTML=Dl,ml=j(),U($.$$.fragment),Al=j(),Q=m("p"),Q.textContent=Pl,ul=j(),U(W.$$.fragment),hl=j(),U(R.$$.fragment),fl=j(),H=m("p"),H.innerHTML=Kl,dl=j(),Y=m("p"),Y.innerHTML=ql,Sl=j(),U(g.$$.fragment),bl=j(),U(F.$$.fragment),$l=j(),x=m("p"),x.textContent=Ol,gl=j(),D=m("ul"),D.innerHTML=ls,Ll=j(),P=m("p"),P.textContent=ss,Bl=j(),U(L.$$.fragment),_l=j(),U(K.$$.fragment),Zl=j(),q=m("p"),q.textContent=Ms,Vl=j(),O=m("p"),O.textContent=ts,vl=j(),U(B.$$.fragment),kl=j(),ll=m("p"),ll.textContent=es,Gl=j(),U(sl.$$.fragment),Nl=j(),U(Ml.$$.fragment),zl=j(),tl=m("p"),tl.textContent=as,El=j(),el=m("p"),el.innerHTML=ns,Xl=j(),U(al.$$.fragment),Ql=j(),pl=m("p"),this.h()},l(l){const e=Is("svelte-u9bgzb",document.head);M=A(e,"META",{name:!0,content:!0}),e.forEach(n),a=J(l),s=A(l,"P",{}),Us(s).forEach(n),w=J(l),T(t.$$.fragment,l),p=J(l),C=A(l,"P",{"data-svelte-h":!0}),u(C)!=="svelte-nolygo"&&(C.textContent=h),wl=J(l),_=A(l,"P",{"data-svelte-h":!0}),u(_)!=="svelte-mqipw7"&&(_.textContent=Rl),jl=J(l),T(Z.$$.fragment,l),Jl=J(l),V=A(l,"P",{"data-svelte-h":!0}),u(V)!=="svelte-rec50t"&&(V.textContent=Hl),Ul=J(l),v=A(l,"P",{"data-svelte-h":!0}),u(v)!=="svelte-556cz1"&&(v.textContent=Yl),Tl=J(l),T(b.$$.fragment,l),rl=J(l),k=A(l,"P",{"data-svelte-h":!0}),u(k)!=="svelte-1nltvv4"&&(k.textContent=Fl),ol=J(l),T(G.$$.fragment,l),cl=J(l),N=A(l,"P",{"data-svelte-h":!0}),u(N)!=="svelte-6rbdvd"&&(N.innerHTML=xl),il=J(l),T(z.$$.fragment,l),Il=J(l),T(E.$$.fragment,l),Cl=J(l),X=A(l,"P",{"data-svelte-h":!0}),u(X)!=="svelte-1eenghb"&&(X.innerHTML=Dl),ml=J(l),T($.$$.fragment,l),Al=J(l),Q=A(l,"P",{"data-svelte-h":!0}),u(Q)!=="svelte-1nltvv4"&&(Q.textContent=Pl),ul=J(l),T(W.$$.fragment,l),hl=J(l),T(R.$$.fragment,l),fl=J(l),H=A(l,"P",{"data-svelte-h":!0}),u(H)!=="svelte-r8y8s9"&&(H.innerHTML=Kl),dl=J(l),Y=A(l,"P",{"data-svelte-h":!0}),u(Y)!=="svelte-14g38nf"&&(Y.innerHTML=ql),Sl=J(l),T(g.$$.fragment,l),bl=J(l),T(F.$$.fragment,l),$l=J(l),x=A(l,"P",{"data-svelte-h":!0}),u(x)!=="svelte-voqhk0"&&(x.textContent=Ol),gl=J(l),D=A(l,"UL",{"data-svelte-h":!0}),u(D)!=="svelte-zcfpqf"&&(D.innerHTML=ls),Ll=J(l),P=A(l,"P",{"data-svelte-h":!0}),u(P)!=="svelte-1idin3s"&&(P.textContent=ss),Bl=J(l),T(L.$$.fragment,l),_l=J(l),T(K.$$.fragment,l),Zl=J(l),q=A(l,"P",{"data-svelte-h":!0}),u(q)!=="svelte-wx7pol"&&(q.textContent=Ms),Vl=J(l),O=A(l,"P",{"data-svelte-h":!0}),u(O)!=="svelte-yw0di5"&&(O.textContent=ts),vl=J(l),T(B.$$.fragment,l),kl=J(l),ll=A(l,"P",{"data-svelte-h":!0}),u(ll)!=="svelte-1nltvv4"&&(ll.textContent=es),Gl=J(l),T(sl.$$.fragment,l),Nl=J(l),T(Ml.$$.fragment,l),zl=J(l),tl=A(l,"P",{"data-svelte-h":!0}),u(tl)!=="svelte-ubv7yt"&&(tl.textContent=as),El=J(l),el=A(l,"P",{"data-svelte-h":!0}),u(el)!=="svelte-15zce5a"&&(el.innerHTML=ns),Xl=J(l),T(al.$$.fragment,l),Ql=J(l),pl=A(l,"P",{}),Us(pl).forEach(n),this.h()},h(){Ts(M,"name","hf:doc:metadata"),Ts(M,"content",Gs)},m(l,e){Cs(document.head,M),y(l,a,e),y(l,s,e),y(l,w,e),r(t,l,e),y(l,p,e),y(l,C,e),y(l,wl,e),y(l,_,e),y(l,jl,e),r(Z,l,e),y(l,Jl,e),y(l,V,e),y(l,Ul,e),y(l,v,e),y(l,Tl,e),r(b,l,e),y(l,rl,e),y(l,k,e),y(l,ol,e),r(G,l,e),y(l,cl,e),y(l,N,e),y(l,il,e),r(z,l,e),y(l,Il,e),r(E,l,e),y(l,Cl,e),y(l,X,e),y(l,ml,e),r($,l,e),y(l,Al,e),y(l,Q,e),y(l,ul,e),r(W,l,e),y(l,hl,e),r(R,l,e),y(l,fl,e),y(l,H,e),y(l,dl,e),y(l,Y,e),y(l,Sl,e),r(g,l,e),y(l,bl,e),r(F,l,e),y(l,$l,e),y(l,x,e),y(l,gl,e),y(l,D,e),y(l,Ll,e),y(l,P,e),y(l,Bl,e),r(L,l,e),y(l,_l,e),r(K,l,e),y(l,Zl,e),y(l,q,e),y(l,Vl,e),y(l,O,e),y(l,vl,e),r(B,l,e),y(l,kl,e),y(l,ll,e),y(l,Gl,e),r(sl,l,e),y(l,Nl,e),r(Ml,l,e),y(l,zl,e),y(l,tl,e),y(l,El,e),y(l,el,e),y(l,Xl,e),r(al,l,e),y(l,Ql,e),y(l,pl,e),Wl=!0},p(l,[e]){const ps={};e&2&&(ps.$$scope={dirty:e,ctx:l}),b.$set(ps);const ys={};e&2&&(ys.$$scope={dirty:e,ctx:l}),$.$set(ys);const ws={};e&2&&(ws.$$scope={dirty:e,ctx:l}),g.$set(ws);const js={};e&2&&(js.$$scope={dirty:e,ctx:l}),L.$set(js);const Js={};e&2&&(Js.$$scope={dirty:e,ctx:l}),B.$set(Js)},i(l){Wl||(o(t.$$.fragment,l),o(Z.$$.fragment,l),o(b.$$.fragment,l),o(G.$$.fragment,l),o(z.$$.fragment,l),o(E.$$.fragment,l),o($.$$.fragment,l),o(W.$$.fragment,l),o(R.$$.fragment,l),o(g.$$.fragment,l),o(F.$$.fragment,l),o(L.$$.fragment,l),o(K.$$.fragment,l),o(B.$$.fragment,l),o(sl.$$.fragment,l),o(Ml.$$.fragment,l),o(al.$$.fragment,l),Wl=!0)},o(l){c(t.$$.fragment,l),c(Z.$$.fragment,l),c(b.$$.fragment,l),c(G.$$.fragment,l),c(z.$$.fragment,l),c(E.$$.fragment,l),c($.$$.fragment,l),c(W.$$.fragment,l),c(R.$$.fragment,l),c(g.$$.fragment,l),c(F.$$.fragment,l),c(L.$$.fragment,l),c(K.$$.fragment,l),c(B.$$.fragment,l),c(sl.$$.fragment,l),c(Ml.$$.fragment,l),c(al.$$.fragment,l),Wl=!1},d(l){l&&(n(a),n(s),n(w),n(p),n(C),n(wl),n(_),n(jl),n(Jl),n(V),n(Ul),n(v),n(Tl),n(rl),n(k),n(ol),n(cl),n(N),n(il),n(Il),n(Cl),n(X),n(ml),n(Al),n(Q),n(ul),n(hl),n(fl),n(H),n(dl),n(Y),n(Sl),n(bl),n($l),n(x),n(gl),n(D),n(Ll),n(P),n(Bl),n(_l),n(Zl),n(q),n(Vl),n(O),n(vl),n(kl),n(ll),n(Gl),n(Nl),n(zl),n(tl),n(El),n(el),n(Xl),n(Ql),n(pl)),n(M),i(t,l),i(Z,l),i(b,l),i(G,l),i(z,l),i(E,l),i($,l),i(W,l),i(R,l),i(g,l),i(F,l),i(L,l),i(K,l),i(B,l),i(sl,l),i(Ml,l),i(al,l)}}}const Gs='{"title":"Profiler","local":"profiler","sections":[{"title":"Using profiler to analyze execution time","local":"using-profiler-to-analyze-execution-time","sections":[],"depth":2},{"title":"Using profiler to analyze memory consumption","local":"using-profiler-to-analyze-memory-consumption","sections":[],"depth":2},{"title":"Exporting chrome trace","local":"exporting-chrome-trace","sections":[],"depth":2},{"title":"Using Profiler to Analyze Long-Running Jobs","local":"using-profiler-to-analyze-long-running-jobs","sections":[],"depth":2},{"title":"FLOPS","local":"flops","sections":[],"depth":2},{"title":"Conclusion and Further Information","local":"conclusion-and-further-information","sections":[],"depth":2}],"depth":1}';function Ns(I){return os(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rs extends cs{constructor(M){super(),is(this,M,Ns,ks,rs,{})}}export{Rs as component};
