Buckets:
| import"../chunks/DsnmJJEf.js";import{i as Ue,h as ve,C as Je,H as u,D as l,E as fe,s as Te,a as p}from"../chunks/CePRIh9G.js";import{p as Be,o as Ie,s as e,f as i,a as c,b as Se,c as n,d as X,n as m,r as o}from"../chunks/CpNKRKmM.js";import{E as d}from"../chunks/DXNZ3u5l.js";const Ge='{"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}';var Ne=X('<meta name="hf:doc:metadata"/>'),h=X("<p>Example:</p> <!>",1),Ze=X(`<p></p> <!> <!> <p>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.</p> <p>These classes are immutable and store information about certain configurations or | |
| states.</p> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>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>.</p> <p><strong>Available attributes:</strong></p> <ul><li><strong>device</strong> (<code>torch.device</code>) — The device to use.</li> <li><strong>distributed_type</strong> (<a href="/docs/accelerate/pr_4143/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></ul> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Destroys the process group. If one is not specified, the default process group is destroyed.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Lets the local main process go inside a with block.</p> <p>The other processes will enter the with block after the main process exits.</p> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Lets the main process go first inside a with block.</p> <p>The other processes will enter the with block after the main process exits.</p> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Decorator that only runs the decorated function on the last process.</p> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Decorator that only runs the decorated function on the local main process.</p> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Decorator that only runs the decorated function on the process with the given index on the current node.</p> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Decorator that only runs the decorated function on the main process.</p> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Decorator that only runs the decorated function on the process with the given index.</p> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Sets the device in <code>self.device</code> to the current distributed environment.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>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.</p> <p>Note that when using a <code>dict</code>, all keys need to have the same number of elements.</p> <!></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>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.</p> <!></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Singleton class that has information about the current training environment.</p> <p><strong>Available attributes:</strong></p> <ul><li><strong>device</strong> (<code>torch.device</code>) — The device to use.</li> <li><strong>distributed_type</strong> (<a href="/docs/accelerate/pr_4143/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></ul> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Destroys the process group. If one is not specified, the default process group is destroyed.</p> <p>If <code>self.fork_launched</code> is <code>True</code> and <code>group</code> is <code>None</code>, nothing happens.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Returns the DeepSpeedPlugin with the given plugin_key.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Lets the local main process go inside a with block.</p> <p>The other processes will enter the with block after the main process exits.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Lets the main process go first inside a with block.</p> <p>The other processes will enter the with block after the main process exits.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Activates the DeepSpeedPlugin with the given <code>name</code>, and will disable all other plugins.</p></div> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>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.</p> <p>Note that when using a <code>dict</code>, all keys need to have the same number of elements.</p> <!></div></div> <!> <div class="docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"><!> <p>Singleton class that has information related to gradient synchronization for gradient accumulation</p> <p><strong>Available attributes:</strong></p> <ul><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></ul></div> <!> <p></p>`,1);function ke(se,ae){Be(ae,!1),Ie(()=>{new URLSearchParams(window.location.search).get("fw")}),Ue();var x=Ze();ve("kwq5n3",a=>{var r=Ne();Te(r,"content",Ge),c(a,r)});var C=e(i(x),2);Je(C,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var E=e(C,2);u(E,{title:"Stateful Classes",local:"stateful-classes",headingTag:"h1"});var k=e(E,6);u(k,{title:"PartialState",local:"accelerate.PartialState",headingTag:"h2"});var g=e(k,2),Q=n(g);l(Q,{name:"class accelerate.PartialState",anchor:"accelerate.PartialState",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L123",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_4143/en/package_reference/utilities#accelerate.InitProcessGroupKwargs">utils.InitProcessGroupKwargs</a>. See the example section for detailed usage.`,name:"kwargs"}]});var W=e(Q,8);d(W,{anchor:"accelerate.PartialState.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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)',lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}});var y=e(W,2),te=n(y);l(te,{name:"destroy_process_group",anchor:"accelerate.PartialState.destroy_process_group",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L845",parameters:[{name:"group",val:" = None"}]}),m(2),o(y);var b=e(y,2),z=n(b);l(z,{name:"local_main_process_first",anchor:"accelerate.PartialState.local_main_process_first",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L534",parameters:[]});var le=e(z,6);d(le,{anchor:"accelerate.PartialState.local_main_process_first.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>)`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(b);var M=e(b,2),F=n(M);l(F,{name:"main_process_first",anchor:"accelerate.PartialState.main_process_first",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L513",parameters:[]});var ne=e(F,6);d(ne,{anchor:"accelerate.PartialState.main_process_first.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>)`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(M);var _=e(M,2),R=n(_);l(R,{name:"on_last_process",anchor:"accelerate.PartialState.on_last_process",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L616",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"}]});var oe=e(R,4);d(oe,{anchor:"accelerate.PartialState.on_last_process.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(_);var j=e(_,2),Y=n(j);l(Y,{name:"on_local_main_process",anchor:"accelerate.PartialState.on_local_main_process",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L585",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"}]});var re=e(Y,4);d(re,{anchor:"accelerate.PartialState.on_local_main_process.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(j);var w=e(j,2),P=n(w);l(P,{name:"on_local_process",anchor:"accelerate.PartialState.on_local_process",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L677",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"}]});var ce=e(P,4);d(ce,{anchor:"accelerate.PartialState.on_local_process.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(w);var U=e(w,2),A=n(U);l(A,{name:"on_main_process",anchor:"accelerate.PartialState.on_main_process",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L555",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"}]});var ie=e(A,4);d(ie,{anchor:"accelerate.PartialState.on_main_process.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(U);var v=e(U,2),q=n(v);l(q,{name:"on_process",anchor:"accelerate.PartialState.on_process",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L644",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"}]});var pe=e(q,4);d(pe,{anchor:"accelerate.PartialState.on_process.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(v);var J=e(v,2),de=n(J);l(de,{name:"set_device",anchor:"accelerate.PartialState.set_device",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L819",parameters:[]}),m(2),o(J);var f=e(J,2),V=n(f);l(V,{name:"split_between_processes",anchor:"accelerate.PartialState.split_between_processes",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L425",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"}]});var he=e(V,6);d(he,{anchor:"accelerate.PartialState.split_between_processes.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>]`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(f);var H=e(f,2),D=n(H);l(D,{name:"wait_for_everyone",anchor:"accelerate.PartialState.wait_for_everyone",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L377",parameters:[]});var me=e(D,4);d(me,{anchor:"accelerate.PartialState.wait_for_everyone.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>)`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(H),o(g);var $=e(g,2);u($,{title:"AcceleratorState",local:"accelerate.state.AcceleratorState",headingTag:"h2"});var T=e($,2),L=n(T);l(L,{name:"class accelerate.state.AcceleratorState",anchor:"accelerate.state.AcceleratorState",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L868",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:""}]});var B=e(L,8),ue=n(B);l(ue,{name:"destroy_process_group",anchor:"accelerate.state.AcceleratorState.destroy_process_group",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L1081",parameters:[{name:"group",val:" = None"}]}),m(4),o(B);var I=e(B,2),ge=n(I);l(ge,{name:"get_deepspeed_plugin",anchor:"accelerate.state.AcceleratorState.get_deepspeed_plugin",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L1198",parameters:[{name:"name",val:": str"}]}),m(2),o(I);var S=e(I,2),ye=n(S);l(ye,{name:"local_main_process_first",anchor:"accelerate.state.AcceleratorState.local_main_process_first",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L1174",parameters:[]}),m(4),o(S);var G=e(S,2),be=n(G);l(be,{name:"main_process_first",anchor:"accelerate.state.AcceleratorState.main_process_first",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L1164",parameters:[]}),m(4),o(G);var N=e(G,2),Me=n(N);l(Me,{name:"select_deepspeed_plugin",anchor:"accelerate.state.AcceleratorState.select_deepspeed_plugin",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L1205",parameters:[{name:"name",val:": str | None = None"}]}),m(2),o(N);var K=e(N,2),O=n(K);l(O,{name:"split_between_processes",anchor:"accelerate.state.AcceleratorState.split_between_processes",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L1122",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"}]});var _e=e(O,6);d(_e,{anchor:"accelerate.state.AcceleratorState.split_between_processes.example",children:(a,r)=>{var s=h(),t=e(i(s),2);p(t,{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>]`,lang:"python",wrap:!1}),c(a,s)},$$slots:{default:!0}}),o(K),o(T);var ee=e(T,2);u(ee,{title:"GradientState",local:"accelerate.state.GradientState",headingTag:"h2"});var Z=e(ee,2),je=n(Z);l(je,{name:"class accelerate.state.GradientState",anchor:"accelerate.state.GradientState",source:"https://github.com/huggingface/accelerate/blob/vr_4143/src/accelerate/state.py#L1231",parameters:[{name:"gradient_accumulation_plugin",val:": GradientAccumulationPlugin | None = None"}]}),m(6),o(Z);var we=e(Z,2);fe(we,{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/package_reference/state.md"}),m(2),c(se,x),Se()}export{ke as component}; | |
Xet Storage Details
- Size:
- 39.7 kB
- Xet hash:
- 74b98b1c72fd1bcb52a6e5037b030f6a8eca1716737f0f43027faa857d5d70a3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.