Buckets:
| import{s as Ga,o as Ea,n as Q}from"../chunks/scheduler.b9285784.js";import{S as ka,i as Na,e as o,s as l,c as u,h as Za,a as c,d as p,b as r,f as J,g,j as $,k as x,l as s,m as w,n as f,t as b,o as y,p as M}from"../chunks/index.26bc89a1.js";import{C as Xa,H as Ht,E as Pa}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.7a0ae628.js";import{D as B}from"../chunks/Docstring.3b3b5305.js";import{C as W}from"../chunks/CodeBlock.844ff9c3.js";import{E as P}from"../chunks/ExampleCodeBlock.e3a326b9.js";function Qa(T){let a,_="Example:",d,n,i;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=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function Wa(T){let a,_="Example:",d,n,i;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBd2l0aCUyMHN0YXRlLmxvY2FsX21haW5fcHJvY2Vzc19maXJzdCgpJTNBJTBBJTIwJTIwJTIwJTIwJTIzJTIwVGhpcyUyMHdpbGwlMjBiZSUyMHByaW50ZWQlMjBmaXJzdCUyMGJ5JTIwbG9jYWwlMjBwcm9jZXNzJTIwMCUyMHRoZW4lMjBpbiUyMGElMjBzZWVtaW5nbHklMEElMjAlMjAlMjAlMjAlMjMlMjByYW5kb20lMjBvcmRlciUyMGJ5JTIwdGhlJTIwb3RoZXIlMjBwcm9jZXNzZXMuJTBBJTIwJTIwJTIwJTIwcHJpbnQoZiUyMlRoaXMlMjB3aWxsJTIwYmUlMjBwcmludGVkJTIwYnklMjBwcm9jZXNzJTIwJTdCc3RhdGUubG9jYWxfcHJvY2Vzc19pbmRleCU3RCUyMik=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState | |
| <span class="hljs-meta">>>> </span>state = PartialState() | |
| <span class="hljs-meta">>>> </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"This will be printed by process <span class="hljs-subst">{state.local_process_index}</span>"</span>)`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function za(T){let a,_="Example:",d,n,i;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQSUwQWFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b3IoKSUwQXdpdGglMjBhY2NlbGVyYXRvci5tYWluX3Byb2Nlc3NfZmlyc3QoKSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyMFRoaXMlMjB3aWxsJTIwYmUlMjBwcmludGVkJTIwZmlyc3QlMjBieSUyMHByb2Nlc3MlMjAwJTIwdGhlbiUyMGluJTIwYSUyMHNlZW1pbmdseSUwQSUyMCUyMCUyMCUyMCUyMyUyMHJhbmRvbSUyMG9yZGVyJTIwYnklMjB0aGUlMjBvdGhlciUyMHByb2Nlc3Nlcy4lMEElMjAlMjAlMjAlMjBwcmludChmJTIyVGhpcyUyMHdpbGwlMjBiZSUyMHByaW50ZWQlMjBieSUyMHByb2Nlc3MlMjAlN0JhY2NlbGVyYXRvci5wcm9jZXNzX2luZGV4JTdEJTIyKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator | |
| <span class="hljs-meta">>>> </span>accelerator = Accelerator() | |
| <span class="hljs-meta">>>> </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"This will be printed by process <span class="hljs-subst">{accelerator.process_index}</span>"</span>)`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function Fa(T){let a,_="Example:",d,n,i;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"Printed on process <span class="hljs-subst">{state.process_index}</span>"</span>) | |
| print_something() | |
| <span class="hljs-string">"Printed on process 3"</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function Ha(T){let a,_="Example:",d,n,i;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">"This will be printed by process 0 only on each server."</span>) | |
| print_something() | |
| <span class="hljs-comment"># On server 1:</span> | |
| <span class="hljs-string">"This will be printed by process 0 only"</span> | |
| <span class="hljs-comment"># On server 2:</span> | |
| <span class="hljs-string">"This will be printed by process 0 only"</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function Va(T){let a,_="Example:",d,n,i;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"Printed on process <span class="hljs-subst">{accelerator.local_process_index}</span>"</span>) | |
| print_something() | |
| <span class="hljs-comment"># On server 1:</span> | |
| <span class="hljs-string">"Printed on process 2"</span> | |
| <span class="hljs-comment"># On server 2:</span> | |
| <span class="hljs-string">"Printed on process 2"</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function Ra(T){let a,_="Example:",d,n,i;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBJTBBJTBBJTQwc3RhdGUub25fbWFpbl9wcm9jZXNzJTBBZGVmJTIwcHJpbnRfc29tZXRoaW5nKCklM0ElMEElMjAlMjAlMjAlMjBwcmludCglMjJUaGlzJTIwd2lsbCUyMGJlJTIwcHJpbnRlZCUyMGJ5JTIwcHJvY2VzcyUyMDAlMjBvbmx5LiUyMiklMEElMEElMEFwcmludF9zb21ldGhpbmcoKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState | |
| <span class="hljs-meta">>>> </span>state = PartialState() | |
| <span class="hljs-meta">>>> </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">"This will be printed by process 0 only."</span>) | |
| <span class="hljs-meta">>>> </span>print_something() | |
| <span class="hljs-string">"This will be printed by process 0 only"</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function Ya(T){let a,_="Example:",d,n,i;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"Printed on process <span class="hljs-subst">{state.process_index}</span>"</span>) | |
| print_something() | |
| <span class="hljs-string">"Printed on process 2"</span>`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function Aa(T){let a,_="Example:",d,n,i;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">"A"</span>, <span class="hljs-string">"B"</span>, <span class="hljs-string">"C"</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">"A"</span>, <span class="hljs-string">"B"</span>] | |
| <span class="hljs-comment"># Process 1</span> | |
| [<span class="hljs-string">"C"</span>] | |
| <span class="hljs-keyword">with</span> state.split_between_processes([<span class="hljs-string">"A"</span>, <span class="hljs-string">"B"</span>, <span class="hljs-string">"C"</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">"A"</span>, <span class="hljs-string">"B"</span>] | |
| <span class="hljs-comment"># Process 1</span> | |
| [<span class="hljs-string">"C"</span>, <span class="hljs-string">"C"</span>]`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function qa(T){let a,_="Example:",d,n,i;return n=new W({props:{code:"JTIzJTIwQXNzdW1pbmclMjB0d28lMjBHUFUlMjBwcm9jZXNzZXMlMEFpbXBvcnQlMjB0aW1lJTBBZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBaWYlMjBzdGF0ZS5pc19tYWluX3Byb2Nlc3MlM0ElMEElMjAlMjAlMjAlMjB0aW1lLnNsZWVwKDIpJTBBZWxzZSUzQSUwQSUyMCUyMCUyMCUyMHByaW50KCUyMkknbSUyMHdhaXRpbmclMjBmb3IlMjB0aGUlMjBtYWluJTIwcHJvY2VzcyUyMHRvJTIwZmluaXNoJTIwaXRzJTIwc2xlZXAuLi4lMjIpJTBBc3RhdGUud2FpdF9mb3JfZXZlcnlvbmUoKSUwQSUyMyUyMFNob3VsZCUyMHByaW50JTIwb24lMjBldmVyeSUyMHByb2Nlc3MlMjBhdCUyMHRoZSUyMHNhbWUlMjB0aW1lJTBBcHJpbnQoJTIyRXZlcnlvbmUlMjBpcyUyMGhlcmUlMjIp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-comment"># Assuming two GPU processes</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> time | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> accelerate.state <span class="hljs-keyword">import</span> PartialState | |
| <span class="hljs-meta">>>> </span>state = PartialState() | |
| <span class="hljs-meta">>>> </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">>>> </span><span class="hljs-keyword">else</span>: | |
| <span class="hljs-meta">... </span> <span class="hljs-built_in">print</span>(<span class="hljs-string">"I'm waiting for the main process to finish its sleep..."</span>) | |
| <span class="hljs-meta">>>> </span>state.wait_for_everyone() | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Should print on every process at the same time</span> | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(<span class="hljs-string">"Everyone is here"</span>)`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function La(T){let a,_="Example:",d,n,i;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">"A"</span>, <span class="hljs-string">"B"</span>, <span class="hljs-string">"C"</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">"A"</span>, <span class="hljs-string">"B"</span>] | |
| <span class="hljs-comment"># Process 1</span> | |
| [<span class="hljs-string">"C"</span>] | |
| <span class="hljs-keyword">with</span> state.split_between_processes([<span class="hljs-string">"A"</span>, <span class="hljs-string">"B"</span>, <span class="hljs-string">"C"</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">"A"</span>, <span class="hljs-string">"B"</span>] | |
| <span class="hljs-comment"># Process 1</span> | |
| [<span class="hljs-string">"C"</span>, <span class="hljs-string">"C"</span>]`,wrap:!1}}),{c(){a=o("p"),a.textContent=_,d=l(),u(n.$$.fragment)},l(e){a=c(e,"P",{"data-svelte-h":!0}),$(a)!=="svelte-11lpom8"&&(a.textContent=_),d=r(e),g(n.$$.fragment,e)},m(e,h){w(e,a,h),w(e,d,h),f(n,e,h),i=!0},p:Q,i(e){i||(b(n.$$.fragment,e),i=!0)},o(e){y(n.$$.fragment,e),i=!1},d(e){e&&(p(a),p(d)),M(n,e)}}}function Da(T){let a,_,d,n,i,e,h,It,Me,Ks=`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.`,St,$e,Os=`These classes are immutable and store information about certain configurations or | |
| states.`,Gt,we,Et,j,_e,Vt,Ye,ea=`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>.`,Rt,Ae,ta="<strong>Available attributes:</strong>",Yt,qe,sa=`<li><strong>device</strong> (<code>torch.device</code>) — The device to use.</li> <li><strong>distributed_type</strong> (<a href="/docs/accelerate/pr_4021/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>`,At,se,qt,ae,je,Lt,Le,aa="Destroys the process group. If one is not specified, the default process group is destroyed.",Dt,S,ve,Kt,De,na="Lets the local main process go inside a with block.",Ot,Ke,la="The other processes will enter the with block after the main process exits.",es,ne,ts,G,Ue,ss,Oe,ra="Lets the main process go first inside a with block.",as,et,oa="The other processes will enter the with block after the main process exits.",ns,le,ls,z,Te,rs,tt,ca="Decorator that only runs the decorated function on the last process.",os,re,cs,F,Je,ps,st,pa="Decorator that only runs the decorated function on the local main process.",is,oe,ds,H,xe,ms,at,ia="Decorator that only runs the decorated function on the process with the given index on the current node.",hs,ce,us,V,Ce,gs,nt,da="Decorator that only runs the decorated function on the main process.",fs,pe,bs,R,Be,ys,lt,ma="Decorator that only runs the decorated function on the process with the given index.",Ms,ie,$s,de,Ie,ws,rt,ha="Sets the device in <code>self.device</code> to the current distributed environment.",_s,E,Se,js,ot,ua=`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,ct,ga="Note that when using a <code>dict</code>, all keys need to have the same number of elements.",Us,me,Ts,Y,Ge,Js,pt,fa=`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.`,xs,he,kt,Ee,Nt,U,ke,Cs,it,ba="Singleton class that has information about the current training environment.",Bs,dt,ya="<strong>Available attributes:</strong>",Is,mt,Ma=`<li><strong>device</strong> (<code>torch.device</code>) — The device to use.</li> <li><strong>distributed_type</strong> (<a href="/docs/accelerate/pr_4021/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>`,Ss,A,Ne,Gs,ht,$a="Destroys the process group. If one is not specified, the default process group is destroyed.",Es,ut,wa="If <code>self.fork_launched</code> is <code>True</code> and <code>group</code> is <code>None</code>, nothing happens.",ks,ue,Ze,Ns,gt,_a="Returns the DeepSpeedPlugin with the given plugin_key.",Zs,q,Xe,Xs,ft,ja="Lets the local main process go inside a with block.",Ps,bt,va="The other processes will enter the with block after the main process exits.",Qs,L,Pe,Ws,yt,Ua="Lets the main process go first inside a with block.",zs,Mt,Ta="The other processes will enter the with block after the main process exits.",Fs,ge,Qe,Hs,$t,Ja="Activates the DeepSpeedPlugin with the given <code>name</code>, and will disable all other plugins.",Vs,k,We,Rs,wt,xa=`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.`,Ys,_t,Ca="Note that when using a <code>dict</code>, all keys need to have the same number of elements.",As,fe,Zt,ze,Xt,I,Fe,qs,jt,Ba="Singleton class that has information related to gradient synchronization for gradient accumulation",Ls,vt,Ia="<strong>Available attributes:</strong>",Ds,Ut,Sa=`<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>`,Pt,He,Qt,Bt,Wt;return i=new Xa({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),h=new Ht({props:{title:"Stateful Classes",local:"stateful-classes",headingTag:"h1"}}),we=new Ht({props:{title:"PartialState",local:"accelerate.PartialState",headingTag:"h2"}}),_e=new B({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>) — | |
| 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>) — | |
| 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/pr_4021/en/package_reference/utilities#accelerate.InitProcessGroupKwargs">utils.InitProcessGroupKwargs</a>. See the example section for detailed usage.`,name:"kwargs"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L123"}}),se=new P({props:{anchor:"accelerate.PartialState.example",$$slots:{default:[Qa]},$$scope:{ctx:T}}}),je=new B({props:{name:"destroy_process_group",anchor:"accelerate.PartialState.destroy_process_group",parameters:[{name:"group",val:" = None"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L848"}}),ve=new B({props:{name:"local_main_process_first",anchor:"accelerate.PartialState.local_main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L537"}}),ne=new P({props:{anchor:"accelerate.PartialState.local_main_process_first.example",$$slots:{default:[Wa]},$$scope:{ctx:T}}}),Ue=new B({props:{name:"main_process_first",anchor:"accelerate.PartialState.main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L516"}}),le=new P({props:{anchor:"accelerate.PartialState.main_process_first.example",$$slots:{default:[za]},$$scope:{ctx:T}}}),Te=new B({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>) — The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L619"}}),re=new P({props:{anchor:"accelerate.PartialState.on_last_process.example",$$slots:{default:[Fa]},$$scope:{ctx:T}}}),Je=new B({props:{name:"on_local_main_process",anchor:"accelerate.PartialState.on_local_main_process",parameters:[{name:"function",val:": Callable[..., Any] | None = None"}],parametersDescription:[{anchor:"accelerate.PartialState.on_local_main_process.function",description:"<strong>function</strong> (<code>Callable</code>) — The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L588"}}),oe=new P({props:{anchor:"accelerate.PartialState.on_local_main_process.example",$$slots:{default:[Ha]},$$scope:{ctx:T}}}),xe=new B({props:{name:"on_local_process",anchor:"accelerate.PartialState.on_local_process",parameters:[{name:"function",val:": Callable[..., Any] | None = None"},{name:"local_process_index",val:": int | None = None"}],parametersDescription:[{anchor:"accelerate.PartialState.on_local_process.function",description:`<strong>function</strong> (<code>Callable</code>, <em>optional</em>) — | |
| 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>) — | |
| The index of the local process on which to run the function.`,name:"local_process_index"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L680"}}),ce=new P({props:{anchor:"accelerate.PartialState.on_local_process.example",$$slots:{default:[Va]},$$scope:{ctx:T}}}),Ce=new B({props:{name:"on_main_process",anchor:"accelerate.PartialState.on_main_process",parameters:[{name:"function",val:": Callable[..., Any] | None = None"}],parametersDescription:[{anchor:"accelerate.PartialState.on_main_process.function",description:"<strong>function</strong> (<code>Callable</code>) — The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L558"}}),pe=new P({props:{anchor:"accelerate.PartialState.on_main_process.example",$$slots:{default:[Ra]},$$scope:{ctx:T}}}),Be=new B({props:{name:"on_process",anchor:"accelerate.PartialState.on_process",parameters:[{name:"function",val:": Callable[..., Any] | None = None"},{name:"process_index",val:": int | None = None"}],parametersDescription:[{anchor:"accelerate.PartialState.on_process.function",description:`<strong>function</strong> (<code>Callable</code>, <code>optional</code>) — | |
| The function to decorate.`,name:"function"},{anchor:"accelerate.PartialState.on_process.process_index",description:`<strong>process_index</strong> (<code>int</code>, <code>optional</code>) — | |
| The index of the process on which to run the function.`,name:"process_index"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L647"}}),ie=new P({props:{anchor:"accelerate.PartialState.on_process.example",$$slots:{default:[Ya]},$$scope:{ctx:T}}}),Ie=new B({props:{name:"set_device",anchor:"accelerate.PartialState.set_device",parameters:[],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L822"}}),Se=new B({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>) — | |
| 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>) — | |
| 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/vr_4021/src/accelerate/state.py#L425"}}),me=new P({props:{anchor:"accelerate.PartialState.split_between_processes.example",$$slots:{default:[Aa]},$$scope:{ctx:T}}}),Ge=new B({props:{name:"wait_for_everyone",anchor:"accelerate.PartialState.wait_for_everyone",parameters:[],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L377"}}),he=new P({props:{anchor:"accelerate.PartialState.wait_for_everyone.example",$$slots:{default:[qa]},$$scope:{ctx:T}}}),Ee=new Ht({props:{title:"AcceleratorState",local:"accelerate.state.AcceleratorState",headingTag:"h2"}}),ke=new B({props:{name:"class accelerate.state.AcceleratorState",anchor:"accelerate.state.AcceleratorState",parameters:[{name:"mixed_precision",val:": str | None = 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:"parallelism_config",val:" = None"},{name:"_from_accelerator",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L871"}}),Ne=new B({props:{name:"destroy_process_group",anchor:"accelerate.state.AcceleratorState.destroy_process_group",parameters:[{name:"group",val:" = None"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L1084"}}),Ze=new B({props:{name:"get_deepspeed_plugin",anchor:"accelerate.state.AcceleratorState.get_deepspeed_plugin",parameters:[{name:"name",val:": str"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L1201"}}),Xe=new B({props:{name:"local_main_process_first",anchor:"accelerate.state.AcceleratorState.local_main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L1177"}}),Pe=new B({props:{name:"main_process_first",anchor:"accelerate.state.AcceleratorState.main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L1167"}}),Qe=new B({props:{name:"select_deepspeed_plugin",anchor:"accelerate.state.AcceleratorState.select_deepspeed_plugin",parameters:[{name:"name",val:": str | None = None"}],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/state.py#L1208"}}),We=new B({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>) — | |
| 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>) — | |
| 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/vr_4021/src/accelerate/state.py#L1125"}}),fe=new P({props:{anchor:"accelerate.state.AcceleratorState.split_between_processes.example",$$slots:{default:[La]},$$scope:{ctx:T}}}),ze=new Ht({props:{title:"GradientState",local:"accelerate.state.GradientState",headingTag:"h2"}}),Fe=new B({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/vr_4021/src/accelerate/state.py#L1234"}}),He=new Pa({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/package_reference/state.md"}}),{c(){a=o("meta"),_=l(),d=o("p"),n=l(),u(i.$$.fragment),e=l(),u(h.$$.fragment),It=l(),Me=o("p"),Me.innerHTML=Ks,St=l(),$e=o("p"),$e.textContent=Os,Gt=l(),u(we.$$.fragment),Et=l(),j=o("div"),u(_e.$$.fragment),Vt=l(),Ye=o("p"),Ye.innerHTML=ea,Rt=l(),Ae=o("p"),Ae.innerHTML=ta,Yt=l(),qe=o("ul"),qe.innerHTML=sa,At=l(),u(se.$$.fragment),qt=l(),ae=o("div"),u(je.$$.fragment),Lt=l(),Le=o("p"),Le.textContent=aa,Dt=l(),S=o("div"),u(ve.$$.fragment),Kt=l(),De=o("p"),De.textContent=na,Ot=l(),Ke=o("p"),Ke.textContent=la,es=l(),u(ne.$$.fragment),ts=l(),G=o("div"),u(Ue.$$.fragment),ss=l(),Oe=o("p"),Oe.textContent=ra,as=l(),et=o("p"),et.textContent=oa,ns=l(),u(le.$$.fragment),ls=l(),z=o("div"),u(Te.$$.fragment),rs=l(),tt=o("p"),tt.textContent=ca,os=l(),u(re.$$.fragment),cs=l(),F=o("div"),u(Je.$$.fragment),ps=l(),st=o("p"),st.textContent=pa,is=l(),u(oe.$$.fragment),ds=l(),H=o("div"),u(xe.$$.fragment),ms=l(),at=o("p"),at.textContent=ia,hs=l(),u(ce.$$.fragment),us=l(),V=o("div"),u(Ce.$$.fragment),gs=l(),nt=o("p"),nt.textContent=da,fs=l(),u(pe.$$.fragment),bs=l(),R=o("div"),u(Be.$$.fragment),ys=l(),lt=o("p"),lt.textContent=ma,Ms=l(),u(ie.$$.fragment),$s=l(),de=o("div"),u(Ie.$$.fragment),ws=l(),rt=o("p"),rt.innerHTML=ha,_s=l(),E=o("div"),u(Se.$$.fragment),js=l(),ot=o("p"),ot.innerHTML=ua,vs=l(),ct=o("p"),ct.innerHTML=ga,Us=l(),u(me.$$.fragment),Ts=l(),Y=o("div"),u(Ge.$$.fragment),Js=l(),pt=o("p"),pt.textContent=fa,xs=l(),u(he.$$.fragment),kt=l(),u(Ee.$$.fragment),Nt=l(),U=o("div"),u(ke.$$.fragment),Cs=l(),it=o("p"),it.textContent=ba,Bs=l(),dt=o("p"),dt.innerHTML=ya,Is=l(),mt=o("ul"),mt.innerHTML=Ma,Ss=l(),A=o("div"),u(Ne.$$.fragment),Gs=l(),ht=o("p"),ht.textContent=$a,Es=l(),ut=o("p"),ut.innerHTML=wa,ks=l(),ue=o("div"),u(Ze.$$.fragment),Ns=l(),gt=o("p"),gt.textContent=_a,Zs=l(),q=o("div"),u(Xe.$$.fragment),Xs=l(),ft=o("p"),ft.textContent=ja,Ps=l(),bt=o("p"),bt.textContent=va,Qs=l(),L=o("div"),u(Pe.$$.fragment),Ws=l(),yt=o("p"),yt.textContent=Ua,zs=l(),Mt=o("p"),Mt.textContent=Ta,Fs=l(),ge=o("div"),u(Qe.$$.fragment),Hs=l(),$t=o("p"),$t.innerHTML=Ja,Vs=l(),k=o("div"),u(We.$$.fragment),Rs=l(),wt=o("p"),wt.innerHTML=xa,Ys=l(),_t=o("p"),_t.innerHTML=Ca,As=l(),u(fe.$$.fragment),Zt=l(),u(ze.$$.fragment),Xt=l(),I=o("div"),u(Fe.$$.fragment),qs=l(),jt=o("p"),jt.textContent=Ba,Ls=l(),vt=o("p"),vt.innerHTML=Ia,Ds=l(),Ut=o("ul"),Ut.innerHTML=Sa,Pt=l(),u(He.$$.fragment),Qt=l(),Bt=o("p"),this.h()},l(t){const m=Za("svelte-u9bgzb",document.head);a=c(m,"META",{name:!0,content:!0}),m.forEach(p),_=r(t),d=c(t,"P",{}),J(d).forEach(p),n=r(t),g(i.$$.fragment,t),e=r(t),g(h.$$.fragment,t),It=r(t),Me=c(t,"P",{"data-svelte-h":!0}),$(Me)!=="svelte-6w5h2d"&&(Me.innerHTML=Ks),St=r(t),$e=c(t,"P",{"data-svelte-h":!0}),$($e)!=="svelte-n5bwiq"&&($e.textContent=Os),Gt=r(t),g(we.$$.fragment,t),Et=r(t),j=c(t,"DIV",{class:!0});var v=J(j);g(_e.$$.fragment,v),Vt=r(v),Ye=c(v,"P",{"data-svelte-h":!0}),$(Ye)!=="svelte-b0lfuj"&&(Ye.innerHTML=ea),Rt=r(v),Ae=c(v,"P",{"data-svelte-h":!0}),$(Ae)!=="svelte-17v1xbv"&&(Ae.innerHTML=ta),Yt=r(v),qe=c(v,"UL",{"data-svelte-h":!0}),$(qe)!=="svelte-8unxl2"&&(qe.innerHTML=sa),At=r(v),g(se.$$.fragment,v),qt=r(v),ae=c(v,"DIV",{class:!0});var Ve=J(ae);g(je.$$.fragment,Ve),Lt=r(Ve),Le=c(Ve,"P",{"data-svelte-h":!0}),$(Le)!=="svelte-5dvbzj"&&(Le.textContent=aa),Ve.forEach(p),Dt=r(v),S=c(v,"DIV",{class:!0});var N=J(S);g(ve.$$.fragment,N),Kt=r(N),De=c(N,"P",{"data-svelte-h":!0}),$(De)!=="svelte-1xrqyx2"&&(De.textContent=na),Ot=r(N),Ke=c(N,"P",{"data-svelte-h":!0}),$(Ke)!=="svelte-144ycie"&&(Ke.textContent=la),es=r(N),g(ne.$$.fragment,N),N.forEach(p),ts=r(v),G=c(v,"DIV",{class:!0});var Z=J(G);g(Ue.$$.fragment,Z),ss=r(Z),Oe=c(Z,"P",{"data-svelte-h":!0}),$(Oe)!=="svelte-f40x3x"&&(Oe.textContent=ra),as=r(Z),et=c(Z,"P",{"data-svelte-h":!0}),$(et)!=="svelte-144ycie"&&(et.textContent=oa),ns=r(Z),g(le.$$.fragment,Z),Z.forEach(p),ls=r(v),z=c(v,"DIV",{class:!0});var D=J(z);g(Te.$$.fragment,D),rs=r(D),tt=c(D,"P",{"data-svelte-h":!0}),$(tt)!=="svelte-15mu2x9"&&(tt.textContent=ca),os=r(D),g(re.$$.fragment,D),D.forEach(p),cs=r(v),F=c(v,"DIV",{class:!0});var K=J(F);g(Je.$$.fragment,K),ps=r(K),st=c(K,"P",{"data-svelte-h":!0}),$(st)!=="svelte-10pbn0p"&&(st.textContent=pa),is=r(K),g(oe.$$.fragment,K),K.forEach(p),ds=r(v),H=c(v,"DIV",{class:!0});var O=J(H);g(xe.$$.fragment,O),ms=r(O),at=c(O,"P",{"data-svelte-h":!0}),$(at)!=="svelte-3g0as"&&(at.textContent=ia),hs=r(O),g(ce.$$.fragment,O),O.forEach(p),us=r(v),V=c(v,"DIV",{class:!0});var ee=J(V);g(Ce.$$.fragment,ee),gs=r(ee),nt=c(ee,"P",{"data-svelte-h":!0}),$(nt)!=="svelte-1dr4vmg"&&(nt.textContent=da),fs=r(ee),g(pe.$$.fragment,ee),ee.forEach(p),bs=r(v),R=c(v,"DIV",{class:!0});var te=J(R);g(Be.$$.fragment,te),ys=r(te),lt=c(te,"P",{"data-svelte-h":!0}),$(lt)!=="svelte-1uajfn5"&&(lt.textContent=ma),Ms=r(te),g(ie.$$.fragment,te),te.forEach(p),$s=r(v),de=c(v,"DIV",{class:!0});var Re=J(de);g(Ie.$$.fragment,Re),ws=r(Re),rt=c(Re,"P",{"data-svelte-h":!0}),$(rt)!=="svelte-1ylvgoj"&&(rt.innerHTML=ha),Re.forEach(p),_s=r(v),E=c(v,"DIV",{class:!0});var X=J(E);g(Se.$$.fragment,X),js=r(X),ot=c(X,"P",{"data-svelte-h":!0}),$(ot)!=="svelte-xr05jy"&&(ot.innerHTML=ua),vs=r(X),ct=c(X,"P",{"data-svelte-h":!0}),$(ct)!=="svelte-hvuw2l"&&(ct.innerHTML=ga),Us=r(X),g(me.$$.fragment,X),X.forEach(p),Ts=r(v),Y=c(v,"DIV",{class:!0});var Tt=J(Y);g(Ge.$$.fragment,Tt),Js=r(Tt),pt=c(Tt,"P",{"data-svelte-h":!0}),$(pt)!=="svelte-tmafbn"&&(pt.textContent=fa),xs=r(Tt),g(he.$$.fragment,Tt),Tt.forEach(p),v.forEach(p),kt=r(t),g(Ee.$$.fragment,t),Nt=r(t),U=c(t,"DIV",{class:!0});var C=J(U);g(ke.$$.fragment,C),Cs=r(C),it=c(C,"P",{"data-svelte-h":!0}),$(it)!=="svelte-x2ar5c"&&(it.textContent=ba),Bs=r(C),dt=c(C,"P",{"data-svelte-h":!0}),$(dt)!=="svelte-17v1xbv"&&(dt.innerHTML=ya),Is=r(C),mt=c(C,"UL",{"data-svelte-h":!0}),$(mt)!=="svelte-1hask9e"&&(mt.innerHTML=Ma),Ss=r(C),A=c(C,"DIV",{class:!0});var Jt=J(A);g(Ne.$$.fragment,Jt),Gs=r(Jt),ht=c(Jt,"P",{"data-svelte-h":!0}),$(ht)!=="svelte-5dvbzj"&&(ht.textContent=$a),Es=r(Jt),ut=c(Jt,"P",{"data-svelte-h":!0}),$(ut)!=="svelte-m5cehq"&&(ut.innerHTML=wa),Jt.forEach(p),ks=r(C),ue=c(C,"DIV",{class:!0});var zt=J(ue);g(Ze.$$.fragment,zt),Ns=r(zt),gt=c(zt,"P",{"data-svelte-h":!0}),$(gt)!=="svelte-d5ob2p"&&(gt.textContent=_a),zt.forEach(p),Zs=r(C),q=c(C,"DIV",{class:!0});var xt=J(q);g(Xe.$$.fragment,xt),Xs=r(xt),ft=c(xt,"P",{"data-svelte-h":!0}),$(ft)!=="svelte-1xrqyx2"&&(ft.textContent=ja),Ps=r(xt),bt=c(xt,"P",{"data-svelte-h":!0}),$(bt)!=="svelte-144ycie"&&(bt.textContent=va),xt.forEach(p),Qs=r(C),L=c(C,"DIV",{class:!0});var Ct=J(L);g(Pe.$$.fragment,Ct),Ws=r(Ct),yt=c(Ct,"P",{"data-svelte-h":!0}),$(yt)!=="svelte-f40x3x"&&(yt.textContent=Ua),zs=r(Ct),Mt=c(Ct,"P",{"data-svelte-h":!0}),$(Mt)!=="svelte-144ycie"&&(Mt.textContent=Ta),Ct.forEach(p),Fs=r(C),ge=c(C,"DIV",{class:!0});var Ft=J(ge);g(Qe.$$.fragment,Ft),Hs=r(Ft),$t=c(Ft,"P",{"data-svelte-h":!0}),$($t)!=="svelte-13ng0ld"&&($t.innerHTML=Ja),Ft.forEach(p),Vs=r(C),k=c(C,"DIV",{class:!0});var be=J(k);g(We.$$.fragment,be),Rs=r(be),wt=c(be,"P",{"data-svelte-h":!0}),$(wt)!=="svelte-xr05jy"&&(wt.innerHTML=xa),Ys=r(be),_t=c(be,"P",{"data-svelte-h":!0}),$(_t)!=="svelte-hvuw2l"&&(_t.innerHTML=Ca),As=r(be),g(fe.$$.fragment,be),be.forEach(p),C.forEach(p),Zt=r(t),g(ze.$$.fragment,t),Xt=r(t),I=c(t,"DIV",{class:!0});var ye=J(I);g(Fe.$$.fragment,ye),qs=r(ye),jt=c(ye,"P",{"data-svelte-h":!0}),$(jt)!=="svelte-1pw2ldw"&&(jt.textContent=Ba),Ls=r(ye),vt=c(ye,"P",{"data-svelte-h":!0}),$(vt)!=="svelte-17v1xbv"&&(vt.innerHTML=Ia),Ds=r(ye),Ut=c(ye,"UL",{"data-svelte-h":!0}),$(Ut)!=="svelte-kdkw1r"&&(Ut.innerHTML=Sa),ye.forEach(p),Pt=r(t),g(He.$$.fragment,t),Qt=r(t),Bt=c(t,"P",{}),J(Bt).forEach(p),this.h()},h(){x(a,"name","hf:doc:metadata"),x(a,"content",Ka),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(j,"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(L,"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,m){s(document.head,a),w(t,_,m),w(t,d,m),w(t,n,m),f(i,t,m),w(t,e,m),f(h,t,m),w(t,It,m),w(t,Me,m),w(t,St,m),w(t,$e,m),w(t,Gt,m),f(we,t,m),w(t,Et,m),w(t,j,m),f(_e,j,null),s(j,Vt),s(j,Ye),s(j,Rt),s(j,Ae),s(j,Yt),s(j,qe),s(j,At),f(se,j,null),s(j,qt),s(j,ae),f(je,ae,null),s(ae,Lt),s(ae,Le),s(j,Dt),s(j,S),f(ve,S,null),s(S,Kt),s(S,De),s(S,Ot),s(S,Ke),s(S,es),f(ne,S,null),s(j,ts),s(j,G),f(Ue,G,null),s(G,ss),s(G,Oe),s(G,as),s(G,et),s(G,ns),f(le,G,null),s(j,ls),s(j,z),f(Te,z,null),s(z,rs),s(z,tt),s(z,os),f(re,z,null),s(j,cs),s(j,F),f(Je,F,null),s(F,ps),s(F,st),s(F,is),f(oe,F,null),s(j,ds),s(j,H),f(xe,H,null),s(H,ms),s(H,at),s(H,hs),f(ce,H,null),s(j,us),s(j,V),f(Ce,V,null),s(V,gs),s(V,nt),s(V,fs),f(pe,V,null),s(j,bs),s(j,R),f(Be,R,null),s(R,ys),s(R,lt),s(R,Ms),f(ie,R,null),s(j,$s),s(j,de),f(Ie,de,null),s(de,ws),s(de,rt),s(j,_s),s(j,E),f(Se,E,null),s(E,js),s(E,ot),s(E,vs),s(E,ct),s(E,Us),f(me,E,null),s(j,Ts),s(j,Y),f(Ge,Y,null),s(Y,Js),s(Y,pt),s(Y,xs),f(he,Y,null),w(t,kt,m),f(Ee,t,m),w(t,Nt,m),w(t,U,m),f(ke,U,null),s(U,Cs),s(U,it),s(U,Bs),s(U,dt),s(U,Is),s(U,mt),s(U,Ss),s(U,A),f(Ne,A,null),s(A,Gs),s(A,ht),s(A,Es),s(A,ut),s(U,ks),s(U,ue),f(Ze,ue,null),s(ue,Ns),s(ue,gt),s(U,Zs),s(U,q),f(Xe,q,null),s(q,Xs),s(q,ft),s(q,Ps),s(q,bt),s(U,Qs),s(U,L),f(Pe,L,null),s(L,Ws),s(L,yt),s(L,zs),s(L,Mt),s(U,Fs),s(U,ge),f(Qe,ge,null),s(ge,Hs),s(ge,$t),s(U,Vs),s(U,k),f(We,k,null),s(k,Rs),s(k,wt),s(k,Ys),s(k,_t),s(k,As),f(fe,k,null),w(t,Zt,m),f(ze,t,m),w(t,Xt,m),w(t,I,m),f(Fe,I,null),s(I,qs),s(I,jt),s(I,Ls),s(I,vt),s(I,Ds),s(I,Ut),w(t,Pt,m),f(He,t,m),w(t,Qt,m),w(t,Bt,m),Wt=!0},p(t,[m]){const v={};m&2&&(v.$$scope={dirty:m,ctx:t}),se.$set(v);const Ve={};m&2&&(Ve.$$scope={dirty:m,ctx:t}),ne.$set(Ve);const N={};m&2&&(N.$$scope={dirty:m,ctx:t}),le.$set(N);const Z={};m&2&&(Z.$$scope={dirty:m,ctx:t}),re.$set(Z);const D={};m&2&&(D.$$scope={dirty:m,ctx:t}),oe.$set(D);const K={};m&2&&(K.$$scope={dirty:m,ctx:t}),ce.$set(K);const O={};m&2&&(O.$$scope={dirty:m,ctx:t}),pe.$set(O);const ee={};m&2&&(ee.$$scope={dirty:m,ctx:t}),ie.$set(ee);const te={};m&2&&(te.$$scope={dirty:m,ctx:t}),me.$set(te);const Re={};m&2&&(Re.$$scope={dirty:m,ctx:t}),he.$set(Re);const X={};m&2&&(X.$$scope={dirty:m,ctx:t}),fe.$set(X)},i(t){Wt||(b(i.$$.fragment,t),b(h.$$.fragment,t),b(we.$$.fragment,t),b(_e.$$.fragment,t),b(se.$$.fragment,t),b(je.$$.fragment,t),b(ve.$$.fragment,t),b(ne.$$.fragment,t),b(Ue.$$.fragment,t),b(le.$$.fragment,t),b(Te.$$.fragment,t),b(re.$$.fragment,t),b(Je.$$.fragment,t),b(oe.$$.fragment,t),b(xe.$$.fragment,t),b(ce.$$.fragment,t),b(Ce.$$.fragment,t),b(pe.$$.fragment,t),b(Be.$$.fragment,t),b(ie.$$.fragment,t),b(Ie.$$.fragment,t),b(Se.$$.fragment,t),b(me.$$.fragment,t),b(Ge.$$.fragment,t),b(he.$$.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(We.$$.fragment,t),b(fe.$$.fragment,t),b(ze.$$.fragment,t),b(Fe.$$.fragment,t),b(He.$$.fragment,t),Wt=!0)},o(t){y(i.$$.fragment,t),y(h.$$.fragment,t),y(we.$$.fragment,t),y(_e.$$.fragment,t),y(se.$$.fragment,t),y(je.$$.fragment,t),y(ve.$$.fragment,t),y(ne.$$.fragment,t),y(Ue.$$.fragment,t),y(le.$$.fragment,t),y(Te.$$.fragment,t),y(re.$$.fragment,t),y(Je.$$.fragment,t),y(oe.$$.fragment,t),y(xe.$$.fragment,t),y(ce.$$.fragment,t),y(Ce.$$.fragment,t),y(pe.$$.fragment,t),y(Be.$$.fragment,t),y(ie.$$.fragment,t),y(Ie.$$.fragment,t),y(Se.$$.fragment,t),y(me.$$.fragment,t),y(Ge.$$.fragment,t),y(he.$$.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(We.$$.fragment,t),y(fe.$$.fragment,t),y(ze.$$.fragment,t),y(Fe.$$.fragment,t),y(He.$$.fragment,t),Wt=!1},d(t){t&&(p(_),p(d),p(n),p(e),p(It),p(Me),p(St),p($e),p(Gt),p(Et),p(j),p(kt),p(Nt),p(U),p(Zt),p(Xt),p(I),p(Pt),p(Qt),p(Bt)),p(a),M(i,t),M(h,t),M(we,t),M(_e),M(se),M(je),M(ve),M(ne),M(Ue),M(le),M(Te),M(re),M(Je),M(oe),M(xe),M(ce),M(Ce),M(pe),M(Be),M(ie),M(Ie),M(Se),M(me),M(Ge),M(he),M(Ee,t),M(ke),M(Ne),M(Ze),M(Xe),M(Pe),M(Qe),M(We),M(fe),M(ze,t),M(Fe),M(He,t)}}}const Ka='{"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 Oa(T){return Ea(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rn extends ka{constructor(a){super(),Na(this,a,Oa,Da,Ga,{})}}export{rn as component}; | |
Xet Storage Details
- Size:
- 54.9 kB
- Xet hash:
- 62b7cfecfebacb165fe049f2a89b862c5908b0c949835a8362ae4b845e56dbb3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.