import{s as Ia,o as Sa,n as Q}from"../chunks/scheduler.defa9a21.js";import{S as Ga,i as Ea,g as o,s as l,r as u,A as ka,h as c,f as i,c as r,j as J,u as g,x as $,k as x,y as s,a as w,v as f,d as b,t as y,w as M}from"../chunks/index.fe795e71.js";import{D as C}from"../chunks/Docstring.90d6fe5c.js";import{C as W}from"../chunks/CodeBlock.204b6c34.js";import{E as P}from"../chunks/ExampleCodeBlock.f6fae62d.js";import{H as zt,E as Na}from"../chunks/getInferenceSnippets.2234a8dd.js";function Za(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUudXRpbHMlMjBpbXBvcnQlMjBJbml0UHJvY2Vzc0dyb3VwS3dhcmdzJTBBJTBBJTIzJTIwVG8lMjBpbmNsdWRlJTIwJTYwSW5pdFByb2Nlc3NHcm91cEt3YXJncyU2MCUyQyUyMGluaXQlMjB0aGVuJTIwY2FsbCUyMCU2MC50b19rd2FyZ3MoKSU2MCUwQWt3YXJncyUyMCUzRCUyMEluaXRQcm9jZXNzR3JvdXBLd2FyZ3MoLi4uKS50b19rd2FyZ3MoKSUwQXN0YXRlJTIwJTNEJTIwUGFydGlhbFN0YXRlKCoqa3dhcmdzKQ==",highlighted:'<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> InitProcessGroupKwargs\n\n<span class="hljs-comment"># To include `InitProcessGroupKwargs`, init then call `.to_kwargs()`</span>\nkwargs = InitProcessGroupKwargs(...).to_kwargs()\nstate = PartialState(**kwargs)',wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Xa(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBd2l0aCUyMHN0YXRlLmxvY2FsX21haW5fcHJvY2Vzc19maXJzdCgpJTNBJTBBJTIwJTIwJTIwJTIwJTIzJTIwVGhpcyUyMHdpbGwlMjBiZSUyMHByaW50ZWQlMjBmaXJzdCUyMGJ5JTIwbG9jYWwlMjBwcm9jZXNzJTIwMCUyMHRoZW4lMjBpbiUyMGElMjBzZWVtaW5nbHklMEElMjAlMjAlMjAlMjAlMjMlMjByYW5kb20lMjBvcmRlciUyMGJ5JTIwdGhlJTIwb3RoZXIlMjBwcm9jZXNzZXMuJTBBJTIwJTIwJTIwJTIwcHJpbnQoZiUyMlRoaXMlMjB3aWxsJTIwYmUlMjBwcmludGVkJTIwYnklMjBwcm9jZXNzJTIwJTdCc3RhdGUubG9jYWxfcHJvY2Vzc19pbmRleCU3RCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState

<span class="hljs-meta">&gt;&gt;&gt; </span>state = PartialState()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> state.local_main_process_first():
<span class="hljs-meta">... </span>    <span class="hljs-comment"># This will be printed first by local process 0 then in a seemingly</span>
<span class="hljs-meta">... </span>    <span class="hljs-comment"># random order by the other processes.</span>
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;This will be printed by process <span class="hljs-subst">{state.local_process_index}</span>&quot;</span>)`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Pa(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQSUwQWFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b3IoKSUwQXdpdGglMjBhY2NlbGVyYXRvci5tYWluX3Byb2Nlc3NfZmlyc3QoKSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyMFRoaXMlMjB3aWxsJTIwYmUlMjBwcmludGVkJTIwZmlyc3QlMjBieSUyMHByb2Nlc3MlMjAwJTIwdGhlbiUyMGluJTIwYSUyMHNlZW1pbmdseSUwQSUyMCUyMCUyMCUyMCUyMyUyMHJhbmRvbSUyMG9yZGVyJTIwYnklMjB0aGUlMjBvdGhlciUyMHByb2Nlc3Nlcy4lMEElMjAlMjAlMjAlMjBwcmludChmJTIyVGhpcyUyMHdpbGwlMjBiZSUyMHByaW50ZWQlMjBieSUyMHByb2Nlc3MlMjAlN0JhY2NlbGVyYXRvci5wcm9jZXNzX2luZGV4JTdEJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator

<span class="hljs-meta">&gt;&gt;&gt; </span>accelerator = Accelerator()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> accelerator.main_process_first():
<span class="hljs-meta">... </span>    <span class="hljs-comment"># This will be printed first by process 0 then in a seemingly</span>
<span class="hljs-meta">... </span>    <span class="hljs-comment"># random order by the other processes.</span>
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;This will be printed by process <span class="hljs-subst">{accelerator.process_index}</span>&quot;</span>)`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Qa(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"JTIzJTIwQXNzdW1lJTIwd2UlMjBoYXZlJTIwNCUyMHByb2Nlc3Nlcy4lMEFmcm9tJTIwYWNjZWxlcmF0ZS5zdGF0ZSUyMGltcG9ydCUyMFBhcnRpYWxTdGF0ZSUwQSUwQXN0YXRlJTIwJTNEJTIwUGFydGlhbFN0YXRlKCklMEElMEElMEElNDBzdGF0ZS5vbl9sYXN0X3Byb2Nlc3MlMEFkZWYlMjBwcmludF9zb21ldGhpbmcoKSUzQSUwQSUyMCUyMCUyMCUyMHByaW50KGYlMjJQcmludGVkJTIwb24lMjBwcm9jZXNzJTIwJTdCc3RhdGUucHJvY2Vzc19pbmRleCU3RCUyMiklMEElMEElMEFwcmludF9zb21ldGhpbmcoKSUwQSUyMlByaW50ZWQlMjBvbiUyMHByb2Nlc3MlMjAzJTIy",highlighted:`<span class="hljs-comment"># Assume we have 4 processes.</span>
<span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState

state = PartialState()


<span class="hljs-meta">@state.on_last_process</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">print_something</span>():
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Printed on process <span class="hljs-subst">{state.process_index}</span>&quot;</span>)


print_something()
<span class="hljs-string">&quot;Printed on process 3&quot;</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Wa(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"JTIzJTIwQXNzdW1lJTIwd2UlMjBoYXZlJTIwMiUyMHNlcnZlcnMlMjB3aXRoJTIwNCUyMHByb2Nlc3NlcyUyMGVhY2guJTBBZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBJTBBJTBBJTQwc3RhdGUub25fbG9jYWxfbWFpbl9wcm9jZXNzJTBBZGVmJTIwcHJpbnRfc29tZXRoaW5nKCklM0ElMEElMjAlMjAlMjAlMjBwcmludCglMjJUaGlzJTIwd2lsbCUyMGJlJTIwcHJpbnRlZCUyMGJ5JTIwcHJvY2VzcyUyMDAlMjBvbmx5JTIwb24lMjBlYWNoJTIwc2VydmVyLiUyMiklMEElMEElMEFwcmludF9zb21ldGhpbmcoKSUwQSUyMyUyME9uJTIwc2VydmVyJTIwMSUzQSUwQSUyMlRoaXMlMjB3aWxsJTIwYmUlMjBwcmludGVkJTIwYnklMjBwcm9jZXNzJTIwMCUyMG9ubHklMjIlMEElMjMlMjBPbiUyMHNlcnZlciUyMDIlM0ElMEElMjJUaGlzJTIwd2lsbCUyMGJlJTIwcHJpbnRlZCUyMGJ5JTIwcHJvY2VzcyUyMDAlMjBvbmx5JTIy",highlighted:`<span class="hljs-comment"># Assume we have 2 servers with 4 processes each.</span>
<span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState

state = PartialState()


<span class="hljs-meta">@state.on_local_main_process</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">print_something</span>():
    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;This will be printed by process 0 only on each server.&quot;</span>)


print_something()
<span class="hljs-comment"># On server 1:</span>
<span class="hljs-string">&quot;This will be printed by process 0 only&quot;</span>
<span class="hljs-comment"># On server 2:</span>
<span class="hljs-string">&quot;This will be printed by process 0 only&quot;</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function za(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"JTIzJTIwQXNzdW1lJTIwd2UlMjBoYXZlJTIwMiUyMHNlcnZlcnMlMjB3aXRoJTIwNCUyMHByb2Nlc3NlcyUyMGVhY2guJTBBZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQSUwQWFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b3IoKSUwQSUwQSUwQSU0MGFjY2VsZXJhdG9yLm9uX2xvY2FsX3Byb2Nlc3MobG9jYWxfcHJvY2Vzc19pbmRleCUzRDIpJTBBZGVmJTIwcHJpbnRfc29tZXRoaW5nKCklM0ElMEElMjAlMjAlMjAlMjBwcmludChmJTIyUHJpbnRlZCUyMG9uJTIwcHJvY2VzcyUyMCU3QmFjY2VsZXJhdG9yLmxvY2FsX3Byb2Nlc3NfaW5kZXglN0QlMjIpJTBBJTBBJTBBcHJpbnRfc29tZXRoaW5nKCklMEElMjMlMjBPbiUyMHNlcnZlciUyMDElM0ElMEElMjJQcmludGVkJTIwb24lMjBwcm9jZXNzJTIwMiUyMiUwQSUyMyUyME9uJTIwc2VydmVyJTIwMiUzQSUwQSUyMlByaW50ZWQlMjBvbiUyMHByb2Nlc3MlMjAyJTIy",highlighted:`<span class="hljs-comment"># Assume we have 2 servers with 4 processes each.</span>
<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator

accelerator = Accelerator()


<span class="hljs-meta">@accelerator.on_local_process(<span class="hljs-params">local_process_index=<span class="hljs-number">2</span></span>)</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">print_something</span>():
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Printed on process <span class="hljs-subst">{accelerator.local_process_index}</span>&quot;</span>)


print_something()
<span class="hljs-comment"># On server 1:</span>
<span class="hljs-string">&quot;Printed on process 2&quot;</span>
<span class="hljs-comment"># On server 2:</span>
<span class="hljs-string">&quot;Printed on process 2&quot;</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Fa(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBJTBBJTBBJTQwc3RhdGUub25fbWFpbl9wcm9jZXNzJTBBZGVmJTIwcHJpbnRfc29tZXRoaW5nKCklM0ElMEElMjAlMjAlMjAlMjBwcmludCglMjJUaGlzJTIwd2lsbCUyMGJlJTIwcHJpbnRlZCUyMGJ5JTIwcHJvY2VzcyUyMDAlMjBvbmx5LiUyMiklMEElMEElMEFwcmludF9zb21ldGhpbmcoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState

<span class="hljs-meta">&gt;&gt;&gt; </span>state = PartialState()


<span class="hljs-meta">&gt;&gt;&gt; </span>@state.on_main_process
<span class="hljs-meta">... </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">print_something</span>():
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;This will be printed by process 0 only.&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span>print_something()
<span class="hljs-string">&quot;This will be printed by process 0 only&quot;</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Ha(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"JTIzJTIwQXNzdW1lJTIwd2UlMjBoYXZlJTIwNCUyMHByb2Nlc3Nlcy4lMEFmcm9tJTIwYWNjZWxlcmF0ZS5zdGF0ZSUyMGltcG9ydCUyMFBhcnRpYWxTdGF0ZSUwQSUwQXN0YXRlJTIwJTNEJTIwUGFydGlhbFN0YXRlKCklMEElMEElMEElNDBzdGF0ZS5vbl9wcm9jZXNzKHByb2Nlc3NfaW5kZXglM0QyKSUwQWRlZiUyMHByaW50X3NvbWV0aGluZygpJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoZiUyMlByaW50ZWQlMjBvbiUyMHByb2Nlc3MlMjAlN0JzdGF0ZS5wcm9jZXNzX2luZGV4JTdEJTIyKSUwQSUwQSUwQXByaW50X3NvbWV0aGluZygpJTBBJTIyUHJpbnRlZCUyMG9uJTIwcHJvY2VzcyUyMDIlMjI=",highlighted:`<span class="hljs-comment"># Assume we have 4 processes.</span>
<span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState

state = PartialState()


<span class="hljs-meta">@state.on_process(<span class="hljs-params">process_index=<span class="hljs-number">2</span></span>)</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">print_something</span>():
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Printed on process <span class="hljs-subst">{state.process_index}</span>&quot;</span>)


print_something()
<span class="hljs-string">&quot;Printed on process 2&quot;</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Va(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"JTIzJTIwQXNzdW1lJTIwdGhlcmUlMjBhcmUlMjB0d28lMjBwcm9jZXNzZXMlMEFmcm9tJTIwYWNjZWxlcmF0ZSUyMGltcG9ydCUyMFBhcnRpYWxTdGF0ZSUwQSUwQXN0YXRlJTIwJTNEJTIwUGFydGlhbFN0YXRlKCklMEF3aXRoJTIwc3RhdGUuc3BsaXRfYmV0d2Vlbl9wcm9jZXNzZXMoJTVCJTIyQSUyMiUyQyUyMCUyMkIlMjIlMkMlMjAlMjJDJTIyJTVEKSUyMGFzJTIwaW5wdXRzJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoaW5wdXRzKSUwQSUyMyUyMFByb2Nlc3MlMjAwJTBBJTVCJTIyQSUyMiUyQyUyMCUyMkIlMjIlNUQlMEElMjMlMjBQcm9jZXNzJTIwMSUwQSU1QiUyMkMlMjIlNUQlMEElMEF3aXRoJTIwc3RhdGUuc3BsaXRfYmV0d2Vlbl9wcm9jZXNzZXMoJTVCJTIyQSUyMiUyQyUyMCUyMkIlMjIlMkMlMjAlMjJDJTIyJTVEJTJDJTIwYXBwbHlfcGFkZGluZyUzRFRydWUpJTIwYXMlMjBpbnB1dHMlM0ElMEElMjAlMjAlMjAlMjBwcmludChpbnB1dHMpJTBBJTIzJTIwUHJvY2VzcyUyMDAlMEElNUIlMjJBJTIyJTJDJTIwJTIyQiUyMiU1RCUwQSUyMyUyMFByb2Nlc3MlMjAxJTBBJTVCJTIyQyUyMiUyQyUyMCUyMkMlMjIlNUQ=",highlighted:`<span class="hljs-comment"># Assume there are two processes</span>
<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> PartialState

state = PartialState()
<span class="hljs-keyword">with</span> state.split_between_processes([<span class="hljs-string">&quot;A&quot;</span>, <span class="hljs-string">&quot;B&quot;</span>, <span class="hljs-string">&quot;C&quot;</span>]) <span class="hljs-keyword">as</span> inputs:
    <span class="hljs-built_in">print</span>(inputs)
<span class="hljs-comment"># Process 0</span>
[<span class="hljs-string">&quot;A&quot;</span>, <span class="hljs-string">&quot;B&quot;</span>]
<span class="hljs-comment"># Process 1</span>
[<span class="hljs-string">&quot;C&quot;</span>]

<span class="hljs-keyword">with</span> state.split_between_processes([<span class="hljs-string">&quot;A&quot;</span>, <span class="hljs-string">&quot;B&quot;</span>, <span class="hljs-string">&quot;C&quot;</span>], apply_padding=<span class="hljs-literal">True</span>) <span class="hljs-keyword">as</span> inputs:
    <span class="hljs-built_in">print</span>(inputs)
<span class="hljs-comment"># Process 0</span>
[<span class="hljs-string">&quot;A&quot;</span>, <span class="hljs-string">&quot;B&quot;</span>]
<span class="hljs-comment"># Process 1</span>
[<span class="hljs-string">&quot;C&quot;</span>, <span class="hljs-string">&quot;C&quot;</span>]`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Ra(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"JTIzJTIwQXNzdW1pbmclMjB0d28lMjBHUFUlMjBwcm9jZXNzZXMlMEFpbXBvcnQlMjB0aW1lJTBBZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBaWYlMjBzdGF0ZS5pc19tYWluX3Byb2Nlc3MlM0ElMEElMjAlMjAlMjAlMjB0aW1lLnNsZWVwKDIpJTBBZWxzZSUzQSUwQSUyMCUyMCUyMCUyMHByaW50KCUyMkknbSUyMHdhaXRpbmclMjBmb3IlMjB0aGUlMjBtYWluJTIwcHJvY2VzcyUyMHRvJTIwZmluaXNoJTIwaXRzJTIwc2xlZXAuLi4lMjIpJTBBc3RhdGUud2FpdF9mb3JfZXZlcnlvbmUoKSUwQSUyMyUyMFNob3VsZCUyMHByaW50JTIwb24lMjBldmVyeSUyMHByb2Nlc3MlMjBhdCUyMHRoZSUyMHNhbWUlMjB0aW1lJTBBcHJpbnQoJTIyRXZlcnlvbmUlMjBpcyUyMGhlcmUlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Assuming two GPU processes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> time
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState

<span class="hljs-meta">&gt;&gt;&gt; </span>state = PartialState()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">if</span> state.is_main_process:
<span class="hljs-meta">... </span>    time.sleep(<span class="hljs-number">2</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">else</span>:
<span class="hljs-meta">... </span>    <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;I&#x27;m waiting for the main process to finish its sleep...&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>state.wait_for_everyone()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Should print on every process at the same time</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Everyone is here&quot;</span>)`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Ya(T){let a,j="Example:",d,n,p;return n=new W({props:{code:"JTIzJTIwQXNzdW1lJTIwdGhlcmUlMjBhcmUlMjB0d28lMjBwcm9jZXNzZXMlMEFmcm9tJTIwYWNjZWxlcmF0ZS5zdGF0ZSUyMGltcG9ydCUyMEFjY2VsZXJhdG9yU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMEFjY2VsZXJhdG9yU3RhdGUoKSUwQXdpdGglMjBzdGF0ZS5zcGxpdF9iZXR3ZWVuX3Byb2Nlc3NlcyglNUIlMjJBJTIyJTJDJTIwJTIyQiUyMiUyQyUyMCUyMkMlMjIlNUQpJTIwYXMlMjBpbnB1dHMlM0ElMEElMjAlMjAlMjAlMjBwcmludChpbnB1dHMpJTBBJTIzJTIwUHJvY2VzcyUyMDAlMEElNUIlMjJBJTIyJTJDJTIwJTIyQiUyMiU1RCUwQSUyMyUyMFByb2Nlc3MlMjAxJTBBJTVCJTIyQyUyMiU1RCUwQSUwQXdpdGglMjBzdGF0ZS5zcGxpdF9iZXR3ZWVuX3Byb2Nlc3NlcyglNUIlMjJBJTIyJTJDJTIwJTIyQiUyMiUyQyUyMCUyMkMlMjIlNUQlMkMlMjBhcHBseV9wYWRkaW5nJTNEVHJ1ZSklMjBhcyUyMGlucHV0cyUzQSUwQSUyMCUyMCUyMCUyMHByaW50KGlucHV0cyklMEElMjMlMjBQcm9jZXNzJTIwMCUwQSU1QiUyMkElMjIlMkMlMjAlMjJCJTIyJTVEJTBBJTIzJTIwUHJvY2VzcyUyMDElMEElNUIlMjJDJTIyJTJDJTIwJTIyQyUyMiU1RA==",highlighted:`<span class="hljs-comment"># Assume there are two processes</span>
<span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> AcceleratorState

state = AcceleratorState()
<span class="hljs-keyword">with</span> state.split_between_processes([<span class="hljs-string">&quot;A&quot;</span>, <span class="hljs-string">&quot;B&quot;</span>, <span class="hljs-string">&quot;C&quot;</span>]) <span class="hljs-keyword">as</span> inputs:
    <span class="hljs-built_in">print</span>(inputs)
<span class="hljs-comment"># Process 0</span>
[<span class="hljs-string">&quot;A&quot;</span>, <span class="hljs-string">&quot;B&quot;</span>]
<span class="hljs-comment"># Process 1</span>
[<span class="hljs-string">&quot;C&quot;</span>]

<span class="hljs-keyword">with</span> state.split_between_processes([<span class="hljs-string">&quot;A&quot;</span>, <span class="hljs-string">&quot;B&quot;</span>, <span class="hljs-string">&quot;C&quot;</span>], apply_padding=<span class="hljs-literal">True</span>) <span class="hljs-keyword">as</span> inputs:
    <span class="hljs-built_in">print</span>(inputs)
<span class="hljs-comment"># Process 0</span>
[<span class="hljs-string">&quot;A&quot;</span>, <span class="hljs-string">&quot;B&quot;</span>]
<span class="hljs-comment"># Process 1</span>
[<span class="hljs-string">&quot;C&quot;</span>, <span class="hljs-string">&quot;C&quot;</span>]`,wrap:!1}}),{c(){a=o("p"),a.textContent=j,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=j),d=r(e),g(n.$$.fragment,e)},m(e,m){w(e,a,m),w(e,d,m),f(n,e,m),p=!0},p:Q,i(e){p||(b(n.$$.fragment,e),p=!0)},o(e){y(n.$$.fragment,e),p=!1},d(e){e&&(i(a),i(d)),M(n,e)}}}function Aa(T){let a,j,d,n,p,e,m,Ds=`Below are variations of a <a href="https://en.wikipedia.org/wiki/Singleton_pattern" rel="nofollow">singleton class</a> in the sense that all
instances share the same state, which is initialized on the first instantiation.`,Ct,Me,Ls=`These classes are immutable and store information about certain configurations or
states.`,It,$e,St,_,we,Ft,Re,Ks=`Singleton class that has information about the current training environment and functions to help with process
control. Designed to be used when only process control and device execution states are needed. Does <em>not</em> need to
be initialized from <code>Accelerator</code>.`,Ht,Ye,Os="<strong>Available attributes:</strong>",Vt,Ae,ea=`<li><strong>device</strong> (<code>torch.device</code>) — The device to use.</li> <li><strong>distributed_type</strong> (<a href="/docs/accelerate/main/en/package_reference/utilities#accelerate.DistributedType">DistributedType</a>) — The type of distributed environment currently
in use.</li> <li><strong>local_process_index</strong> (<code>int</code>) — The index of the current process on the current server.</li> <li><strong>mixed_precision</strong> (<code>str</code>) — Whether or not the current script will use mixed precision, and if so the type
of mixed precision being performed. (Choose from ‘no’,‘fp16’,‘bf16 or ‘fp8’).</li> <li><strong>num_processes</strong> (<code>int</code>) — The number of processes currently launched in parallel.</li> <li><strong>process_index</strong> (<code>int</code>) — The index of the current process.</li> <li><strong>is_last_process</strong> (<code>bool</code>) — Whether or not the current process is the last one.</li> <li><strong>is_main_process</strong> (<code>bool</code>) — Whether or not the current process is the main one.</li> <li><strong>is_local_main_process</strong> (<code>bool</code>) — Whether or not the current process is the main one on the local node.</li> <li><strong>debug</strong> (<code>bool</code>) — Whether or not the current script is being run in debug mode.</li>`,Rt,se,Yt,ae,je,At,qe,ta="Destroys the process group. If one is not specified, the default process group is destroyed.",qt,S,_e,Dt,De,sa="Lets the local main process go inside a with block.",Lt,Le,aa="The other processes will enter the with block after the main process exits.",Kt,ne,Ot,G,ve,es,Ke,na="Lets the main process go first inside a with block.",ts,Oe,la="The other processes will enter the with block after the main process exits.",ss,le,as,z,Ue,ns,et,ra="Decorator that only runs the decorated function on the last process.",ls,re,rs,F,Te,os,tt,oa="Decorator that only runs the decorated function on the local main process.",cs,oe,is,H,Je,ps,st,ca="Decorator that only runs the decorated function on the process with the given index on the current node.",ds,ce,ms,V,xe,hs,at,ia="Decorator that only runs the decorated function on the main process.",us,ie,gs,R,Be,fs,nt,pa="Decorator that only runs the decorated function on the process with the given index.",bs,pe,ys,de,Ce,Ms,lt,da="Sets the device in <code>self.device</code> to the current distributed environment.",$s,E,Ie,ws,rt,ma=`Splits <code>input</code> between <code>self.num_processes</code> quickly and can be then used on that process. Useful when doing
distributed inference, such as with different prompts.`,js,ot,ha="Note that when using a <code>dict</code>, all keys need to have the same number of elements.",_s,me,vs,Y,Se,Us,ct,ua=`Will stop the execution of the current process until every other process has reached that point (so this does
nothing when the script is only run in one process). Useful to do before saving a model.`,Ts,he,Gt,Ge,Et,U,Ee,Js,it,ga="Singleton class that has information about the current training environment.",xs,pt,fa="<strong>Available attributes:</strong>",Bs,dt,ba=`<li><strong>device</strong> (<code>torch.device</code>) — The device to use.</li> <li><strong>distributed_type</strong> (<a href="/docs/accelerate/main/en/package_reference/utilities#accelerate.DistributedType">DistributedType</a>) — The type of distributed environment currently
in use.</li> <li><strong>parallelism_config</strong> (<code>ParallelismConfig</code>) — The parallelism configuration for the
current training environment. This is used to configure the distributed training environment.</li> <li><strong>initialized</strong> (<code>bool</code>) — Whether or not the <code>AcceleratorState</code> has been initialized from <code>Accelerator</code>.</li> <li><strong>local_process_index</strong> (<code>int</code>) — The index of the current process on the current server.</li> <li><strong>mixed_precision</strong> (<code>str</code>) — Whether or not the current script will use mixed precision, and if so the type
of mixed precision being performed. (Choose from ‘no’,‘fp16’,‘bf16 or ‘fp8’).</li> <li><strong>num_processes</strong> (<code>int</code>) — The number of processes currently launched in parallel.</li> <li><strong>process_index</strong> (<code>int</code>) — The index of the current process.</li> <li><strong>is_last_process</strong> (<code>bool</code>) — Whether or not the current process is the last one.</li> <li><strong>is_main_process</strong> (<code>bool</code>) — Whether or not the current process is the main one.</li> <li><strong>is_local_main_process</strong> (<code>bool</code>) — Whether or not the current process is the main one on the local node.</li> <li><strong>debug</strong> (<code>bool</code>) — Whether or not the current script is being run in debug mode.</li>`,Cs,A,ke,Is,mt,ya="Destroys the process group. If one is not specified, the default process group is destroyed.",Ss,ht,Ma="If <code>self.fork_lauched</code> is <code>True</code> and <code>group</code> is <code>None</code>, nothing happens.",Gs,ue,Ne,Es,ut,$a="Returns the DeepSpeedPlugin with the given plugin_key.",ks,q,Ze,Ns,gt,wa="Lets the local main process go inside a with block.",Zs,ft,ja="The other processes will enter the with block after the main process exits.",Xs,D,Xe,Ps,bt,_a="Lets the main process go first inside a with block.",Qs,yt,va="The other processes will enter the with block after the main process exits.",Ws,ge,Pe,zs,Mt,Ua="Activates the DeepSpeedPlugin with the given <code>name</code>, and will disable all other plugins.",Fs,k,Qe,Hs,$t,Ta=`Splits <code>input</code> between <code>self.num_processes</code> quickly and can be then used on that process. Useful when doing
distributed inference, such as with different prompts.`,Vs,wt,Ja="Note that when using a <code>dict</code>, all keys need to have the same number of elements.",Rs,fe,kt,We,Nt,I,ze,Ys,jt,xa="Singleton class that has information related to gradient synchronization for gradient accumulation",As,_t,Ba="<strong>Available attributes:</strong>",qs,vt,Ca=`<li><strong>end_of_dataloader</strong> (<code>bool</code>) — Whether we have reached the end the current dataloader</li> <li><strong>remainder</strong> (<code>int</code>) — The number of extra samples that were added from padding the dataloader</li> <li><strong>sync_gradients</strong> (<code>bool</code>) — Whether the gradients should be synced across all devices</li> <li><strong>active_dataloader</strong> (<code>Optional[DataLoader]</code>) — The dataloader that is currently being iterated over</li> <li><strong>dataloader_references</strong> (<code>List[Optional[DataLoader]]</code>) — A list of references to the dataloaders that are
being iterated over</li> <li><strong>num_steps</strong> (<code>int</code>) — The number of steps to accumulate over</li> <li><strong>adjust_scheduler</strong> (<code>bool</code>) — Whether the scheduler should be adjusted to account for the gradient
accumulation</li> <li><strong>sync_with_dataloader</strong> (<code>bool</code>) — Whether the gradients should be synced at the end of the dataloader
iteration and the number of total steps reset</li> <li><strong>is_xla_gradients_synced</strong> (<code>bool</code>) — Whether the XLA gradients have been synchronized. It is initialized
as false. Once gradients have been reduced before the optimizer step, this flag is set to true. Subsequently,
after each step, the flag is reset to false. FSDP will always synchronize the gradients, hence
is_xla_gradients_synced is always true.</li>`,Zt,Fe,Xt,Bt,Pt;return p=new zt({props:{title:"Stateful Classes",local:"stateful-classes",headingTag:"h1"}}),$e=new zt({props:{title:"PartialState",local:"accelerate.PartialState",headingTag:"h2"}}),we=new C({props:{name:"class accelerate.PartialState",anchor:"accelerate.PartialState",parameters:[{name:"cpu",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"accelerate.PartialState.cpu",description:`<strong>cpu</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to force the script to execute on CPU. Will ignore any accelerators available if set to
<code>True</code> and force the execution on the CPU.`,name:"cpu"},{anchor:"accelerate.PartialState.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the relevant <code>init_process_group</code> function. Valid <code>kwargs</code> can be
found in <a href="/docs/accelerate/main/en/package_reference/kwargs#accelerate.InitProcessGroupKwargs">utils.InitProcessGroupKwargs</a>. See the example section for detailed usage.`,name:"kwargs"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L124"}}),se=new P({props:{anchor:"accelerate.PartialState.example",$$slots:{default:[Za]},$$scope:{ctx:T}}}),je=new C({props:{name:"destroy_process_group",anchor:"accelerate.PartialState.destroy_process_group",parameters:[{name:"group",val:" = None"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L842"}}),_e=new C({props:{name:"local_main_process_first",anchor:"accelerate.PartialState.local_main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L530"}}),ne=new P({props:{anchor:"accelerate.PartialState.local_main_process_first.example",$$slots:{default:[Xa]},$$scope:{ctx:T}}}),ve=new C({props:{name:"main_process_first",anchor:"accelerate.PartialState.main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L509"}}),le=new P({props:{anchor:"accelerate.PartialState.main_process_first.example",$$slots:{default:[Pa]},$$scope:{ctx:T}}}),Ue=new C({props:{name:"on_last_process",anchor:"accelerate.PartialState.on_last_process",parameters:[{name:"function",val:": Callable[..., Any]"}],parametersDescription:[{anchor:"accelerate.PartialState.on_last_process.function",description:"<strong>function</strong> (<code>Callable</code>) &#x2014; The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L612"}}),re=new P({props:{anchor:"accelerate.PartialState.on_last_process.example",$$slots:{default:[Qa]},$$scope:{ctx:T}}}),Te=new C({props:{name:"on_local_main_process",anchor:"accelerate.PartialState.on_local_main_process",parameters:[{name:"function",val:": Callable[..., Any] = None"}],parametersDescription:[{anchor:"accelerate.PartialState.on_local_main_process.function",description:"<strong>function</strong> (<code>Callable</code>) &#x2014; The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L581"}}),oe=new P({props:{anchor:"accelerate.PartialState.on_local_main_process.example",$$slots:{default:[Wa]},$$scope:{ctx:T}}}),Je=new C({props:{name:"on_local_process",anchor:"accelerate.PartialState.on_local_process",parameters:[{name:"function",val:": Callable[..., Any] = None"},{name:"local_process_index",val:": int = None"}],parametersDescription:[{anchor:"accelerate.PartialState.on_local_process.function",description:`<strong>function</strong> (<code>Callable</code>, <em>optional</em>) &#x2014;
The function to decorate.`,name:"function"},{anchor:"accelerate.PartialState.on_local_process.local_process_index",description:`<strong>local_process_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The index of the local process on which to run the function.`,name:"local_process_index"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L673"}}),ce=new P({props:{anchor:"accelerate.PartialState.on_local_process.example",$$slots:{default:[za]},$$scope:{ctx:T}}}),xe=new C({props:{name:"on_main_process",anchor:"accelerate.PartialState.on_main_process",parameters:[{name:"function",val:": Callable[..., Any] = None"}],parametersDescription:[{anchor:"accelerate.PartialState.on_main_process.function",description:"<strong>function</strong> (<code>Callable</code>) &#x2014; The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L551"}}),ie=new P({props:{anchor:"accelerate.PartialState.on_main_process.example",$$slots:{default:[Fa]},$$scope:{ctx:T}}}),Be=new C({props:{name:"on_process",anchor:"accelerate.PartialState.on_process",parameters:[{name:"function",val:": Callable[..., Any] = None"},{name:"process_index",val:": int = None"}],parametersDescription:[{anchor:"accelerate.PartialState.on_process.function",description:`<strong>function</strong> (<code>Callable</code>, <code>optional</code>) &#x2014;
The function to decorate.`,name:"function"},{anchor:"accelerate.PartialState.on_process.process_index",description:`<strong>process_index</strong> (<code>int</code>, <code>optional</code>) &#x2014;
The index of the process on which to run the function.`,name:"process_index"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L640"}}),pe=new P({props:{anchor:"accelerate.PartialState.on_process.example",$$slots:{default:[Ha]},$$scope:{ctx:T}}}),Ce=new C({props:{name:"set_device",anchor:"accelerate.PartialState.set_device",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L816"}}),Ie=new C({props:{name:"split_between_processes",anchor:"accelerate.PartialState.split_between_processes",parameters:[{name:"inputs",val:": list | tuple | dict | torch.Tensor"},{name:"apply_padding",val:": bool = False"}],parametersDescription:[{anchor:"accelerate.PartialState.split_between_processes.inputs",description:`<strong>inputs</strong> (<code>list</code>, <code>tuple</code>, <code>torch.Tensor</code>, <code>dict</code> of <code>list</code>/<code>tuple</code>/<code>torch.Tensor</code>, or <code>datasets.Dataset</code>) &#x2014;
The input to split between processes.`,name:"inputs"},{anchor:"accelerate.PartialState.split_between_processes.apply_padding",description:`<strong>apply_padding</strong> (<code>bool</code>, <code>optional</code>, defaults to <code>False</code>) &#x2014;
Whether to apply padding by repeating the last element of the input so that all processes have the same
number of elements. Useful when trying to perform actions such as <code>gather()</code> on the outputs or passing
in less inputs than there are processes. If so, just remember to drop the padded elements afterwards.`,name:"apply_padding"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L418"}}),me=new P({props:{anchor:"accelerate.PartialState.split_between_processes.example",$$slots:{default:[Va]},$$scope:{ctx:T}}}),Se=new C({props:{name:"wait_for_everyone",anchor:"accelerate.PartialState.wait_for_everyone",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L371"}}),he=new P({props:{anchor:"accelerate.PartialState.wait_for_everyone.example",$$slots:{default:[Ra]},$$scope:{ctx:T}}}),Ge=new zt({props:{title:"AcceleratorState",local:"accelerate.state.AcceleratorState",headingTag:"h2"}}),Ee=new C({props:{name:"class accelerate.state.AcceleratorState",anchor:"accelerate.state.AcceleratorState",parameters:[{name:"mixed_precision",val:": str = None"},{name:"cpu",val:": bool = False"},{name:"dynamo_plugin",val:" = None"},{name:"deepspeed_plugin",val:" = None"},{name:"fsdp_plugin",val:" = None"},{name:"torch_tp_plugin",val:" = None"},{name:"megatron_lm_plugin",val:" = None"},{name:"_from_accelerator",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L865"}}),ke=new C({props:{name:"destroy_process_group",anchor:"accelerate.state.AcceleratorState.destroy_process_group",parameters:[{name:"group",val:" = None"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L1077"}}),Ne=new C({props:{name:"get_deepspeed_plugin",anchor:"accelerate.state.AcceleratorState.get_deepspeed_plugin",parameters:[{name:"name",val:": str"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L1194"}}),Ze=new C({props:{name:"local_main_process_first",anchor:"accelerate.state.AcceleratorState.local_main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L1170"}}),Xe=new C({props:{name:"main_process_first",anchor:"accelerate.state.AcceleratorState.main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L1160"}}),Pe=new C({props:{name:"select_deepspeed_plugin",anchor:"accelerate.state.AcceleratorState.select_deepspeed_plugin",parameters:[{name:"name",val:": str = None"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L1201"}}),Qe=new C({props:{name:"split_between_processes",anchor:"accelerate.state.AcceleratorState.split_between_processes",parameters:[{name:"inputs",val:": list | tuple | dict | torch.Tensor"},{name:"apply_padding",val:": bool = False"}],parametersDescription:[{anchor:"accelerate.state.AcceleratorState.split_between_processes.inputs",description:`<strong>inputs</strong> (<code>list</code>, <code>tuple</code>, <code>torch.Tensor</code>, or <code>dict</code> of <code>list</code>/<code>tuple</code>/<code>torch.Tensor</code>) &#x2014;
The input to split between processes.`,name:"inputs"},{anchor:"accelerate.state.AcceleratorState.split_between_processes.apply_padding",description:`<strong>apply_padding</strong> (<code>bool</code>, <code>optional</code>, defaults to <code>False</code>) &#x2014;
Whether to apply padding by repeating the last element of the input so that all processes have the same
number of elements. Useful when trying to perform actions such as <code>gather()</code> on the outputs or passing
in less inputs than there are processes. If so, just remember to drop the padded elements afterwards.`,name:"apply_padding"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L1118"}}),fe=new P({props:{anchor:"accelerate.state.AcceleratorState.split_between_processes.example",$$slots:{default:[Ya]},$$scope:{ctx:T}}}),We=new zt({props:{title:"GradientState",local:"accelerate.state.GradientState",headingTag:"h2"}}),ze=new C({props:{name:"class accelerate.state.GradientState",anchor:"accelerate.state.GradientState",parameters:[{name:"gradient_accumulation_plugin",val:": GradientAccumulationPlugin | None = None"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/state.py#L1227"}}),Fe=new Na({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/package_reference/state.md"}}),{c(){a=o("meta"),j=l(),d=o("p"),n=l(),u(p.$$.fragment),e=l(),m=o("p"),m.innerHTML=Ds,Ct=l(),Me=o("p"),Me.textContent=Ls,It=l(),u($e.$$.fragment),St=l(),_=o("div"),u(we.$$.fragment),Ft=l(),Re=o("p"),Re.innerHTML=Ks,Ht=l(),Ye=o("p"),Ye.innerHTML=Os,Vt=l(),Ae=o("ul"),Ae.innerHTML=ea,Rt=l(),u(se.$$.fragment),Yt=l(),ae=o("div"),u(je.$$.fragment),At=l(),qe=o("p"),qe.textContent=ta,qt=l(),S=o("div"),u(_e.$$.fragment),Dt=l(),De=o("p"),De.textContent=sa,Lt=l(),Le=o("p"),Le.textContent=aa,Kt=l(),u(ne.$$.fragment),Ot=l(),G=o("div"),u(ve.$$.fragment),es=l(),Ke=o("p"),Ke.textContent=na,ts=l(),Oe=o("p"),Oe.textContent=la,ss=l(),u(le.$$.fragment),as=l(),z=o("div"),u(Ue.$$.fragment),ns=l(),et=o("p"),et.textContent=ra,ls=l(),u(re.$$.fragment),rs=l(),F=o("div"),u(Te.$$.fragment),os=l(),tt=o("p"),tt.textContent=oa,cs=l(),u(oe.$$.fragment),is=l(),H=o("div"),u(Je.$$.fragment),ps=l(),st=o("p"),st.textContent=ca,ds=l(),u(ce.$$.fragment),ms=l(),V=o("div"),u(xe.$$.fragment),hs=l(),at=o("p"),at.textContent=ia,us=l(),u(ie.$$.fragment),gs=l(),R=o("div"),u(Be.$$.fragment),fs=l(),nt=o("p"),nt.textContent=pa,bs=l(),u(pe.$$.fragment),ys=l(),de=o("div"),u(Ce.$$.fragment),Ms=l(),lt=o("p"),lt.innerHTML=da,$s=l(),E=o("div"),u(Ie.$$.fragment),ws=l(),rt=o("p"),rt.innerHTML=ma,js=l(),ot=o("p"),ot.innerHTML=ha,_s=l(),u(me.$$.fragment),vs=l(),Y=o("div"),u(Se.$$.fragment),Us=l(),ct=o("p"),ct.textContent=ua,Ts=l(),u(he.$$.fragment),Gt=l(),u(Ge.$$.fragment),Et=l(),U=o("div"),u(Ee.$$.fragment),Js=l(),it=o("p"),it.textContent=ga,xs=l(),pt=o("p"),pt.innerHTML=fa,Bs=l(),dt=o("ul"),dt.innerHTML=ba,Cs=l(),A=o("div"),u(ke.$$.fragment),Is=l(),mt=o("p"),mt.textContent=ya,Ss=l(),ht=o("p"),ht.innerHTML=Ma,Gs=l(),ue=o("div"),u(Ne.$$.fragment),Es=l(),ut=o("p"),ut.textContent=$a,ks=l(),q=o("div"),u(Ze.$$.fragment),Ns=l(),gt=o("p"),gt.textContent=wa,Zs=l(),ft=o("p"),ft.textContent=ja,Xs=l(),D=o("div"),u(Xe.$$.fragment),Ps=l(),bt=o("p"),bt.textContent=_a,Qs=l(),yt=o("p"),yt.textContent=va,Ws=l(),ge=o("div"),u(Pe.$$.fragment),zs=l(),Mt=o("p"),Mt.innerHTML=Ua,Fs=l(),k=o("div"),u(Qe.$$.fragment),Hs=l(),$t=o("p"),$t.innerHTML=Ta,Vs=l(),wt=o("p"),wt.innerHTML=Ja,Rs=l(),u(fe.$$.fragment),kt=l(),u(We.$$.fragment),Nt=l(),I=o("div"),u(ze.$$.fragment),Ys=l(),jt=o("p"),jt.textContent=xa,As=l(),_t=o("p"),_t.innerHTML=Ba,qs=l(),vt=o("ul"),vt.innerHTML=Ca,Zt=l(),u(Fe.$$.fragment),Xt=l(),Bt=o("p"),this.h()},l(t){const h=ka("svelte-u9bgzb",document.head);a=c(h,"META",{name:!0,content:!0}),h.forEach(i),j=r(t),d=c(t,"P",{}),J(d).forEach(i),n=r(t),g(p.$$.fragment,t),e=r(t),m=c(t,"P",{"data-svelte-h":!0}),$(m)!=="svelte-6w5h2d"&&(m.innerHTML=Ds),Ct=r(t),Me=c(t,"P",{"data-svelte-h":!0}),$(Me)!=="svelte-n5bwiq"&&(Me.textContent=Ls),It=r(t),g($e.$$.fragment,t),St=r(t),_=c(t,"DIV",{class:!0});var v=J(_);g(we.$$.fragment,v),Ft=r(v),Re=c(v,"P",{"data-svelte-h":!0}),$(Re)!=="svelte-b0lfuj"&&(Re.innerHTML=Ks),Ht=r(v),Ye=c(v,"P",{"data-svelte-h":!0}),$(Ye)!=="svelte-17v1xbv"&&(Ye.innerHTML=Os),Vt=r(v),Ae=c(v,"UL",{"data-svelte-h":!0}),$(Ae)!=="svelte-18rbzsd"&&(Ae.innerHTML=ea),Rt=r(v),g(se.$$.fragment,v),Yt=r(v),ae=c(v,"DIV",{class:!0});var He=J(ae);g(je.$$.fragment,He),At=r(He),qe=c(He,"P",{"data-svelte-h":!0}),$(qe)!=="svelte-5dvbzj"&&(qe.textContent=ta),He.forEach(i),qt=r(v),S=c(v,"DIV",{class:!0});var N=J(S);g(_e.$$.fragment,N),Dt=r(N),De=c(N,"P",{"data-svelte-h":!0}),$(De)!=="svelte-1xrqyx2"&&(De.textContent=sa),Lt=r(N),Le=c(N,"P",{"data-svelte-h":!0}),$(Le)!=="svelte-144ycie"&&(Le.textContent=aa),Kt=r(N),g(ne.$$.fragment,N),N.forEach(i),Ot=r(v),G=c(v,"DIV",{class:!0});var Z=J(G);g(ve.$$.fragment,Z),es=r(Z),Ke=c(Z,"P",{"data-svelte-h":!0}),$(Ke)!=="svelte-f40x3x"&&(Ke.textContent=na),ts=r(Z),Oe=c(Z,"P",{"data-svelte-h":!0}),$(Oe)!=="svelte-144ycie"&&(Oe.textContent=la),ss=r(Z),g(le.$$.fragment,Z),Z.forEach(i),as=r(v),z=c(v,"DIV",{class:!0});var L=J(z);g(Ue.$$.fragment,L),ns=r(L),et=c(L,"P",{"data-svelte-h":!0}),$(et)!=="svelte-15mu2x9"&&(et.textContent=ra),ls=r(L),g(re.$$.fragment,L),L.forEach(i),rs=r(v),F=c(v,"DIV",{class:!0});var K=J(F);g(Te.$$.fragment,K),os=r(K),tt=c(K,"P",{"data-svelte-h":!0}),$(tt)!=="svelte-10pbn0p"&&(tt.textContent=oa),cs=r(K),g(oe.$$.fragment,K),K.forEach(i),is=r(v),H=c(v,"DIV",{class:!0});var O=J(H);g(Je.$$.fragment,O),ps=r(O),st=c(O,"P",{"data-svelte-h":!0}),$(st)!=="svelte-3g0as"&&(st.textContent=ca),ds=r(O),g(ce.$$.fragment,O),O.forEach(i),ms=r(v),V=c(v,"DIV",{class:!0});var ee=J(V);g(xe.$$.fragment,ee),hs=r(ee),at=c(ee,"P",{"data-svelte-h":!0}),$(at)!=="svelte-1dr4vmg"&&(at.textContent=ia),us=r(ee),g(ie.$$.fragment,ee),ee.forEach(i),gs=r(v),R=c(v,"DIV",{class:!0});var te=J(R);g(Be.$$.fragment,te),fs=r(te),nt=c(te,"P",{"data-svelte-h":!0}),$(nt)!=="svelte-1uajfn5"&&(nt.textContent=pa),bs=r(te),g(pe.$$.fragment,te),te.forEach(i),ys=r(v),de=c(v,"DIV",{class:!0});var Ve=J(de);g(Ce.$$.fragment,Ve),Ms=r(Ve),lt=c(Ve,"P",{"data-svelte-h":!0}),$(lt)!=="svelte-1ylvgoj"&&(lt.innerHTML=da),Ve.forEach(i),$s=r(v),E=c(v,"DIV",{class:!0});var X=J(E);g(Ie.$$.fragment,X),ws=r(X),rt=c(X,"P",{"data-svelte-h":!0}),$(rt)!=="svelte-xr05jy"&&(rt.innerHTML=ma),js=r(X),ot=c(X,"P",{"data-svelte-h":!0}),$(ot)!=="svelte-hvuw2l"&&(ot.innerHTML=ha),_s=r(X),g(me.$$.fragment,X),X.forEach(i),vs=r(v),Y=c(v,"DIV",{class:!0});var Ut=J(Y);g(Se.$$.fragment,Ut),Us=r(Ut),ct=c(Ut,"P",{"data-svelte-h":!0}),$(ct)!=="svelte-tmafbn"&&(ct.textContent=ua),Ts=r(Ut),g(he.$$.fragment,Ut),Ut.forEach(i),v.forEach(i),Gt=r(t),g(Ge.$$.fragment,t),Et=r(t),U=c(t,"DIV",{class:!0});var B=J(U);g(Ee.$$.fragment,B),Js=r(B),it=c(B,"P",{"data-svelte-h":!0}),$(it)!=="svelte-x2ar5c"&&(it.textContent=ga),xs=r(B),pt=c(B,"P",{"data-svelte-h":!0}),$(pt)!=="svelte-17v1xbv"&&(pt.innerHTML=fa),Bs=r(B),dt=c(B,"UL",{"data-svelte-h":!0}),$(dt)!=="svelte-1i61h69"&&(dt.innerHTML=ba),Cs=r(B),A=c(B,"DIV",{class:!0});var Tt=J(A);g(ke.$$.fragment,Tt),Is=r(Tt),mt=c(Tt,"P",{"data-svelte-h":!0}),$(mt)!=="svelte-5dvbzj"&&(mt.textContent=ya),Ss=r(Tt),ht=c(Tt,"P",{"data-svelte-h":!0}),$(ht)!=="svelte-cfxyxa"&&(ht.innerHTML=Ma),Tt.forEach(i),Gs=r(B),ue=c(B,"DIV",{class:!0});var Qt=J(ue);g(Ne.$$.fragment,Qt),Es=r(Qt),ut=c(Qt,"P",{"data-svelte-h":!0}),$(ut)!=="svelte-d5ob2p"&&(ut.textContent=$a),Qt.forEach(i),ks=r(B),q=c(B,"DIV",{class:!0});var Jt=J(q);g(Ze.$$.fragment,Jt),Ns=r(Jt),gt=c(Jt,"P",{"data-svelte-h":!0}),$(gt)!=="svelte-1xrqyx2"&&(gt.textContent=wa),Zs=r(Jt),ft=c(Jt,"P",{"data-svelte-h":!0}),$(ft)!=="svelte-144ycie"&&(ft.textContent=ja),Jt.forEach(i),Xs=r(B),D=c(B,"DIV",{class:!0});var xt=J(D);g(Xe.$$.fragment,xt),Ps=r(xt),bt=c(xt,"P",{"data-svelte-h":!0}),$(bt)!=="svelte-f40x3x"&&(bt.textContent=_a),Qs=r(xt),yt=c(xt,"P",{"data-svelte-h":!0}),$(yt)!=="svelte-144ycie"&&(yt.textContent=va),xt.forEach(i),Ws=r(B),ge=c(B,"DIV",{class:!0});var Wt=J(ge);g(Pe.$$.fragment,Wt),zs=r(Wt),Mt=c(Wt,"P",{"data-svelte-h":!0}),$(Mt)!=="svelte-13ng0ld"&&(Mt.innerHTML=Ua),Wt.forEach(i),Fs=r(B),k=c(B,"DIV",{class:!0});var be=J(k);g(Qe.$$.fragment,be),Hs=r(be),$t=c(be,"P",{"data-svelte-h":!0}),$($t)!=="svelte-xr05jy"&&($t.innerHTML=Ta),Vs=r(be),wt=c(be,"P",{"data-svelte-h":!0}),$(wt)!=="svelte-hvuw2l"&&(wt.innerHTML=Ja),Rs=r(be),g(fe.$$.fragment,be),be.forEach(i),B.forEach(i),kt=r(t),g(We.$$.fragment,t),Nt=r(t),I=c(t,"DIV",{class:!0});var ye=J(I);g(ze.$$.fragment,ye),Ys=r(ye),jt=c(ye,"P",{"data-svelte-h":!0}),$(jt)!=="svelte-1pw2ldw"&&(jt.textContent=xa),As=r(ye),_t=c(ye,"P",{"data-svelte-h":!0}),$(_t)!=="svelte-17v1xbv"&&(_t.innerHTML=Ba),qs=r(ye),vt=c(ye,"UL",{"data-svelte-h":!0}),$(vt)!=="svelte-kdkw1r"&&(vt.innerHTML=Ca),ye.forEach(i),Zt=r(t),g(Fe.$$.fragment,t),Xt=r(t),Bt=c(t,"P",{}),J(Bt).forEach(i),this.h()},h(){x(a,"name","hf:doc:metadata"),x(a,"content",qa),x(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){s(document.head,a),w(t,j,h),w(t,d,h),w(t,n,h),f(p,t,h),w(t,e,h),w(t,m,h),w(t,Ct,h),w(t,Me,h),w(t,It,h),f($e,t,h),w(t,St,h),w(t,_,h),f(we,_,null),s(_,Ft),s(_,Re),s(_,Ht),s(_,Ye),s(_,Vt),s(_,Ae),s(_,Rt),f(se,_,null),s(_,Yt),s(_,ae),f(je,ae,null),s(ae,At),s(ae,qe),s(_,qt),s(_,S),f(_e,S,null),s(S,Dt),s(S,De),s(S,Lt),s(S,Le),s(S,Kt),f(ne,S,null),s(_,Ot),s(_,G),f(ve,G,null),s(G,es),s(G,Ke),s(G,ts),s(G,Oe),s(G,ss),f(le,G,null),s(_,as),s(_,z),f(Ue,z,null),s(z,ns),s(z,et),s(z,ls),f(re,z,null),s(_,rs),s(_,F),f(Te,F,null),s(F,os),s(F,tt),s(F,cs),f(oe,F,null),s(_,is),s(_,H),f(Je,H,null),s(H,ps),s(H,st),s(H,ds),f(ce,H,null),s(_,ms),s(_,V),f(xe,V,null),s(V,hs),s(V,at),s(V,us),f(ie,V,null),s(_,gs),s(_,R),f(Be,R,null),s(R,fs),s(R,nt),s(R,bs),f(pe,R,null),s(_,ys),s(_,de),f(Ce,de,null),s(de,Ms),s(de,lt),s(_,$s),s(_,E),f(Ie,E,null),s(E,ws),s(E,rt),s(E,js),s(E,ot),s(E,_s),f(me,E,null),s(_,vs),s(_,Y),f(Se,Y,null),s(Y,Us),s(Y,ct),s(Y,Ts),f(he,Y,null),w(t,Gt,h),f(Ge,t,h),w(t,Et,h),w(t,U,h),f(Ee,U,null),s(U,Js),s(U,it),s(U,xs),s(U,pt),s(U,Bs),s(U,dt),s(U,Cs),s(U,A),f(ke,A,null),s(A,Is),s(A,mt),s(A,Ss),s(A,ht),s(U,Gs),s(U,ue),f(Ne,ue,null),s(ue,Es),s(ue,ut),s(U,ks),s(U,q),f(Ze,q,null),s(q,Ns),s(q,gt),s(q,Zs),s(q,ft),s(U,Xs),s(U,D),f(Xe,D,null),s(D,Ps),s(D,bt),s(D,Qs),s(D,yt),s(U,Ws),s(U,ge),f(Pe,ge,null),s(ge,zs),s(ge,Mt),s(U,Fs),s(U,k),f(Qe,k,null),s(k,Hs),s(k,$t),s(k,Vs),s(k,wt),s(k,Rs),f(fe,k,null),w(t,kt,h),f(We,t,h),w(t,Nt,h),w(t,I,h),f(ze,I,null),s(I,Ys),s(I,jt),s(I,As),s(I,_t),s(I,qs),s(I,vt),w(t,Zt,h),f(Fe,t,h),w(t,Xt,h),w(t,Bt,h),Pt=!0},p(t,[h]){const v={};h&2&&(v.$$scope={dirty:h,ctx:t}),se.$set(v);const He={};h&2&&(He.$$scope={dirty:h,ctx:t}),ne.$set(He);const N={};h&2&&(N.$$scope={dirty:h,ctx:t}),le.$set(N);const Z={};h&2&&(Z.$$scope={dirty:h,ctx:t}),re.$set(Z);const L={};h&2&&(L.$$scope={dirty:h,ctx:t}),oe.$set(L);const K={};h&2&&(K.$$scope={dirty:h,ctx:t}),ce.$set(K);const O={};h&2&&(O.$$scope={dirty:h,ctx:t}),ie.$set(O);const ee={};h&2&&(ee.$$scope={dirty:h,ctx:t}),pe.$set(ee);const te={};h&2&&(te.$$scope={dirty:h,ctx:t}),me.$set(te);const Ve={};h&2&&(Ve.$$scope={dirty:h,ctx:t}),he.$set(Ve);const X={};h&2&&(X.$$scope={dirty:h,ctx:t}),fe.$set(X)},i(t){Pt||(b(p.$$.fragment,t),b($e.$$.fragment,t),b(we.$$.fragment,t),b(se.$$.fragment,t),b(je.$$.fragment,t),b(_e.$$.fragment,t),b(ne.$$.fragment,t),b(ve.$$.fragment,t),b(le.$$.fragment,t),b(Ue.$$.fragment,t),b(re.$$.fragment,t),b(Te.$$.fragment,t),b(oe.$$.fragment,t),b(Je.$$.fragment,t),b(ce.$$.fragment,t),b(xe.$$.fragment,t),b(ie.$$.fragment,t),b(Be.$$.fragment,t),b(pe.$$.fragment,t),b(Ce.$$.fragment,t),b(Ie.$$.fragment,t),b(me.$$.fragment,t),b(Se.$$.fragment,t),b(he.$$.fragment,t),b(Ge.$$.fragment,t),b(Ee.$$.fragment,t),b(ke.$$.fragment,t),b(Ne.$$.fragment,t),b(Ze.$$.fragment,t),b(Xe.$$.fragment,t),b(Pe.$$.fragment,t),b(Qe.$$.fragment,t),b(fe.$$.fragment,t),b(We.$$.fragment,t),b(ze.$$.fragment,t),b(Fe.$$.fragment,t),Pt=!0)},o(t){y(p.$$.fragment,t),y($e.$$.fragment,t),y(we.$$.fragment,t),y(se.$$.fragment,t),y(je.$$.fragment,t),y(_e.$$.fragment,t),y(ne.$$.fragment,t),y(ve.$$.fragment,t),y(le.$$.fragment,t),y(Ue.$$.fragment,t),y(re.$$.fragment,t),y(Te.$$.fragment,t),y(oe.$$.fragment,t),y(Je.$$.fragment,t),y(ce.$$.fragment,t),y(xe.$$.fragment,t),y(ie.$$.fragment,t),y(Be.$$.fragment,t),y(pe.$$.fragment,t),y(Ce.$$.fragment,t),y(Ie.$$.fragment,t),y(me.$$.fragment,t),y(Se.$$.fragment,t),y(he.$$.fragment,t),y(Ge.$$.fragment,t),y(Ee.$$.fragment,t),y(ke.$$.fragment,t),y(Ne.$$.fragment,t),y(Ze.$$.fragment,t),y(Xe.$$.fragment,t),y(Pe.$$.fragment,t),y(Qe.$$.fragment,t),y(fe.$$.fragment,t),y(We.$$.fragment,t),y(ze.$$.fragment,t),y(Fe.$$.fragment,t),Pt=!1},d(t){t&&(i(j),i(d),i(n),i(e),i(m),i(Ct),i(Me),i(It),i(St),i(_),i(Gt),i(Et),i(U),i(kt),i(Nt),i(I),i(Zt),i(Xt),i(Bt)),i(a),M(p,t),M($e,t),M(we),M(se),M(je),M(_e),M(ne),M(ve),M(le),M(Ue),M(re),M(Te),M(oe),M(Je),M(ce),M(xe),M(ie),M(Be),M(pe),M(Ce),M(Ie),M(me),M(Se),M(he),M(Ge,t),M(Ee),M(ke),M(Ne),M(Ze),M(Xe),M(Pe),M(Qe),M(fe),M(We,t),M(ze),M(Fe,t)}}}const qa='{"title":"Stateful Classes","local":"stateful-classes","sections":[{"title":"PartialState","local":"accelerate.PartialState","sections":[],"depth":2},{"title":"AcceleratorState","local":"accelerate.state.AcceleratorState","sections":[],"depth":2},{"title":"GradientState","local":"accelerate.state.GradientState","sections":[],"depth":2}],"depth":1}';function Da(T){return Sa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class an extends Ga{constructor(a){super(),Ea(this,a,Da,Aa,Ia,{})}}export{an as component};
