import{s as jt,o as Kt,n as Q}from"../chunks/scheduler.b9285784.js";import{S as Ct,i as Gt,e as $,s,c as m,h as Jt,a as w,d as l,b as c,f as Y,g as d,j as _,k as N,l as p,m as i,n as f,t as g,o as u,p as h}from"../chunks/index.26bc89a1.js";import{T as ht}from"../chunks/Tip.e4eba3d6.js";import{C as Ut,H as z,E as Yt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.7242ff19.js";import{D as L}from"../chunks/Docstring.9ffdb58c.js";import{C as Ce}from"../chunks/CodeBlock.c8ee1711.js";import{E as Ke}from"../chunks/ExampleCodeBlock.89d3b91e.js";function Nt(k){let a,b="Example:",o,n,y;return n=new Ce({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQWZyb20lMjBhY2NlbGVyYXRlLnV0aWxzJTIwaW1wb3J0JTIwQXV0b2Nhc3RLd2FyZ3MlMEElMEFrd2FyZ3MlMjAlM0QlMjBBdXRvY2FzdEt3YXJncyhjYWNoZV9lbmFibGVkJTNEVHJ1ZSklMEFhY2NlbGVyYXRvciUyMCUzRCUyMEFjY2VsZXJhdG9yKGt3YXJnc19oYW5kbGVycyUzRCU1Qmt3YXJncyU1RCk=",highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator
<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> AutocastKwargs

kwargs = AutocastKwargs(cache_enabled=<span class="hljs-literal">True</span>)
accelerator = Accelerator(kwargs_handlers=[kwargs])`,wrap:!1}}),{c(){a=$("p"),a.textContent=b,o=s(),m(n.$$.fragment)},l(t){a=w(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=b),o=c(t),d(n.$$.fragment,t)},m(t,v){i(t,a,v),i(t,o,v),f(n,t,v),y=!0},p:Q,i(t){y||(g(n.$$.fragment,t),y=!0)},o(t){u(n.$$.fragment,t),y=!1},d(t){t&&(l(a),l(o)),h(n,t)}}}function Ft(k){let a,b="<code>gradient_as_bucket_view</code> is only available in PyTorch 1.7.0 and later versions.",o,n,y="<code>static_graph</code> is only available in PyTorch 1.11.0 and later versions.";return{c(){a=$("p"),a.innerHTML=b,o=s(),n=$("p"),n.innerHTML=y},l(t){a=w(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-wnn996"&&(a.innerHTML=b),o=c(t),n=w(t,"P",{"data-svelte-h":!0}),_(n)!=="svelte-nj3kvq"&&(n.innerHTML=y)},m(t,v){i(t,a,v),i(t,o,v),i(t,n,v)},p:Q,d(t){t&&(l(a),l(o),l(n))}}}function Rt(k){let a,b="Example:",o,n,y;return n=new Ce({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQWZyb20lMjBhY2NlbGVyYXRlLnV0aWxzJTIwaW1wb3J0JTIwRGlzdHJpYnV0ZWREYXRhUGFyYWxsZWxLd2FyZ3MlMEElMEFrd2FyZ3MlMjAlM0QlMjBEaXN0cmlidXRlZERhdGFQYXJhbGxlbEt3YXJncyhmaW5kX3VudXNlZF9wYXJhbWV0ZXJzJTNEVHJ1ZSklMEFhY2NlbGVyYXRvciUyMCUzRCUyMEFjY2VsZXJhdG9yKGt3YXJnc19oYW5kbGVycyUzRCU1Qmt3YXJncyU1RCk=",highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator
<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> DistributedDataParallelKwargs

kwargs = DistributedDataParallelKwargs(find_unused_parameters=<span class="hljs-literal">True</span>)
accelerator = Accelerator(kwargs_handlers=[kwargs])`,wrap:!1}}),{c(){a=$("p"),a.textContent=b,o=s(),m(n.$$.fragment)},l(t){a=w(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=b),o=c(t),d(n.$$.fragment,t)},m(t,v){i(t,a,v),i(t,o,v),f(n,t,v),y=!0},p:Q,i(t){y||(g(n.$$.fragment,t),y=!0)},o(t){u(n.$$.fragment,t),y=!1},d(t){t&&(l(a),l(o)),h(n,t)}}}function Xt(k){let a,b="<code>torch.profiler</code> is only available in PyTorch 1.8.1 and later versions.";return{c(){a=$("p"),a.innerHTML=b},l(o){a=w(o,"P",{"data-svelte-h":!0}),_(a)!=="svelte-27ihid"&&(a.innerHTML=b)},m(o,n){i(o,a,n)},p:Q,d(o){o&&l(a)}}}function Lt(k){let a,b="Example:",o,n,y;return n=new Ce({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQWZyb20lMjBhY2NlbGVyYXRlLnV0aWxzJTIwaW1wb3J0JTIwUHJvZmlsZUt3YXJncyUwQSUwQWt3YXJncyUyMCUzRCUyMFByb2ZpbGVLd2FyZ3MoYWN0aXZpdGllcyUzRCU1QiUyMmNwdSUyMiUyQyUyMCUyMmN1ZGElMjIlNUQpJTBBYWNjZWxlcmF0b3IlMjAlM0QlMjBBY2NlbGVyYXRvcihrd2FyZ3NfaGFuZGxlcnMlM0QlNUJrd2FyZ3MlNUQp",highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator
<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> ProfileKwargs

kwargs = ProfileKwargs(activities=[<span class="hljs-string">&quot;cpu&quot;</span>, <span class="hljs-string">&quot;cuda&quot;</span>])
accelerator = Accelerator(kwargs_handlers=[kwargs])`,wrap:!1}}),{c(){a=$("p"),a.textContent=b,o=s(),m(n.$$.fragment)},l(t){a=w(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=b),o=c(t),d(n.$$.fragment,t)},m(t,v){i(t,a,v),i(t,o,v),f(n,t,v),y=!0},p:Q,i(t){y||(g(n.$$.fragment,t),y=!0)},o(t){u(n.$$.fragment,t),y=!1},d(t){t&&(l(a),l(o)),h(n,t)}}}function Dt(k){let a,b=`<code>torch.cuda.amp.GradScaler</code> is only available in PyTorch 1.5.0 and later versions, and <code>torch.amp.GradScaler</code> is
only available in PyTorch 2.4.0 and later versions.`;return{c(){a=$("p"),a.innerHTML=b},l(o){a=w(o,"P",{"data-svelte-h":!0}),_(a)!=="svelte-7quoha"&&(a.innerHTML=b)},m(o,n){i(o,a,n)},p:Q,d(o){o&&l(a)}}}function Et(k){let a,b="Example:",o,n,y;return n=new Ce({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQWZyb20lMjBhY2NlbGVyYXRlLnV0aWxzJTIwaW1wb3J0JTIwR3JhZFNjYWxlckt3YXJncyUwQSUwQWt3YXJncyUyMCUzRCUyMEdyYWRTY2FsZXJLd2FyZ3MoYmFja29mZl9mYWN0b3IlM0QwLjI1KSUwQWFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b3Ioa3dhcmdzX2hhbmRsZXJzJTNEJTVCa3dhcmdzJTVEKQ==",highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator
<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> GradScalerKwargs

kwargs = GradScalerKwargs(backoff_factor=<span class="hljs-number">0.25</span>)
accelerator = Accelerator(kwargs_handlers=[kwargs])`,wrap:!1}}),{c(){a=$("p"),a.textContent=b,o=s(),m(n.$$.fragment)},l(t){a=w(t,"P",{"data-svelte-h":!0}),_(a)!=="svelte-11lpom8"&&(a.textContent=b),o=c(t),d(n.$$.fragment,t)},m(t,v){i(t,a,v),i(t,o,v),f(n,t,v),y=!0},p:Q,i(t){y||(g(n.$$.fragment,t),y=!0)},o(t){u(n.$$.fragment,t),y=!1},d(t){t&&(l(a),l(o)),h(n,t)}}}function Vt(k){let a,b;return a=new Ce({props:{code:"ZnJvbSUyMGRhdGV0aW1lJTIwaW1wb3J0JTIwdGltZWRlbHRhJTBBZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQWZyb20lMjBhY2NlbGVyYXRlLnV0aWxzJTIwaW1wb3J0JTIwSW5pdFByb2Nlc3NHcm91cEt3YXJncyUwQSUwQWt3YXJncyUyMCUzRCUyMEluaXRQcm9jZXNzR3JvdXBLd2FyZ3ModGltZW91dCUzRHRpbWVkZWx0YShzZWNvbmRzJTNEODAwKSklMEFhY2NlbGVyYXRvciUyMCUzRCUyMEFjY2VsZXJhdG9yKGt3YXJnc19oYW5kbGVycyUzRCU1Qmt3YXJncyU1RCk=",highlighted:`<span class="hljs-keyword">from</span> datetime <span class="hljs-keyword">import</span> timedelta
<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator
<span class="hljs-keyword">from</span> accelerate.utils <span class="hljs-keyword">import</span> InitProcessGroupKwargs

kwargs = InitProcessGroupKwargs(timeout=timedelta(seconds=<span class="hljs-number">800</span>))
accelerator = Accelerator(kwargs_handlers=[kwargs])`,wrap:!1}}),{c(){m(a.$$.fragment)},l(o){d(a.$$.fragment,o)},m(o,n){f(a,o,n),b=!0},p:Q,i(o){b||(g(a.$$.fragment,o),b=!0)},o(o){u(a.$$.fragment,o),b=!1},d(o){h(a,o)}}}function Zt(k){let a,b,o,n,y,t,v,Ge,O,$t=`The following objects can be passed to the main <a href="/docs/accelerate/main/en/package_reference/accelerator#accelerate.Accelerator">Accelerator</a> to customize how some PyTorch objects
related to distributed training or mixed precision are created.`,Je,q,Ue,K,ee,ze,we,wt=`Use this object in your <a href="/docs/accelerate/main/en/package_reference/accelerator#accelerate.Accelerator">Accelerator</a> to customize how <code>torch.autocast</code> behaves. Please refer to the
documentation of this <a href="https://pytorch.org/docs/stable/amp.html#torch.autocast" rel="nofollow">context manager</a> for more
information on each argument.`,Qe,D,Ye,te,Ne,M,ae,Oe,be,bt=`Use this object in your <a href="/docs/accelerate/main/en/package_reference/accelerator#accelerate.Accelerator">Accelerator</a> to customize how your model is wrapped in a
<code>torch.nn.parallel.DistributedDataParallel</code>. Please refer to the documentation of this
<a href="https://pytorch.org/docs/stable/generated/torch.nn.parallel.DistributedDataParallel.html" rel="nofollow">wrapper</a> for more
information on each argument.`,qe,E,et,V,Fe,re,Re,F,le,tt,ye,yt=`Deprecated. Please use one of the proper FP8 recipe kwargs classes such as <code>TERecipeKwargs</code> or <code>MSAMPRecipeKwargs</code>
instead.`,Xe,oe,Le,x,ne,at,ve,vt=`Use this object in your <a href="/docs/accelerate/main/en/package_reference/accelerator#accelerate.Accelerator">Accelerator</a> to customize the initialization of the profiler. Please refer to the
documentation of this <a href="https://pytorch.org/docs/stable/profiler.html#torch.profiler.profile" rel="nofollow">context manager</a> for
more information on each argument.`,rt,Z,lt,H,ot,W,se,nt,_e,_t="Build a profiler object with the current configuration.",De,ce,Ee,P,ie,st,ke,kt=`Use this object in your <a href="/docs/accelerate/main/en/package_reference/accelerator#accelerate.Accelerator">Accelerator</a> to customize the behavior of mixed precision, specifically how the
<code>torch.amp.GradScaler</code> or <code>torch.cuda.amp.GradScaler</code> used is created. Please refer to the documentation of this
<a href="https://pytorch.org/docs/stable/amp.html?highlight=gradscaler" rel="nofollow">scaler</a> for more information on each argument.`,ct,A,it,B,Ve,pe,Ze,T,me,pt,xe,xt=`Use this object in your <a href="/docs/accelerate/main/en/package_reference/accelerator#accelerate.Accelerator">Accelerator</a> to customize the initialization of the distributed processes. Please refer
to the documentation of this
<a href="https://pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group" rel="nofollow">method</a> for more
information on each argument.`,mt,Me,Mt="Note: If <code>timeout</code> is set to <code>None</code>, the default will be based upon how <code>backend</code> is set.",dt,I,He,de,We,C,fe,ft,Pe,Pt="Internal mixin that implements a <code>to_kwargs()</code> method for a dataclass.",gt,S,ge,ut,Te,Tt="Returns a dictionary containing the attributes with values different from the default of this class.",Ae,ue,Be,je,Ie;return y=new Ut({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),v=new z({props:{title:"Kwargs handlers",local:"kwargs-handlers",headingTag:"h1"}}),q=new z({props:{title:"AutocastKwargs",local:"accelerate.AutocastKwargs",headingTag:"h2"}}),ee=new L({props:{name:"class accelerate.AutocastKwargs",anchor:"accelerate.AutocastKwargs",parameters:[{name:"enabled",val:": bool = True"},{name:"cache_enabled",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L112"}}),D=new Ke({props:{anchor:"accelerate.AutocastKwargs.example",$$slots:{default:[Nt]},$$scope:{ctx:k}}}),te=new z({props:{title:"DistributedDataParallelKwargs",local:"accelerate.DistributedDataParallelKwargs",headingTag:"h2"}}),ae=new L({props:{name:"class accelerate.DistributedDataParallelKwargs",anchor:"accelerate.DistributedDataParallelKwargs",parameters:[{name:"dim",val:": int = 0"},{name:"broadcast_buffers",val:": bool = True"},{name:"bucket_cap_mb",val:": int = 25"},{name:"find_unused_parameters",val:": bool = False"},{name:"check_reduction",val:": bool = False"},{name:"gradient_as_bucket_view",val:": bool = False"},{name:"static_graph",val:": bool = False"},{name:"comm_hook",val:": DDPCommunicationHookType = <DDPCommunicationHookType.NO: 'no'>"},{name:"comm_wrapper",val:": typing.Literal[<DDPCommunicationHookType.NO: 'no'>, <DDPCommunicationHookType.FP16: 'fp16'>, <DDPCommunicationHookType.BF16: 'bf16'>] = <DDPCommunicationHookType.NO: 'no'>"},{name:"comm_state_option",val:": dict = <factory>"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L154"}}),E=new ht({props:{warning:!0,$$slots:{default:[Ft]},$$scope:{ctx:k}}}),V=new Ke({props:{anchor:"accelerate.DistributedDataParallelKwargs.example",$$slots:{default:[Rt]},$$scope:{ctx:k}}}),re=new z({props:{title:"FP8RecipeKwargs",local:"accelerate.utils.FP8RecipeKwargs",headingTag:"h2"}}),le=new L({props:{name:"class accelerate.utils.FP8RecipeKwargs",anchor:"accelerate.utils.FP8RecipeKwargs",parameters:[{name:"opt_level",val:": typing.Literal['O1', 'O2'] = None"},{name:"use_autocast_during_eval",val:": typing.Optional[bool] = None"},{name:"margin",val:": typing.Optional[int] = None"},{name:"interval",val:": typing.Optional[int] = None"},{name:"fp8_format",val:": typing.Literal['HYBRID', 'E4M3', 'E5M2'] = None"},{name:"amax_history_len",val:": typing.Optional[int] = None"},{name:"amax_compute_algo",val:": typing.Literal['max', 'most_recent'] = None"},{name:"override_linear_precision",val:": tuple = None"},{name:"use_mxfp8_block_scaling",val:": typing.Optional[bool] = None"},{name:"backend",val:": typing.Literal['MSAMP', 'TE'] = None"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L425"}}),oe=new z({props:{title:"ProfileKwargs",local:"accelerate.ProfileKwargs",headingTag:"h2"}}),ne=new L({props:{name:"class accelerate.ProfileKwargs",anchor:"accelerate.ProfileKwargs",parameters:[{name:"activities",val:": typing.Optional[list[typing.Literal['cpu', 'xpu', 'mtia', 'cuda', 'hpu']]] = None"},{name:"schedule_option",val:": typing.Optional[dict[str, int]] = None"},{name:"on_trace_ready",val:": typing.Optional[typing.Callable] = None"},{name:"record_shapes",val:": bool = False"},{name:"profile_memory",val:": bool = False"},{name:"with_stack",val:": bool = False"},{name:"with_flops",val:": bool = False"},{name:"with_modules",val:": bool = False"},{name:"output_trace_dir",val:": typing.Optional[str] = None"}],parametersDescription:[{anchor:"accelerate.ProfileKwargs.activities",description:`<strong>activities</strong> (<code>List[str]</code>, <em>optional</em>, default to <code>None</code>) &#x2014;
The list of activity groups to use in profiling. Must be one of <code>&quot;cpu&quot;</code>, <code>&quot;xpu&quot;</code>, <code>&quot;mtia&quot;</code>, &#x201C;hpu&#x201D; or
<code>&quot;cuda&quot;</code>.`,name:"activities"},{anchor:"accelerate.ProfileKwargs.schedule_option",description:`<strong>schedule_option</strong> (<code>Dict[str, int]</code>, <em>optional</em>, default to <code>None</code>) &#x2014;
The schedule option to use for the profiler. Available keys are <code>wait</code>, <code>warmup</code>, <code>active</code>, <code>repeat</code> and
<code>skip_first</code>. The profiler will skip the first <code>skip_first</code> steps, then wait for <code>wait</code> steps, then do the
warmup for the next <code>warmup</code> steps, then do the active recording for the next <code>active</code> steps and then
repeat the cycle starting with <code>wait</code> steps. The optional number of cycles is specified with the <code>repeat</code>
parameter, the zero value means that the cycles will continue until the profiling is finished.`,name:"schedule_option"},{anchor:"accelerate.ProfileKwargs.on_trace_ready",description:`<strong>on_trace_ready</strong> (<code>Callable</code>, <em>optional</em>, default to <code>None</code>) &#x2014;
Callable that is called at each step when schedule returns <code>ProfilerAction.RECORD_AND_SAVE</code> during the
profiling.`,name:"on_trace_ready"},{anchor:"accelerate.ProfileKwargs.record_shapes",description:`<strong>record_shapes</strong> (<code>bool</code>, <em>optional</em>, default to <code>False</code>) &#x2014;
Save information about operator&#x2019;s input shapes.`,name:"record_shapes"},{anchor:"accelerate.ProfileKwargs.profile_memory",description:`<strong>profile_memory</strong> (<code>bool</code>, <em>optional</em>, default to <code>False</code>) &#x2014;
Track tensor memory allocation/deallocation`,name:"profile_memory"},{anchor:"accelerate.ProfileKwargs.with_stack",description:`<strong>with_stack</strong> (<code>bool</code>, <em>optional</em>, default to <code>False</code>) &#x2014;
Record source information (file and line number) for the ops.`,name:"with_stack"},{anchor:"accelerate.ProfileKwargs.with_flops",description:`<strong>with_flops</strong> (<code>bool</code>, <em>optional</em>, default to <code>False</code>) &#x2014;
Use formula to estimate the FLOPS of specific operators`,name:"with_flops"},{anchor:"accelerate.ProfileKwargs.with_modules",description:`<strong>with_modules</strong> (<code>bool</code>, <em>optional</em>, default to <code>False</code>) &#x2014;
Record module hierarchy (including function names) corresponding to the callstack of the op.`,name:"with_modules"},{anchor:"accelerate.ProfileKwargs.output_trace_dir",description:`<strong>output_trace_dir</strong> (<code>str</code>, <em>optional</em>, default to <code>None</code>) &#x2014;
Exports the collected trace in Chrome JSON format. Chrome use &#x2018;chrome://tracing&#x2019; view json file. Defaults
to None, which means profiling does not store json files.`,name:"output_trace_dir"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L454"}}),Z=new ht({props:{warning:!0,$$slots:{default:[Xt]},$$scope:{ctx:k}}}),H=new Ke({props:{anchor:"accelerate.ProfileKwargs.example",$$slots:{default:[Lt]},$$scope:{ctx:k}}}),se=new L({props:{name:"build",anchor:"accelerate.ProfileKwargs.build",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L544",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The profiler object.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>torch.profiler.profile</p>
`}}),ce=new z({props:{title:"GradScalerKwargs",local:"accelerate.GradScalerKwargs",headingTag:"h2"}}),ie=new L({props:{name:"class accelerate.GradScalerKwargs",anchor:"accelerate.GradScalerKwargs",parameters:[{name:"init_scale",val:": float = 65536.0"},{name:"growth_factor",val:": float = 2.0"},{name:"backoff_factor",val:": float = 0.5"},{name:"growth_interval",val:": int = 2000"},{name:"enabled",val:": bool = True"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L240"}}),A=new ht({props:{warning:!0,$$slots:{default:[Dt]},$$scope:{ctx:k}}}),B=new Ke({props:{anchor:"accelerate.GradScalerKwargs.example",$$slots:{default:[Et]},$$scope:{ctx:k}}}),pe=new z({props:{title:"InitProcessGroupKwargs",local:"accelerate.InitProcessGroupKwargs",headingTag:"h2"}}),me=new L({props:{name:"class accelerate.InitProcessGroupKwargs",anchor:"accelerate.InitProcessGroupKwargs",parameters:[{name:"backend",val:": typing.Optional[str] = 'nccl'"},{name:"init_method",val:": typing.Optional[str] = None"},{name:"timeout",val:": typing.Optional[datetime.timedelta] = None"}],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L272"}}),I=new Ke({props:{anchor:"accelerate.InitProcessGroupKwargs.example",$$slots:{default:[Vt]},$$scope:{ctx:k}}}),de=new z({props:{title:"KwargsHandler",local:"accelerate.utils.KwargsHandler",headingTag:"h2"}}),fe=new L({props:{name:"class accelerate.utils.KwargsHandler",anchor:"accelerate.utils.KwargsHandler",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L67"}}),ge=new L({props:{name:"to_kwargs",anchor:"accelerate.utils.KwargsHandler.to_kwargs",parameters:[],source:"https://github.com/huggingface/accelerate/blob/main/src/accelerate/utils/dataclasses.py#L75"}}),ue=new Yt({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/package_reference/kwargs.md"}}),{c(){a=$("meta"),b=s(),o=$("p"),n=s(),m(y.$$.fragment),t=s(),m(v.$$.fragment),Ge=s(),O=$("p"),O.innerHTML=$t,Je=s(),m(q.$$.fragment),Ue=s(),K=$("div"),m(ee.$$.fragment),ze=s(),we=$("p"),we.innerHTML=wt,Qe=s(),m(D.$$.fragment),Ye=s(),m(te.$$.fragment),Ne=s(),M=$("div"),m(ae.$$.fragment),Oe=s(),be=$("p"),be.innerHTML=bt,qe=s(),m(E.$$.fragment),et=s(),m(V.$$.fragment),Fe=s(),m(re.$$.fragment),Re=s(),F=$("div"),m(le.$$.fragment),tt=s(),ye=$("p"),ye.innerHTML=yt,Xe=s(),m(oe.$$.fragment),Le=s(),x=$("div"),m(ne.$$.fragment),at=s(),ve=$("p"),ve.innerHTML=vt,rt=s(),m(Z.$$.fragment),lt=s(),m(H.$$.fragment),ot=s(),W=$("div"),m(se.$$.fragment),nt=s(),_e=$("p"),_e.textContent=_t,De=s(),m(ce.$$.fragment),Ee=s(),P=$("div"),m(ie.$$.fragment),st=s(),ke=$("p"),ke.innerHTML=kt,ct=s(),m(A.$$.fragment),it=s(),m(B.$$.fragment),Ve=s(),m(pe.$$.fragment),Ze=s(),T=$("div"),m(me.$$.fragment),pt=s(),xe=$("p"),xe.innerHTML=xt,mt=s(),Me=$("p"),Me.innerHTML=Mt,dt=s(),m(I.$$.fragment),He=s(),m(de.$$.fragment),We=s(),C=$("div"),m(fe.$$.fragment),ft=s(),Pe=$("p"),Pe.innerHTML=Pt,gt=s(),S=$("div"),m(ge.$$.fragment),ut=s(),Te=$("p"),Te.textContent=Tt,Ae=s(),m(ue.$$.fragment),Be=s(),je=$("p"),this.h()},l(e){const r=Jt("svelte-u9bgzb",document.head);a=w(r,"META",{name:!0,content:!0}),r.forEach(l),b=c(e),o=w(e,"P",{}),Y(o).forEach(l),n=c(e),d(y.$$.fragment,e),t=c(e),d(v.$$.fragment,e),Ge=c(e),O=w(e,"P",{"data-svelte-h":!0}),_(O)!=="svelte-7kapym"&&(O.innerHTML=$t),Je=c(e),d(q.$$.fragment,e),Ue=c(e),K=w(e,"DIV",{class:!0});var R=Y(K);d(ee.$$.fragment,R),ze=c(R),we=w(R,"P",{"data-svelte-h":!0}),_(we)!=="svelte-1jb00m3"&&(we.innerHTML=wt),Qe=c(R),d(D.$$.fragment,R),R.forEach(l),Ye=c(e),d(te.$$.fragment,e),Ne=c(e),M=w(e,"DIV",{class:!0});var G=Y(M);d(ae.$$.fragment,G),Oe=c(G),be=w(G,"P",{"data-svelte-h":!0}),_(be)!=="svelte-1xgprge"&&(be.innerHTML=bt),qe=c(G),d(E.$$.fragment,G),et=c(G),d(V.$$.fragment,G),G.forEach(l),Fe=c(e),d(re.$$.fragment,e),Re=c(e),F=w(e,"DIV",{class:!0});var he=Y(F);d(le.$$.fragment,he),tt=c(he),ye=w(he,"P",{"data-svelte-h":!0}),_(ye)!=="svelte-1b6vct0"&&(ye.innerHTML=yt),he.forEach(l),Xe=c(e),d(oe.$$.fragment,e),Le=c(e),x=w(e,"DIV",{class:!0});var j=Y(x);d(ne.$$.fragment,j),at=c(j),ve=w(j,"P",{"data-svelte-h":!0}),_(ve)!=="svelte-1ypmxbx"&&(ve.innerHTML=vt),rt=c(j),d(Z.$$.fragment,j),lt=c(j),d(H.$$.fragment,j),ot=c(j),W=w(j,"DIV",{class:!0});var $e=Y(W);d(se.$$.fragment,$e),nt=c($e),_e=w($e,"P",{"data-svelte-h":!0}),_(_e)!=="svelte-y3n9ph"&&(_e.textContent=_t),$e.forEach(l),j.forEach(l),De=c(e),d(ce.$$.fragment,e),Ee=c(e),P=w(e,"DIV",{class:!0});var J=Y(P);d(ie.$$.fragment,J),st=c(J),ke=w(J,"P",{"data-svelte-h":!0}),_(ke)!=="svelte-kb38j6"&&(ke.innerHTML=kt),ct=c(J),d(A.$$.fragment,J),it=c(J),d(B.$$.fragment,J),J.forEach(l),Ve=c(e),d(pe.$$.fragment,e),Ze=c(e),T=w(e,"DIV",{class:!0});var U=Y(T);d(me.$$.fragment,U),pt=c(U),xe=w(U,"P",{"data-svelte-h":!0}),_(xe)!=="svelte-1y1hln2"&&(xe.innerHTML=xt),mt=c(U),Me=w(U,"P",{"data-svelte-h":!0}),_(Me)!=="svelte-l1d7ay"&&(Me.innerHTML=Mt),dt=c(U),d(I.$$.fragment,U),U.forEach(l),He=c(e),d(de.$$.fragment,e),We=c(e),C=w(e,"DIV",{class:!0});var X=Y(C);d(fe.$$.fragment,X),ft=c(X),Pe=w(X,"P",{"data-svelte-h":!0}),_(Pe)!=="svelte-1g1ngcq"&&(Pe.innerHTML=Pt),gt=c(X),S=w(X,"DIV",{class:!0});var Se=Y(S);d(ge.$$.fragment,Se),ut=c(Se),Te=w(Se,"P",{"data-svelte-h":!0}),_(Te)!=="svelte-1iftwh6"&&(Te.textContent=Tt),Se.forEach(l),X.forEach(l),Ae=c(e),d(ue.$$.fragment,e),Be=c(e),je=w(e,"P",{}),Y(je).forEach(l),this.h()},h(){N(a,"name","hf:doc:metadata"),N(a,"content",Ht),N(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,r){p(document.head,a),i(e,b,r),i(e,o,r),i(e,n,r),f(y,e,r),i(e,t,r),f(v,e,r),i(e,Ge,r),i(e,O,r),i(e,Je,r),f(q,e,r),i(e,Ue,r),i(e,K,r),f(ee,K,null),p(K,ze),p(K,we),p(K,Qe),f(D,K,null),i(e,Ye,r),f(te,e,r),i(e,Ne,r),i(e,M,r),f(ae,M,null),p(M,Oe),p(M,be),p(M,qe),f(E,M,null),p(M,et),f(V,M,null),i(e,Fe,r),f(re,e,r),i(e,Re,r),i(e,F,r),f(le,F,null),p(F,tt),p(F,ye),i(e,Xe,r),f(oe,e,r),i(e,Le,r),i(e,x,r),f(ne,x,null),p(x,at),p(x,ve),p(x,rt),f(Z,x,null),p(x,lt),f(H,x,null),p(x,ot),p(x,W),f(se,W,null),p(W,nt),p(W,_e),i(e,De,r),f(ce,e,r),i(e,Ee,r),i(e,P,r),f(ie,P,null),p(P,st),p(P,ke),p(P,ct),f(A,P,null),p(P,it),f(B,P,null),i(e,Ve,r),f(pe,e,r),i(e,Ze,r),i(e,T,r),f(me,T,null),p(T,pt),p(T,xe),p(T,mt),p(T,Me),p(T,dt),f(I,T,null),i(e,He,r),f(de,e,r),i(e,We,r),i(e,C,r),f(fe,C,null),p(C,ft),p(C,Pe),p(C,gt),p(C,S),f(ge,S,null),p(S,ut),p(S,Te),i(e,Ae,r),f(ue,e,r),i(e,Be,r),i(e,je,r),Ie=!0},p(e,[r]){const R={};r&2&&(R.$$scope={dirty:r,ctx:e}),D.$set(R);const G={};r&2&&(G.$$scope={dirty:r,ctx:e}),E.$set(G);const he={};r&2&&(he.$$scope={dirty:r,ctx:e}),V.$set(he);const j={};r&2&&(j.$$scope={dirty:r,ctx:e}),Z.$set(j);const $e={};r&2&&($e.$$scope={dirty:r,ctx:e}),H.$set($e);const J={};r&2&&(J.$$scope={dirty:r,ctx:e}),A.$set(J);const U={};r&2&&(U.$$scope={dirty:r,ctx:e}),B.$set(U);const X={};r&2&&(X.$$scope={dirty:r,ctx:e}),I.$set(X)},i(e){Ie||(g(y.$$.fragment,e),g(v.$$.fragment,e),g(q.$$.fragment,e),g(ee.$$.fragment,e),g(D.$$.fragment,e),g(te.$$.fragment,e),g(ae.$$.fragment,e),g(E.$$.fragment,e),g(V.$$.fragment,e),g(re.$$.fragment,e),g(le.$$.fragment,e),g(oe.$$.fragment,e),g(ne.$$.fragment,e),g(Z.$$.fragment,e),g(H.$$.fragment,e),g(se.$$.fragment,e),g(ce.$$.fragment,e),g(ie.$$.fragment,e),g(A.$$.fragment,e),g(B.$$.fragment,e),g(pe.$$.fragment,e),g(me.$$.fragment,e),g(I.$$.fragment,e),g(de.$$.fragment,e),g(fe.$$.fragment,e),g(ge.$$.fragment,e),g(ue.$$.fragment,e),Ie=!0)},o(e){u(y.$$.fragment,e),u(v.$$.fragment,e),u(q.$$.fragment,e),u(ee.$$.fragment,e),u(D.$$.fragment,e),u(te.$$.fragment,e),u(ae.$$.fragment,e),u(E.$$.fragment,e),u(V.$$.fragment,e),u(re.$$.fragment,e),u(le.$$.fragment,e),u(oe.$$.fragment,e),u(ne.$$.fragment,e),u(Z.$$.fragment,e),u(H.$$.fragment,e),u(se.$$.fragment,e),u(ce.$$.fragment,e),u(ie.$$.fragment,e),u(A.$$.fragment,e),u(B.$$.fragment,e),u(pe.$$.fragment,e),u(me.$$.fragment,e),u(I.$$.fragment,e),u(de.$$.fragment,e),u(fe.$$.fragment,e),u(ge.$$.fragment,e),u(ue.$$.fragment,e),Ie=!1},d(e){e&&(l(b),l(o),l(n),l(t),l(Ge),l(O),l(Je),l(Ue),l(K),l(Ye),l(Ne),l(M),l(Fe),l(Re),l(F),l(Xe),l(Le),l(x),l(De),l(Ee),l(P),l(Ve),l(Ze),l(T),l(He),l(We),l(C),l(Ae),l(Be),l(je)),l(a),h(y,e),h(v,e),h(q,e),h(ee),h(D),h(te,e),h(ae),h(E),h(V),h(re,e),h(le),h(oe,e),h(ne),h(Z),h(H),h(se),h(ce,e),h(ie),h(A),h(B),h(pe,e),h(me),h(I),h(de,e),h(fe),h(ge),h(ue,e)}}}const Ht='{"title":"Kwargs handlers","local":"kwargs-handlers","sections":[{"title":"AutocastKwargs","local":"accelerate.AutocastKwargs","sections":[],"depth":2},{"title":"DistributedDataParallelKwargs","local":"accelerate.DistributedDataParallelKwargs","sections":[],"depth":2},{"title":"FP8RecipeKwargs","local":"accelerate.utils.FP8RecipeKwargs","sections":[],"depth":2},{"title":"ProfileKwargs","local":"accelerate.ProfileKwargs","sections":[],"depth":2},{"title":"GradScalerKwargs","local":"accelerate.GradScalerKwargs","sections":[],"depth":2},{"title":"InitProcessGroupKwargs","local":"accelerate.InitProcessGroupKwargs","sections":[],"depth":2},{"title":"KwargsHandler","local":"accelerate.utils.KwargsHandler","sections":[],"depth":2}],"depth":1}';function Wt(k){return Kt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qt extends Ct{constructor(a){super(),Gt(this,a,Wt,Zt,jt,{})}}export{qt as component};
