import{s as cs,o as is,n as $}from"../chunks/scheduler.b9285784.js";import{S as Is,i as Cs,e as m,s as j,c as U,h as ms,a as A,d as n,b as J,f as rs,g as T,j as h,k as os,l as As,m as p,n as r,t as o,o as c,p as i}from"../chunks/index.26bc89a1.js";import{C as us,H as pl,E as hs}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e364eac2.js";import{C as f}from"../chunks/CodeBlock.804615c8.js";import{H as wl,a as d}from"../chunks/HfOption.76c7ca3e.js";function fs(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:$,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:"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:$,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:"cpu execution time",option:"PyTorch",$$slots:{default:[fs]},$$scope:{ctx:I}}}),s=new d({props:{id:"cpu execution time",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,y){r(M,t,y),p(t,a,y),r(s,t,y),w=!0},p(t,y){const C={};y&2&&(C.$$scope={dirty:y,ctx:t}),M.$set(C);const u={};y&2&&(u.$$scope={dirty:y,ctx:t}),s.$set(u)},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 Ss(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:$,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:"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:$,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function gs(I){let M,a,s,w;return M=new d({props:{id:"memory consumption",option:"PyTorch",$$slots:{default:[Ss]},$$scope:{ctx:I}}}),s=new d({props:{id:"memory consumption",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,y){r(M,t,y),p(t,a,y),r(s,t,y),w=!0},p(t,y){const C={};y&2&&(C.$$scope={dirty:y,ctx:t}),M.$set(C);const u={};y&2&&(u.$$scope={dirty:y,ctx:t}),s.$set(u)},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:"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:$,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,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(y){T(M.$$.fragment,y),a=J(y),s=A(y,"P",{"data-svelte-h":!0}),h(s)!=="svelte-1yfjemg"&&(s.innerHTML=w)},m(y,C){r(M,y,C),p(y,a,C),p(y,s,C),t=!0},p:$,i(y){t||(o(M.$$.fragment,y),t=!0)},o(y){c(M.$$.fragment,y),t=!1},d(y){y&&(n(a),n(s)),i(M,y)}}}function _s(I){let M,a,s,w;return M=new d({props:{id:"exporting chrome trace",option:"PyTorch",$$slots:{default:[Ls]},$$scope:{ctx:I}}}),s=new d({props:{id:"exporting chrome trace",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,y){r(M,t,y),p(t,a,y),r(s,t,y),w=!0},p(t,y){const C={};y&2&&(C.$$scope={dirty:y,ctx:t}),M.$set(C);const u={};y&2&&(u.$$scope={dirty:y,ctx:t}),s.$set(u)},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:"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:$,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:"ZGVmJTIwdHJhY2VfaGFuZGxlcihwKSUzQSUwQSUyMCUy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9kZWwoaW5wdXRzKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByb2Yuc3RlcCgp",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:$,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:"custom handler",option:"PyTorch",$$slots:{default:[Zs]},$$scope:{ctx:I}}}),s=new d({props:{id:"custom handler",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,y){r(M,t,y),p(t,a,y),r(s,t,y),w=!0},p(t,y){const C={};y&2&&(C.$$scope={dirty:y,ctx:t}),M.$set(C);const u={};y&2&&(u.$$scope={dirty:y,ctx:t}),s.$set(u)},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;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:$,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function Gs(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:$,i(s){a||(o(M.$$.fragment,s),a=!0)},o(s){c(M.$$.fragment,s),a=!1},d(s){i(M,s)}}}function Ns(I){let M,a,s,w;return M=new d({props:{id:"FLOPS",option:"PyTorch",$$slots:{default:[ks]},$$scope:{ctx:I}}}),s=new d({props:{id:"FLOPS",option:"Accelerate",$$slots:{default:[Gs]},$$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,y){r(M,t,y),p(t,a,y),r(s,t,y),w=!0},p(t,y){const C={};y&2&&(C.$$scope={dirty:y,ctx:t}),M.$set(C);const u={};y&2&&(u.$$scope={dirty:y,ctx:t}),s.$set(u)},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,s,w,t,y,C,u,_,Hl="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.",jl,Z,Yl="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,V,Ul,v,xl="Profiler allows one to check which operators were called during the execution of a code range wrapped with a profiler context manager.",Tl,k,Fl="Let’s see how we can use profiler to analyze the execution time:",rl,S,ol,G,Dl="The resulting table output (omitting some columns):",cl,N,il,z,Pl="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,E,Cl,X,ml,Q,Kl="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>.",Al,b,ul,W,ql="The resulting table output (omitting some columns):",hl,R,fl,H,dl,Y,Ol="You can examine the sequence of profiled operators and CUDA kernels in Chrome trace viewer (<code>chrome://tracing</code>):",$l,x,ls='<img src="https://github.com/huggingface/accelerate/assets/100389977/5acb193f-6d11-4f7b-9873-c600c19e8172" alt="profile_export"/>',Sl,g,bl,F,gl,D,ss="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:",Ll,P,Ms="<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>",Bl,K,ts="To illustrate how the API works, consider the following example:",_l,L,Zl,q,Vl,O,es="Use formula to estimate the FLOPs (floating point operations) of specific operators (matrix multiplication and 2D convolution).",vl,ll,as="To measure floating-point operations (FLOPS):",kl,B,Gl,sl,ns="The resulting table output (omitting some columns):",Nl,Ml,zl,tl,El,el,ps="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.",Xl,al,ys='For more detailed information, refer to the <a href="https://pytorch.org/docs/stable/profiler.html" rel="nofollow">PyTorch Profiler documentation</a>.',Ql,nl,Wl,yl,Rl;return t=new us({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),C=new pl({props:{title:"Profiler",local:"profiler",headingTag:"h1"}}),V=new pl({props:{title:"Using profiler to analyze execution time",local:"using-profiler-to-analyze-execution-time",headingTag:"h2"}}),S=new wl({props:{id:"cpu execution time",options:["PyTorch","Accelerate"],$$slots:{default:[$s]},$$scope:{ctx:I}}}),N=new f({props:{code:"LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwTmFtZSUyMCUyMCUyMCUyMCUyMCUyMFNlbGYlMjBDUFUlMjAlMjAlMjAlMjAlMjBDUFUlMjB0b3R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RlbiUzQSUzQW1heF9wb29sMmQlMjAlMjAlMjAlMjAlMjAlMjA0MC4wMDB1cyUyMCUyMCUyMCUyMCUyMCUyMCUyMDQuMDA4bXMlMjAlMjAlMjAlMjAlMjAlMjAlMjA0LjAwOG1zJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwMSUyMCUyMCUwQSUyMCUyMCUyMCUyMGF0ZW4lM0ElM0FtYXhfcG9vbDJkX3dpdGhfaW5kaWNlcyUyMCUyMCUyMCUyMCUyMCUyMCUyMDMuOTY4bXMlMjAlMjAlMjAlMjAlMjAlMjAlMjAzLjk2OG1zJTIwJTIwJTIwJTIwJTIwJTIwJTIwMy45NjhtcyUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMDElMjAlMjAlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBhdGVuJTNBJTNBYWRkXyUyMCUyMCUyMCUyMCUyMDc4MC4wMDB1cyUyMCUyMCUyMCUyMCUyMDc4MC4wMDB1cyUyMCUyMCUyMCUyMCUyMCUyMDI3Ljg1N3VzJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwMjglMjAlMjAlMEEtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0lMjAlMjAtLS0tLS0tLS0tLS0lMjAlMjAtLS0tLS0tLS0tLS0lMjAlMjAtLS0tLS0tLS0tLS0lMjAlMjAtLS0tLS0tLS0tLS0lMjAlMjAlMEFTZWxmJTIwQ1BVJTIwdGltZSUyMHRvdGFsJTNBJTIwNjcuMDE2bXM=",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}}),E=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}}),X=new pl({props:{title:"Using profiler to analyze memory consumption",local:"using-profiler-to-analyze-memory-consumption",headingTag:"h2"}}),b=new wl({props:{id:"memory cons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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwLS0tLS0tLS0tLS0tJTIwJTIwJTBBU2VsZiUyMENQVSUyMHRpbWUlMjB0b3RhbCUzQSUyMDY5LjMzMm1z",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}}),H=new pl({props:{title:"Exporting chrome trace",local:"exporting-chrome-trace",headingTag:"h2"}}),g=new wl({props:{id:"exporting chrome trace",options:["PyTorch","Accelerate"],$$slots:{default:[_s]},$$scope:{ctx:I}}}),F=new pl({props:{title:"Using Profiler to Analyze Long-Running Jobs",local:"using-profiler-to-analyze-long-running-jobs",headingTag:"h2"}}),L=new wl({props:{id:"custom handler",options:["PyTorch","Accelerate"],$$slots:{default:[vs]},$$scope:{ctx:I}}}),q=new pl({props:{title:"FLOPS",local:"flops",headingTag:"h2"}}),B=new wl({props:{id:"FLOPS",options:["PyTorch","Accelerate"],$$slots:{default:[Ns]},$$scope:{ctx:I}}}),Ml=new f({props:{code:"LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSUyMCUyMC0tLS0tLS0tLS0tLSUyMCUyMC0tLS0tLS0tLS0tLSUyMCUyMC0tLS0tLS0tLS0tLSUyMCUyMCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyME5hbWUlMjAlMjAlMjAlMjAlMjAlMjBTZWxmJTIwQ1BVJTIwJTIwJTIwJTIwJTIwU2VsZiUyMENVREElMjAlMjAlMjAlMjBUb3RhbCUyMEZMT1BzJTIwJTIwJTBBLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSUyMCUyMC0tLS0tLS0tLS0tLSUyMCUyMC0tLS0tLS0tLS0tLSUyMCUyMC0tLS0tLS0tLS0tLSUyMCUyMCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGF0ZW4lM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lbGYlMjBDVURBJTIwdGltZSUyMHRvdGFsJTNBJTIwNC4xNjVtcw==",highlighted:`<span class="hljs-literal">-------------------------------------------------------</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}}),tl=new pl({props:{title:"Conclusion and Further Information",local:"conclusion-and-further-information",headingTag:"h2"}}),nl=new hs({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),y=j(),U(C.$$.fragment),u=j(),_=m("p"),_.textContent=Hl,jl=j(),Z=m("p"),Z.textContent=Yl,Jl=j(),U(V.$$.fragment),Ul=j(),v=m("p"),v.textContent=xl,Tl=j(),k=m("p"),k.textContent=Fl,rl=j(),U(S.$$.fragment),ol=j(),G=m("p"),G.textContent=Dl,cl=j(),U(N.$$.fragment),il=j(),z=m("p"),z.innerHTML=Pl,Il=j(),U(E.$$.fragment),Cl=j(),U(X.$$.fragment),ml=j(),Q=m("p"),Q.innerHTML=Kl,Al=j(),U(b.$$.fragment),ul=j(),W=m("p"),W.textContent=ql,hl=j(),U(R.$$.fragment),fl=j(),U(H.$$.fragment),dl=j(),Y=m("p"),Y.innerHTML=Ol,$l=j(),x=m("p"),x.innerHTML=ls,Sl=j(),U(g.$$.fragment),bl=j(),U(F.$$.fragment),gl=j(),D=m("p"),D.textContent=ss,Ll=j(),P=m("ul"),P.innerHTML=Ms,Bl=j(),K=m("p"),K.textContent=ts,_l=j(),U(L.$$.fragment),Zl=j(),U(q.$$.fragment),Vl=j(),O=m("p"),O.textContent=es,vl=j(),ll=m("p"),ll.textContent=as,kl=j(),U(B.$$.fragment),Gl=j(),sl=m("p"),sl.textContent=ns,Nl=j(),U(Ml.$$.fragment),zl=j(),U(tl.$$.fragment),El=j(),el=m("p"),el.textContent=ps,Xl=j(),al=m("p"),al.innerHTML=ys,Ql=j(),U(nl.$$.fragment),Wl=j(),yl=m("p"),this.h()},l(l){const e=ms("svelte-u9bgzb",document.head);M=A(e,"META",{name:!0,content:!0}),e.forEach(n),a=J(l),s=A(l,"P",{}),rs(s).forEach(n),w=J(l),T(t.$$.fragment,l),y=J(l),T(C.$$.fragment,l),u=J(l),_=A(l,"P",{"data-svelte-h":!0}),h(_)!=="svelte-nolygo"&&(_.textContent=Hl),jl=J(l),Z=A(l,"P",{"data-svelte-h":!0}),h(Z)!=="svelte-mqipw7"&&(Z.textContent=Yl),Jl=J(l),T(V.$$.fragment,l),Ul=J(l),v=A(l,"P",{"data-svelte-h":!0}),h(v)!=="svelte-rec50t"&&(v.textContent=xl),Tl=J(l),k=A(l,"P",{"data-svelte-h":!0}),h(k)!=="svelte-556cz1"&&(k.textContent=Fl),rl=J(l),T(S.$$.fragment,l),ol=J(l),G=A(l,"P",{"data-svelte-h":!0}),h(G)!=="svelte-1nltvv4"&&(G.textContent=Dl),cl=J(l),T(N.$$.fragment,l),il=J(l),z=A(l,"P",{"data-svelte-h":!0}),h(z)!=="svelte-6rbdvd"&&(z.innerHTML=Pl),Il=J(l),T(E.$$.fragment,l),Cl=J(l),T(X.$$.fragment,l),ml=J(l),Q=A(l,"P",{"data-svelte-h":!0}),h(Q)!=="svelte-1eenghb"&&(Q.innerHTML=Kl),Al=J(l),T(b.$$.fragment,l),ul=J(l),W=A(l,"P",{"data-svelte-h":!0}),h(W)!=="svelte-1nltvv4"&&(W.textContent=ql),hl=J(l),T(R.$$.fragment,l),fl=J(l),T(H.$$.fragment,l),dl=J(l),Y=A(l,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-r8y8s9"&&(Y.innerHTML=Ol),$l=J(l),x=A(l,"P",{"data-svelte-h":!0}),h(x)!=="svelte-14g38nf"&&(x.innerHTML=ls),Sl=J(l),T(g.$$.fragment,l),bl=J(l),T(F.$$.fragment,l),gl=J(l),D=A(l,"P",{"data-svelte-h":!0}),h(D)!=="svelte-voqhk0"&&(D.textContent=ss),Ll=J(l),P=A(l,"UL",{"data-svelte-h":!0}),h(P)!=="svelte-zcfpqf"&&(P.innerHTML=Ms),Bl=J(l),K=A(l,"P",{"data-svelte-h":!0}),h(K)!=="svelte-1idin3s"&&(K.textContent=ts),_l=J(l),T(L.$$.fragment,l),Zl=J(l),T(q.$$.fragment,l),Vl=J(l),O=A(l,"P",{"data-svelte-h":!0}),h(O)!=="svelte-wx7pol"&&(O.textContent=es),vl=J(l),ll=A(l,"P",{"data-svelte-h":!0}),h(ll)!=="svelte-yw0di5"&&(ll.textContent=as),kl=J(l),T(B.$$.fragment,l),Gl=J(l),sl=A(l,"P",{"data-svelte-h":!0}),h(sl)!=="svelte-1nltvv4"&&(sl.textContent=ns),Nl=J(l),T(Ml.$$.fragment,l),zl=J(l),T(tl.$$.fragment,l),El=J(l),el=A(l,"P",{"data-svelte-h":!0}),h(el)!=="svelte-ubv7yt"&&(el.textContent=ps),Xl=J(l),al=A(l,"P",{"data-svelte-h":!0}),h(al)!=="svelte-15zce5a"&&(al.innerHTML=ys),Ql=J(l),T(nl.$$.fragment,l),Wl=J(l),yl=A(l,"P",{}),rs(yl).forEach(n),this.h()},h(){os(M,"name","hf:doc:metadata"),os(M,"content",Es)},m(l,e){As(document.head,M),p(l,a,e),p(l,s,e),p(l,w,e),r(t,l,e),p(l,y,e),r(C,l,e),p(l,u,e),p(l,_,e),p(l,jl,e),p(l,Z,e),p(l,Jl,e),r(V,l,e),p(l,Ul,e),p(l,v,e),p(l,Tl,e),p(l,k,e),p(l,rl,e),r(S,l,e),p(l,ol,e),p(l,G,e),p(l,cl,e),r(N,l,e),p(l,il,e),p(l,z,e),p(l,Il,e),r(E,l,e),p(l,Cl,e),r(X,l,e),p(l,ml,e),p(l,Q,e),p(l,Al,e),r(b,l,e),p(l,ul,e),p(l,W,e),p(l,hl,e),r(R,l,e),p(l,fl,e),r(H,l,e),p(l,dl,e),p(l,Y,e),p(l,$l,e),p(l,x,e),p(l,Sl,e),r(g,l,e),p(l,bl,e),r(F,l,e),p(l,gl,e),p(l,D,e),p(l,Ll,e),p(l,P,e),p(l,Bl,e),p(l,K,e),p(l,_l,e),r(L,l,e),p(l,Zl,e),r(q,l,e),p(l,Vl,e),p(l,O,e),p(l,vl,e),p(l,ll,e),p(l,kl,e),r(B,l,e),p(l,Gl,e),p(l,sl,e),p(l,Nl,e),r(Ml,l,e),p(l,zl,e),r(tl,l,e),p(l,El,e),p(l,el,e),p(l,Xl,e),p(l,al,e),p(l,Ql,e),r(nl,l,e),p(l,Wl,e),p(l,yl,e),Rl=!0},p(l,[e]){const ws={};e&2&&(ws.$$scope={dirty:e,ctx:l}),S.$set(ws);const js={};e&2&&(js.$$scope={dirty:e,ctx:l}),b.$set(js);const Js={};e&2&&(Js.$$scope={dirty:e,ctx:l}),g.$set(Js);const Us={};e&2&&(Us.$$scope={dirty:e,ctx:l}),L.$set(Us);const Ts={};e&2&&(Ts.$$scope={dirty:e,ctx:l}),B.$set(Ts)},i(l){Rl||(o(t.$$.fragment,l),o(C.$$.fragment,l),o(V.$$.fragment,l),o(S.$$.fragment,l),o(N.$$.fragment,l),o(E.$$.fragment,l),o(X.$$.fragment,l),o(b.$$.fragment,l),o(R.$$.fragment,l),o(H.$$.fragment,l),o(g.$$.fragment,l),o(F.$$.fragment,l),o(L.$$.fragment,l),o(q.$$.fragment,l),o(B.$$.fragment,l),o(Ml.$$.fragment,l),o(tl.$$.fragment,l),o(nl.$$.fragment,l),Rl=!0)},o(l){c(t.$$.fragment,l),c(C.$$.fragment,l),c(V.$$.fragment,l),c(S.$$.fragment,l),c(N.$$.fragment,l),c(E.$$.fragment,l),c(X.$$.fragment,l),c(b.$$.fragment,l),c(R.$$.fragment,l),c(H.$$.fragment,l),c(g.$$.fragment,l),c(F.$$.fragment,l),c(L.$$.fragment,l),c(q.$$.fragment,l),c(B.$$.fragment,l),c(Ml.$$.fragment,l),c(tl.$$.fragment,l),c(nl.$$.fragment,l),Rl=!1},d(l){l&&(n(a),n(s),n(w),n(y),n(u),n(_),n(jl),n(Z),n(Jl),n(Ul),n(v),n(Tl),n(k),n(rl),n(ol),n(G),n(cl),n(il),n(z),n(Il),n(Cl),n(ml),n(Q),n(Al),n(ul),n(W),n(hl),n(fl),n(dl),n(Y),n($l),n(x),n(Sl),n(bl),n(gl),n(D),n(Ll),n(P),n(Bl),n(K),n(_l),n(Zl),n(Vl),n(O),n(vl),n(ll),n(kl),n(Gl),n(sl),n(Nl),n(zl),n(El),n(el),n(Xl),n(al),n(Ql),n(Wl),n(yl)),n(M),i(t,l),i(C,l),i(V,l),i(S,l),i(N,l),i(E,l),i(X,l),i(b,l),i(R,l),i(H,l),i(g,l),i(F,l),i(L,l),i(q,l),i(B,l),i(Ml,l),i(tl,l),i(nl,l)}}}const Es='{"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 Xs(I){return is(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class xs extends Is{constructor(M){super(),Cs(this,M,Xs,zs,cs,{})}}export{xs as component};
