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 p,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,_="Example:",d,n,i;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUudXRpbHMlMjBpbXBvcnQlMjBJbml0UHJvY2Vzc0dyb3VwS3dhcmdzJTBBJTBBJTIzJTIwVG8lMjBpbmNsdWRlJTIwJTYwSW5pdFByb2Nlc3NHcm91cEt3YXJncyU2MCUyQyUyMGluaXQlMjB0aGVuJTIwY2FsbCUyMCU2MC50b19rd2FyZ3MoKSU2MCUwQWt3YXJncyUyMCUzRCUyMEluaXRQcm9jZXNzR3JvdXBLd2FyZ3MoLi4uKS50b19rd2FyZ3MoKSUwQXN0YXRlJTIwJTNEJTIwUGFydGlhbFN0YXRlKCoqa3dhcmdzKQ==",highlighted:'from accelerate.utils import InitProcessGroupKwargs\n\n# To include `InitProcessGroupKwargs`, init then call `.to_kwargs()`\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,m){w(e,a,m),w(e,d,m),f(n,e,m),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 Xa(T){let a,_="Example:",d,n,i;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBd2l0aCUyMHN0YXRlLmxvY2FsX21haW5fcHJvY2Vzc19maXJzdCgpJTNBJTBBJTIwJTIwJTIwJTIwJTIzJTIwVGhpcyUyMHdpbGwlMjBiZSUyMHByaW50ZWQlMjBmaXJzdCUyMGJ5JTIwbG9jYWwlMjBwcm9jZXNzJTIwMCUyMHRoZW4lMjBpbiUyMGElMjBzZWVtaW5nbHklMEElMjAlMjAlMjAlMjAlMjMlMjByYW5kb20lMjBvcmRlciUyMGJ5JTIwdGhlJTIwb3RoZXIlMjBwcm9jZXNzZXMuJTBBJTIwJTIwJTIwJTIwcHJpbnQoZiUyMlRoaXMlMjB3aWxsJTIwYmUlMjBwcmludGVkJTIwYnklMjBwcm9jZXNzJTIwJTdCc3RhdGUubG9jYWxfcHJvY2Vzc19pbmRleCU3RCUyMik=",highlighted:`from accelerate.state import PartialState
state = PartialState()
with state.local_main_process_first():
# This will be printed first by local process 0 then in a seemingly
# random order by the other processes.
print(f"This will be printed by process {state.local_process_index}")`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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 Pa(T){let a,_="Example:",d,n,i;return n=new W({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQSUwQWFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b3IoKSUwQXdpdGglMjBhY2NlbGVyYXRvci5tYWluX3Byb2Nlc3NfZmlyc3QoKSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyMFRoaXMlMjB3aWxsJTIwYmUlMjBwcmludGVkJTIwZmlyc3QlMjBieSUyMHByb2Nlc3MlMjAwJTIwdGhlbiUyMGluJTIwYSUyMHNlZW1pbmdseSUwQSUyMCUyMCUyMCUyMCUyMyUyMHJhbmRvbSUyMG9yZGVyJTIwYnklMjB0aGUlMjBvdGhlciUyMHByb2Nlc3Nlcy4lMEElMjAlMjAlMjAlMjBwcmludChmJTIyVGhpcyUyMHdpbGwlMjBiZSUyMHByaW50ZWQlMjBieSUyMHByb2Nlc3MlMjAlN0JhY2NlbGVyYXRvci5wcm9jZXNzX2luZGV4JTdEJTIyKQ==",highlighted:`from accelerate import Accelerator
accelerator = Accelerator()
with accelerator.main_process_first():
# This will be printed first by process 0 then in a seemingly
# random order by the other processes.
print(f"This will be printed by process {accelerator.process_index}")`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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:"JTIzJTIwQXNzdW1lJTIwd2UlMjBoYXZlJTIwNCUyMHByb2Nlc3Nlcy4lMEFmcm9tJTIwYWNjZWxlcmF0ZS5zdGF0ZSUyMGltcG9ydCUyMFBhcnRpYWxTdGF0ZSUwQSUwQXN0YXRlJTIwJTNEJTIwUGFydGlhbFN0YXRlKCklMEElMEElMEElNDBzdGF0ZS5vbl9sYXN0X3Byb2Nlc3MlMEFkZWYlMjBwcmludF9zb21ldGhpbmcoKSUzQSUwQSUyMCUyMCUyMCUyMHByaW50KGYlMjJQcmludGVkJTIwb24lMjBwcm9jZXNzJTIwJTdCc3RhdGUucHJvY2Vzc19pbmRleCU3RCUyMiklMEElMEElMEFwcmludF9zb21ldGhpbmcoKSUwQSUyMlByaW50ZWQlMjBvbiUyMHByb2Nlc3MlMjAzJTIy",highlighted:`# Assume we have 4 processes.
from accelerate.state import PartialState
state = PartialState()
def print_something():
print(f"Printed on process {state.process_index}")
print_something()
"Printed on process 3"`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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:"JTIzJTIwQXNzdW1lJTIwd2UlMjBoYXZlJTIwMiUyMHNlcnZlcnMlMjB3aXRoJTIwNCUyMHByb2Nlc3NlcyUyMGVhY2guJTBBZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBJTBBJTBBJTQwc3RhdGUub25fbG9jYWxfbWFpbl9wcm9jZXNzJTBBZGVmJTIwcHJpbnRfc29tZXRoaW5nKCklM0ElMEElMjAlMjAlMjAlMjBwcmludCglMjJUaGlzJTIwd2lsbCUyMGJlJTIwcHJpbnRlZCUyMGJ5JTIwcHJvY2VzcyUyMDAlMjBvbmx5JTIwb24lMjBlYWNoJTIwc2VydmVyLiUyMiklMEElMEElMEFwcmludF9zb21ldGhpbmcoKSUwQSUyMyUyME9uJTIwc2VydmVyJTIwMSUzQSUwQSUyMlRoaXMlMjB3aWxsJTIwYmUlMjBwcmludGVkJTIwYnklMjBwcm9jZXNzJTIwMCUyMG9ubHklMjIlMEElMjMlMjBPbiUyMHNlcnZlciUyMDIlM0ElMEElMjJUaGlzJTIwd2lsbCUyMGJlJTIwcHJpbnRlZCUyMGJ5JTIwcHJvY2VzcyUyMDAlMjBvbmx5JTIy",highlighted:`# Assume we have 2 servers with 4 processes each.
from accelerate.state import PartialState
state = PartialState()
def print_something():
print("This will be printed by process 0 only on each server.")
print_something()
# On server 1:
"This will be printed by process 0 only"
# On server 2:
"This will be printed by process 0 only"`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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:"JTIzJTIwQXNzdW1lJTIwd2UlMjBoYXZlJTIwMiUyMHNlcnZlcnMlMjB3aXRoJTIwNCUyMHByb2Nlc3NlcyUyMGVhY2guJTBBZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQSUwQWFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b3IoKSUwQSUwQSUwQSU0MGFjY2VsZXJhdG9yLm9uX2xvY2FsX3Byb2Nlc3MobG9jYWxfcHJvY2Vzc19pbmRleCUzRDIpJTBBZGVmJTIwcHJpbnRfc29tZXRoaW5nKCklM0ElMEElMjAlMjAlMjAlMjBwcmludChmJTIyUHJpbnRlZCUyMG9uJTIwcHJvY2VzcyUyMCU3QmFjY2VsZXJhdG9yLmxvY2FsX3Byb2Nlc3NfaW5kZXglN0QlMjIpJTBBJTBBJTBBcHJpbnRfc29tZXRoaW5nKCklMEElMjMlMjBPbiUyMHNlcnZlciUyMDElM0ElMEElMjJQcmludGVkJTIwb24lMjBwcm9jZXNzJTIwMiUyMiUwQSUyMyUyME9uJTIwc2VydmVyJTIwMiUzQSUwQSUyMlByaW50ZWQlMjBvbiUyMHByb2Nlc3MlMjAyJTIy",highlighted:`# Assume we have 2 servers with 4 processes each.
from accelerate import Accelerator
accelerator = Accelerator()
def print_something():
print(f"Printed on process {accelerator.local_process_index}")
print_something()
# On server 1:
"Printed on process 2"
# On server 2:
"Printed on process 2"`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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:"ZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBJTBBJTBBJTQwc3RhdGUub25fbWFpbl9wcm9jZXNzJTBBZGVmJTIwcHJpbnRfc29tZXRoaW5nKCklM0ElMEElMjAlMjAlMjAlMjBwcmludCglMjJUaGlzJTIwd2lsbCUyMGJlJTIwcHJpbnRlZCUyMGJ5JTIwcHJvY2VzcyUyMDAlMjBvbmx5LiUyMiklMEElMEElMEFwcmludF9zb21ldGhpbmcoKQ==",highlighted:`from accelerate.state import PartialState
state = PartialState()
@state.on_main_process
def print_something():
print("This will be printed by process 0 only.")
print_something()
"This will be printed by process 0 only"`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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:"JTIzJTIwQXNzdW1lJTIwd2UlMjBoYXZlJTIwNCUyMHByb2Nlc3Nlcy4lMEFmcm9tJTIwYWNjZWxlcmF0ZS5zdGF0ZSUyMGltcG9ydCUyMFBhcnRpYWxTdGF0ZSUwQSUwQXN0YXRlJTIwJTNEJTIwUGFydGlhbFN0YXRlKCklMEElMEElMEElNDBzdGF0ZS5vbl9wcm9jZXNzKHByb2Nlc3NfaW5kZXglM0QyKSUwQWRlZiUyMHByaW50X3NvbWV0aGluZygpJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoZiUyMlByaW50ZWQlMjBvbiUyMHByb2Nlc3MlMjAlN0JzdGF0ZS5wcm9jZXNzX2luZGV4JTdEJTIyKSUwQSUwQSUwQXByaW50X3NvbWV0aGluZygpJTBBJTIyUHJpbnRlZCUyMG9uJTIwcHJvY2VzcyUyMDIlMjI=",highlighted:`# Assume we have 4 processes.
from accelerate.state import PartialState
state = PartialState()
def print_something():
print(f"Printed on process {state.process_index}")
print_something()
"Printed on process 2"`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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:"JTIzJTIwQXNzdW1lJTIwdGhlcmUlMjBhcmUlMjB0d28lMjBwcm9jZXNzZXMlMEFmcm9tJTIwYWNjZWxlcmF0ZSUyMGltcG9ydCUyMFBhcnRpYWxTdGF0ZSUwQSUwQXN0YXRlJTIwJTNEJTIwUGFydGlhbFN0YXRlKCklMEF3aXRoJTIwc3RhdGUuc3BsaXRfYmV0d2Vlbl9wcm9jZXNzZXMoJTVCJTIyQSUyMiUyQyUyMCUyMkIlMjIlMkMlMjAlMjJDJTIyJTVEKSUyMGFzJTIwaW5wdXRzJTNBJTBBJTIwJTIwJTIwJTIwcHJpbnQoaW5wdXRzKSUwQSUyMyUyMFByb2Nlc3MlMjAwJTBBJTVCJTIyQSUyMiUyQyUyMCUyMkIlMjIlNUQlMEElMjMlMjBQcm9jZXNzJTIwMSUwQSU1QiUyMkMlMjIlNUQlMEElMEF3aXRoJTIwc3RhdGUuc3BsaXRfYmV0d2Vlbl9wcm9jZXNzZXMoJTVCJTIyQSUyMiUyQyUyMCUyMkIlMjIlMkMlMjAlMjJDJTIyJTVEJTJDJTIwYXBwbHlfcGFkZGluZyUzRFRydWUpJTIwYXMlMjBpbnB1dHMlM0ElMEElMjAlMjAlMjAlMjBwcmludChpbnB1dHMpJTBBJTIzJTIwUHJvY2VzcyUyMDAlMEElNUIlMjJBJTIyJTJDJTIwJTIyQiUyMiU1RCUwQSUyMyUyMFByb2Nlc3MlMjAxJTBBJTVCJTIyQyUyMiUyQyUyMCUyMkMlMjIlNUQ=",highlighted:`# Assume there are two processes
from accelerate import PartialState
state = PartialState()
with state.split_between_processes(["A", "B", "C"]) as inputs:
print(inputs)
# Process 0
["A", "B"]
# Process 1
["C"]
with state.split_between_processes(["A", "B", "C"], apply_padding=True) as inputs:
print(inputs)
# Process 0
["A", "B"]
# Process 1
["C", "C"]`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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:"JTIzJTIwQXNzdW1pbmclMjB0d28lMjBHUFUlMjBwcm9jZXNzZXMlMEFpbXBvcnQlMjB0aW1lJTBBZnJvbSUyMGFjY2VsZXJhdGUuc3RhdGUlMjBpbXBvcnQlMjBQYXJ0aWFsU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMFBhcnRpYWxTdGF0ZSgpJTBBaWYlMjBzdGF0ZS5pc19tYWluX3Byb2Nlc3MlM0ElMEElMjAlMjAlMjAlMjB0aW1lLnNsZWVwKDIpJTBBZWxzZSUzQSUwQSUyMCUyMCUyMCUyMHByaW50KCUyMkknbSUyMHdhaXRpbmclMjBmb3IlMjB0aGUlMjBtYWluJTIwcHJvY2VzcyUyMHRvJTIwZmluaXNoJTIwaXRzJTIwc2xlZXAuLi4lMjIpJTBBc3RhdGUud2FpdF9mb3JfZXZlcnlvbmUoKSUwQSUyMyUyMFNob3VsZCUyMHByaW50JTIwb24lMjBldmVyeSUyMHByb2Nlc3MlMjBhdCUyMHRoZSUyMHNhbWUlMjB0aW1lJTBBcHJpbnQoJTIyRXZlcnlvbmUlMjBpcyUyMGhlcmUlMjIp",highlighted:`# Assuming two GPU processes
import time
from accelerate.state import PartialState
state = PartialState()
if state.is_main_process:
time.sleep(2)
else:
print("I'm waiting for the main process to finish its sleep...")
state.wait_for_everyone()
# Should print on every process at the same time
print("Everyone is here")`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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:"JTIzJTIwQXNzdW1lJTIwdGhlcmUlMjBhcmUlMjB0d28lMjBwcm9jZXNzZXMlMEFmcm9tJTIwYWNjZWxlcmF0ZS5zdGF0ZSUyMGltcG9ydCUyMEFjY2VsZXJhdG9yU3RhdGUlMEElMEFzdGF0ZSUyMCUzRCUyMEFjY2VsZXJhdG9yU3RhdGUoKSUwQXdpdGglMjBzdGF0ZS5zcGxpdF9iZXR3ZWVuX3Byb2Nlc3NlcyglNUIlMjJBJTIyJTJDJTIwJTIyQiUyMiUyQyUyMCUyMkMlMjIlNUQpJTIwYXMlMjBpbnB1dHMlM0ElMEElMjAlMjAlMjAlMjBwcmludChpbnB1dHMpJTBBJTIzJTIwUHJvY2VzcyUyMDAlMEElNUIlMjJBJTIyJTJDJTIwJTIyQiUyMiU1RCUwQSUyMyUyMFByb2Nlc3MlMjAxJTBBJTVCJTIyQyUyMiU1RCUwQSUwQXdpdGglMjBzdGF0ZS5zcGxpdF9iZXR3ZWVuX3Byb2Nlc3NlcyglNUIlMjJBJTIyJTJDJTIwJTIyQiUyMiUyQyUyMCUyMkMlMjIlNUQlMkMlMjBhcHBseV9wYWRkaW5nJTNEVHJ1ZSklMjBhcyUyMGlucHV0cyUzQSUwQSUyMCUyMCUyMCUyMHByaW50KGlucHV0cyklMEElMjMlMjBQcm9jZXNzJTIwMCUwQSU1QiUyMkElMjIlMkMlMjAlMjJCJTIyJTVEJTBBJTIzJTIwUHJvY2VzcyUyMDElMEElNUIlMjJDJTIyJTJDJTIwJTIyQyUyMiU1RA==",highlighted:`# Assume there are two processes
from accelerate.state import AcceleratorState
state = AcceleratorState()
with state.split_between_processes(["A", "B", "C"]) as inputs:
print(inputs)
# Process 0
["A", "B"]
# Process 1
["C"]
with state.split_between_processes(["A", "B", "C"], apply_padding=True) as inputs:
print(inputs)
# Process 0
["A", "B"]
# Process 1
["C", "C"]`,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,m){w(e,a,m),w(e,d,m),f(n,e,m),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,_,d,n,i,e,m,Ds=`Below are variations of a singleton class 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,j,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 not need to
be initialized from Accelerator
.`,Ht,Ye,Os="Available attributes:",Vt,Ae,ea=`
torch.device
) — The device to use.int
) — The index of the current process on the current server.str
) — 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’).int
) — The number of processes currently launched in parallel.int
) — The index of the current process.bool
) — Whether or not the current process is the last one.bool
) — Whether or not the current process is the main one.bool
) — Whether or not the current process is the main one on the local node.bool
) — Whether or not the current script is being run in debug mode.self.device
to the current distributed environment.",$s,E,Ie,ws,rt,ma=`Splits input
between self.num_processes
quickly and can be then used on that process. Useful when doing
distributed inference, such as with different prompts.`,_s,ot,ha="Note that when using a dict
, all keys need to have the same number of elements.",js,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,pt,ga="Singleton class that has information about the current training environment.",xs,it,fa="Available attributes:",Bs,dt,ba=`torch.device
) — The device to use.ParallelismConfig
) — The parallelism configuration for the
current training environment. This is used to configure the distributed training environment.bool
) — Whether or not the AcceleratorState
has been initialized from Accelerator
.int
) — The index of the current process on the current server.str
) — 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’).int
) — The number of processes currently launched in parallel.int
) — The index of the current process.bool
) — Whether or not the current process is the last one.bool
) — Whether or not the current process is the main one.bool
) — Whether or not the current process is the main one on the local node.bool
) — Whether or not the current script is being run in debug mode.self.fork_lauched
is True
and group
is None
, 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,_a="The other processes will enter the with block after the main process exits.",Xs,D,Xe,Ps,bt,ja="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 name
, and will disable all other plugins.",Fs,k,Qe,Hs,$t,Ta=`Splits input
between self.num_processes
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 dict
, all keys need to have the same number of elements.",Rs,fe,kt,We,Nt,I,ze,Ys,_t,xa="Singleton class that has information related to gradient synchronization for gradient accumulation",As,jt,Ba="Available attributes:",qs,vt,Ca=`bool
) — Whether we have reached the end the current dataloaderint
) — The number of extra samples that were added from padding the dataloaderbool
) — Whether the gradients should be synced across all devicesOptional[DataLoader]
) — The dataloader that is currently being iterated overList[Optional[DataLoader]]
) — A list of references to the dataloaders that are
being iterated overint
) — The number of steps to accumulate overbool
) — Whether the scheduler should be adjusted to account for the gradient
accumulationbool
) — Whether the gradients should be synced at the end of the dataloader
iteration and the number of total steps resetbool
) — 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.bool
, optional) —
Whether or not to force the script to execute on CPU. Will ignore any accelerators available if set to
True
and force the execution on the CPU.`,name:"cpu"},{anchor:"accelerate.PartialState.kwargs",description:`kwargs (additional keyword arguments, optional) —
Additional keyword arguments to pass to the relevant init_process_group
function. Valid kwargs
can be
found in utils.InitProcessGroupKwargs. See the example section for detailed usage.`,name:"kwargs"}],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L124"}}),se=new P({props:{anchor:"accelerate.PartialState.example",$$slots:{default:[Za]},$$scope:{ctx:T}}}),_e=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/v1.10.1/src/accelerate/state.py#L840"}}),je=new C({props:{name:"local_main_process_first",anchor:"accelerate.PartialState.local_main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L528"}}),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/v1.10.1/src/accelerate/state.py#L507"}}),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:"function (Callable
) — The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L610"}}),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:"function (Callable
) — The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L579"}}),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:`function (Callable
, optional) —
The function to decorate.`,name:"function"},{anchor:"accelerate.PartialState.on_local_process.local_process_index",description:`local_process_index (int
, optional) —
The index of the local process on which to run the function.`,name:"local_process_index"}],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L671"}}),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:"function (Callable
) — The function to decorate.",name:"function"}],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L549"}}),pe=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:`function (Callable
, optional
) —
The function to decorate.`,name:"function"},{anchor:"accelerate.PartialState.on_process.process_index",description:`process_index (int
, optional
) —
The index of the process on which to run the function.`,name:"process_index"}],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L638"}}),ie=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/v1.10.1/src/accelerate/state.py#L814"}}),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:`inputs (list
, tuple
, torch.Tensor
, dict
of list
/tuple
/torch.Tensor
, or datasets.Dataset
) —
The input to split between processes.`,name:"inputs"},{anchor:"accelerate.PartialState.split_between_processes.apply_padding",description:`apply_padding (bool
, optional
, defaults to False
) —
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 gather()
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/v1.10.1/src/accelerate/state.py#L416"}}),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/v1.10.1/src/accelerate/state.py#L369"}}),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:"parallelism_config",val:" = None"},{name:"_from_accelerator",val:": bool = False"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L863"}}),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/v1.10.1/src/accelerate/state.py#L1078"}}),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/v1.10.1/src/accelerate/state.py#L1195"}}),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/v1.10.1/src/accelerate/state.py#L1171"}}),Xe=new C({props:{name:"main_process_first",anchor:"accelerate.state.AcceleratorState.main_process_first",parameters:[],source:"https://github.com/huggingface/accelerate/blob/v1.10.1/src/accelerate/state.py#L1161"}}),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/v1.10.1/src/accelerate/state.py#L1202"}}),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:`inputs (list
, tuple
, torch.Tensor
, or dict
of list
/tuple
/torch.Tensor
) —
The input to split between processes.`,name:"inputs"},{anchor:"accelerate.state.AcceleratorState.split_between_processes.apply_padding",description:`apply_padding (bool
, optional
, defaults to False
) —
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 gather()
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/v1.10.1/src/accelerate/state.py#L1119"}}),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/v1.10.1/src/accelerate/state.py#L1228"}}),Fe=new Na({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(),m=o("p"),m.innerHTML=Ds,Ct=l(),Me=o("p"),Me.textContent=Ls,It=l(),u($e.$$.fragment),St=l(),j=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(_e.$$.fragment),At=l(),qe=o("p"),qe.textContent=ta,qt=l(),S=o("div"),u(je.$$.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),ps=l(),H=o("div"),u(Je.$$.fragment),is=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=pa,us=l(),u(pe.$$.fragment),gs=l(),R=o("div"),u(Be.$$.fragment),fs=l(),nt=o("p"),nt.textContent=ia,bs=l(),u(ie.$$.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,_s=l(),ot=o("p"),ot.innerHTML=ha,js=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(),pt=o("p"),pt.textContent=ga,xs=l(),it=o("p"),it.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=_a,Xs=l(),D=o("div"),u(Xe.$$.fragment),Ps=l(),bt=o("p"),bt.textContent=ja,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(),_t=o("p"),_t.textContent=xa,As=l(),jt=o("p"),jt.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(p),_=r(t),d=c(t,"P",{}),J(d).forEach(p),n=r(t),g(i.$$.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),j=c(t,"DIV",{class:!0});var v=J(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-16rmx8z"&&(Ae.innerHTML=ea),Rt=r(v),g(se.$$.fragment,v),Yt=r(v),ae=c(v,"DIV",{class:!0});var He=J(ae);g(_e.$$.fragment,He),At=r(He),qe=c(He,"P",{"data-svelte-h":!0}),$(qe)!=="svelte-5dvbzj"&&(qe.textContent=ta),He.forEach(p),qt=r(v),S=c(v,"DIV",{class:!0});var N=J(S);g(je.$$.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(p),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(p),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(p),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(p),ps=r(v),H=c(v,"DIV",{class:!0});var O=J(H);g(Je.$$.fragment,O),is=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(p),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=pa),us=r(ee),g(pe.$$.fragment,ee),ee.forEach(p),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=ia),bs=r(te),g(ie.$$.fragment,te),te.forEach(p),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(p),$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),_s=r(X),ot=c(X,"P",{"data-svelte-h":!0}),$(ot)!=="svelte-hvuw2l"&&(ot.innerHTML=ha),js=r(X),g(me.$$.fragment,X),X.forEach(p),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(p),v.forEach(p),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),pt=c(B,"P",{"data-svelte-h":!0}),$(pt)!=="svelte-x2ar5c"&&(pt.textContent=ga),xs=r(B),it=c(B,"P",{"data-svelte-h":!0}),$(it)!=="svelte-17v1xbv"&&(it.innerHTML=fa),Bs=r(B),dt=c(B,"UL",{"data-svelte-h":!0}),$(dt)!=="svelte-11weliv"&&(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(p),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(p),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=_a),Jt.forEach(p),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=ja),Qs=r(xt),yt=c(xt,"P",{"data-svelte-h":!0}),$(yt)!=="svelte-144ycie"&&(yt.textContent=va),xt.forEach(p),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(p),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(p),B.forEach(p),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),_t=c(ye,"P",{"data-svelte-h":!0}),$(_t)!=="svelte-1pw2ldw"&&(_t.textContent=xa),As=r(ye),jt=c(ye,"P",{"data-svelte-h":!0}),$(jt)!=="svelte-17v1xbv"&&(jt.innerHTML=Ba),qs=r(ye),vt=c(ye,"UL",{"data-svelte-h":!0}),$(vt)!=="svelte-kdkw1r"&&(vt.innerHTML=Ca),ye.forEach(p),Zt=r(t),g(Fe.$$.fragment,t),Xt=r(t),Bt=c(t,"P",{}),J(Bt).forEach(p),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(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(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,_,h),w(t,d,h),w(t,n,h),f(i,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,j,h),f(we,j,null),s(j,Ft),s(j,Re),s(j,Ht),s(j,Ye),s(j,Vt),s(j,Ae),s(j,Rt),f(se,j,null),s(j,Yt),s(j,ae),f(_e,ae,null),s(ae,At),s(ae,qe),s(j,qt),s(j,S),f(je,S,null),s(S,Dt),s(S,De),s(S,Lt),s(S,Le),s(S,Kt),f(ne,S,null),s(j,Ot),s(j,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(j,as),s(j,z),f(Ue,z,null),s(z,ns),s(z,et),s(z,ls),f(re,z,null),s(j,rs),s(j,F),f(Te,F,null),s(F,os),s(F,tt),s(F,cs),f(oe,F,null),s(j,ps),s(j,H),f(Je,H,null),s(H,is),s(H,st),s(H,ds),f(ce,H,null),s(j,ms),s(j,V),f(xe,V,null),s(V,hs),s(V,at),s(V,us),f(pe,V,null),s(j,gs),s(j,R),f(Be,R,null),s(R,fs),s(R,nt),s(R,bs),f(ie,R,null),s(j,ys),s(j,de),f(Ce,de,null),s(de,Ms),s(de,lt),s(j,$s),s(j,E),f(Ie,E,null),s(E,ws),s(E,rt),s(E,_s),s(E,ot),s(E,js),f(me,E,null),s(j,vs),s(j,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,pt),s(U,xs),s(U,it),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,_t),s(I,As),s(I,jt),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}),pe.$set(O);const ee={};h&2&&(ee.$$scope={dirty:h,ctx:t}),ie.$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(i.$$.fragment,t),b($e.$$.fragment,t),b(we.$$.fragment,t),b(se.$$.fragment,t),b(_e.$$.fragment,t),b(je.$$.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(pe.$$.fragment,t),b(Be.$$.fragment,t),b(ie.$$.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(i.$$.fragment,t),y($e.$$.fragment,t),y(we.$$.fragment,t),y(se.$$.fragment,t),y(_e.$$.fragment,t),y(je.$$.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(pe.$$.fragment,t),y(Be.$$.fragment,t),y(ie.$$.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&&(p(_),p(d),p(n),p(e),p(m),p(Ct),p(Me),p(It),p(St),p(j),p(Gt),p(Et),p(U),p(kt),p(Nt),p(I),p(Zt),p(Xt),p(Bt)),p(a),M(i,t),M($e,t),M(we),M(se),M(_e),M(je),M(ne),M(ve),M(le),M(Ue),M(re),M(Te),M(oe),M(Je),M(ce),M(xe),M(pe),M(Be),M(ie),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};