Buckets:

HuggingFaceDocBuilder's picture
download
raw
27.9 kB
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 d,h as Jt,a as w,d as l,b as c,f as Y,g as m,j as y,k as N,l as p,m as i,n as f,t as u,o as g,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.7a0ae628.js";import{D as L}from"../chunks/Docstring.3b3b5305.js";import{C as Ce}from"../chunks/CodeBlock.844ff9c3.js";import{E as Ke}from"../chunks/ExampleCodeBlock.e3a326b9.js";function Nt(k){let a,b="Example:",o,n,_;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(),d(n.$$.fragment)},l(t){a=w(t,"P",{"data-svelte-h":!0}),y(a)!=="svelte-11lpom8"&&(a.textContent=b),o=c(t),m(n.$$.fragment,t)},m(t,v){i(t,a,v),i(t,o,v),f(n,t,v),_=!0},p:Q,i(t){_||(u(n.$$.fragment,t),_=!0)},o(t){g(n.$$.fragment,t),_=!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,_="<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=_},l(t){a=w(t,"P",{"data-svelte-h":!0}),y(a)!=="svelte-wnn996"&&(a.innerHTML=b),o=c(t),n=w(t,"P",{"data-svelte-h":!0}),y(n)!=="svelte-nj3kvq"&&(n.innerHTML=_)},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,_;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(),d(n.$$.fragment)},l(t){a=w(t,"P",{"data-svelte-h":!0}),y(a)!=="svelte-11lpom8"&&(a.textContent=b),o=c(t),m(n.$$.fragment,t)},m(t,v){i(t,a,v),i(t,o,v),f(n,t,v),_=!0},p:Q,i(t){_||(u(n.$$.fragment,t),_=!0)},o(t){g(n.$$.fragment,t),_=!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}),y(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,_;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(),d(n.$$.fragment)},l(t){a=w(t,"P",{"data-svelte-h":!0}),y(a)!=="svelte-11lpom8"&&(a.textContent=b),o=c(t),m(n.$$.fragment,t)},m(t,v){i(t,a,v),i(t,o,v),f(n,t,v),_=!0},p:Q,i(t){_||(u(n.$$.fragment,t),_=!0)},o(t){g(n.$$.fragment,t),_=!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}),y(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,_;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(),d(n.$$.fragment)},l(t){a=w(t,"P",{"data-svelte-h":!0}),y(a)!=="svelte-11lpom8"&&(a.textContent=b),o=c(t),m(n.$$.fragment,t)},m(t,v){i(t,a,v),i(t,o,v),f(n,t,v),_=!0},p:Q,i(t){_||(u(n.$$.fragment,t),_=!0)},o(t){g(n.$$.fragment,t),_=!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(){d(a.$$.fragment)},l(o){m(a.$$.fragment,o)},m(o,n){f(a,o,n),b=!0},p:Q,i(o){b||(u(a.$$.fragment,o),b=!0)},o(o){g(a.$$.fragment,o),b=!1},d(o){h(a,o)}}}function Zt(k){let a,b,o,n,_,t,v,Ge,O,$t=`The following objects can be passed to the main <a href="/docs/accelerate/pr_4021/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/pr_4021/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/pr_4021/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,_e,_t=`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/pr_4021/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,ye,yt="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/pr_4021/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,de,pt,xe,xt=`Use this object in your <a href="/docs/accelerate/pr_4021/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.`,dt,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.",mt,I,He,me,We,C,fe,ft,Pe,Pt="Internal mixin that implements a <code>to_kwargs()</code> method for a dataclass.",ut,S,ue,gt,Te,Tt="Returns a dictionary containing the attributes with values different from the default of this class.",Ae,ge,Be,je,Ie;return _=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/vr_4021/src/accelerate/utils/dataclasses.py#L113"}}),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/vr_4021/src/accelerate/utils/dataclasses.py#L155"}}),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/vr_4021/src/accelerate/utils/dataclasses.py#L455"}}),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/vr_4021/src/accelerate/utils/dataclasses.py#L484"}}),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/vr_4021/src/accelerate/utils/dataclasses.py#L574",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/vr_4021/src/accelerate/utils/dataclasses.py#L241"}}),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"}}),de=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/vr_4021/src/accelerate/utils/dataclasses.py#L273"}}),I=new Ke({props:{anchor:"accelerate.InitProcessGroupKwargs.example",$$slots:{default:[Vt]},$$scope:{ctx:k}}}),me=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/vr_4021/src/accelerate/utils/dataclasses.py#L68"}}),ue=new L({props:{name:"to_kwargs",anchor:"accelerate.utils.KwargsHandler.to_kwargs",parameters:[],source:"https://github.com/huggingface/accelerate/blob/vr_4021/src/accelerate/utils/dataclasses.py#L76"}}),ge=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(),d(_.$$.fragment),t=s(),d(v.$$.fragment),Ge=s(),O=$("p"),O.innerHTML=$t,Je=s(),d(q.$$.fragment),Ue=s(),K=$("div"),d(ee.$$.fragment),ze=s(),we=$("p"),we.innerHTML=wt,Qe=s(),d(D.$$.fragment),Ye=s(),d(te.$$.fragment),Ne=s(),M=$("div"),d(ae.$$.fragment),Oe=s(),be=$("p"),be.innerHTML=bt,qe=s(),d(E.$$.fragment),et=s(),d(V.$$.fragment),Fe=s(),d(re.$$.fragment),Re=s(),F=$("div"),d(le.$$.fragment),tt=s(),_e=$("p"),_e.innerHTML=_t,Xe=s(),d(oe.$$.fragment),Le=s(),x=$("div"),d(ne.$$.fragment),at=s(),ve=$("p"),ve.innerHTML=vt,rt=s(),d(Z.$$.fragment),lt=s(),d(H.$$.fragment),ot=s(),W=$("div"),d(se.$$.fragment),nt=s(),ye=$("p"),ye.textContent=yt,De=s(),d(ce.$$.fragment),Ee=s(),P=$("div"),d(ie.$$.fragment),st=s(),ke=$("p"),ke.innerHTML=kt,ct=s(),d(A.$$.fragment),it=s(),d(B.$$.fragment),Ve=s(),d(pe.$$.fragment),Ze=s(),T=$("div"),d(de.$$.fragment),pt=s(),xe=$("p"),xe.innerHTML=xt,dt=s(),Me=$("p"),Me.innerHTML=Mt,mt=s(),d(I.$$.fragment),He=s(),d(me.$$.fragment),We=s(),C=$("div"),d(fe.$$.fragment),ft=s(),Pe=$("p"),Pe.innerHTML=Pt,ut=s(),S=$("div"),d(ue.$$.fragment),gt=s(),Te=$("p"),Te.textContent=Tt,Ae=s(),d(ge.$$.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),m(_.$$.fragment,e),t=c(e),m(v.$$.fragment,e),Ge=c(e),O=w(e,"P",{"data-svelte-h":!0}),y(O)!=="svelte-f4e6al"&&(O.innerHTML=$t),Je=c(e),m(q.$$.fragment,e),Ue=c(e),K=w(e,"DIV",{class:!0});var R=Y(K);m(ee.$$.fragment,R),ze=c(R),we=w(R,"P",{"data-svelte-h":!0}),y(we)!=="svelte-13jeeii"&&(we.innerHTML=wt),Qe=c(R),m(D.$$.fragment,R),R.forEach(l),Ye=c(e),m(te.$$.fragment,e),Ne=c(e),M=w(e,"DIV",{class:!0});var G=Y(M);m(ae.$$.fragment,G),Oe=c(G),be=w(G,"P",{"data-svelte-h":!0}),y(be)!=="svelte-1fwzq7t"&&(be.innerHTML=bt),qe=c(G),m(E.$$.fragment,G),et=c(G),m(V.$$.fragment,G),G.forEach(l),Fe=c(e),m(re.$$.fragment,e),Re=c(e),F=w(e,"DIV",{class:!0});var he=Y(F);m(le.$$.fragment,he),tt=c(he),_e=w(he,"P",{"data-svelte-h":!0}),y(_e)!=="svelte-1b6vct0"&&(_e.innerHTML=_t),he.forEach(l),Xe=c(e),m(oe.$$.fragment,e),Le=c(e),x=w(e,"DIV",{class:!0});var j=Y(x);m(ne.$$.fragment,j),at=c(j),ve=w(j,"P",{"data-svelte-h":!0}),y(ve)!=="svelte-17fpo48"&&(ve.innerHTML=vt),rt=c(j),m(Z.$$.fragment,j),lt=c(j),m(H.$$.fragment,j),ot=c(j),W=w(j,"DIV",{class:!0});var $e=Y(W);m(se.$$.fragment,$e),nt=c($e),ye=w($e,"P",{"data-svelte-h":!0}),y(ye)!=="svelte-y3n9ph"&&(ye.textContent=yt),$e.forEach(l),j.forEach(l),De=c(e),m(ce.$$.fragment,e),Ee=c(e),P=w(e,"DIV",{class:!0});var J=Y(P);m(ie.$$.fragment,J),st=c(J),ke=w(J,"P",{"data-svelte-h":!0}),y(ke)!=="svelte-sevi9h"&&(ke.innerHTML=kt),ct=c(J),m(A.$$.fragment,J),it=c(J),m(B.$$.fragment,J),J.forEach(l),Ve=c(e),m(pe.$$.fragment,e),Ze=c(e),T=w(e,"DIV",{class:!0});var U=Y(T);m(de.$$.fragment,U),pt=c(U),xe=w(U,"P",{"data-svelte-h":!0}),y(xe)!=="svelte-11lfsll"&&(xe.innerHTML=xt),dt=c(U),Me=w(U,"P",{"data-svelte-h":!0}),y(Me)!=="svelte-l1d7ay"&&(Me.innerHTML=Mt),mt=c(U),m(I.$$.fragment,U),U.forEach(l),He=c(e),m(me.$$.fragment,e),We=c(e),C=w(e,"DIV",{class:!0});var X=Y(C);m(fe.$$.fragment,X),ft=c(X),Pe=w(X,"P",{"data-svelte-h":!0}),y(Pe)!=="svelte-1g1ngcq"&&(Pe.innerHTML=Pt),ut=c(X),S=w(X,"DIV",{class:!0});var Se=Y(S);m(ue.$$.fragment,Se),gt=c(Se),Te=w(Se,"P",{"data-svelte-h":!0}),y(Te)!=="svelte-1iftwh6"&&(Te.textContent=Tt),Se.forEach(l),X.forEach(l),Ae=c(e),m(ge.$$.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(_,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,_e),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,ye),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(de,T,null),p(T,pt),p(T,xe),p(T,dt),p(T,Me),p(T,mt),f(I,T,null),i(e,He,r),f(me,e,r),i(e,We,r),i(e,C,r),f(fe,C,null),p(C,ft),p(C,Pe),p(C,ut),p(C,S),f(ue,S,null),p(S,gt),p(S,Te),i(e,Ae,r),f(ge,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||(u(_.$$.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(de.$$.fragment,e),u(I.$$.fragment,e),u(me.$$.fragment,e),u(fe.$$.fragment,e),u(ue.$$.fragment,e),u(ge.$$.fragment,e),Ie=!0)},o(e){g(_.$$.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(de.$$.fragment,e),g(I.$$.fragment,e),g(me.$$.fragment,e),g(fe.$$.fragment,e),g(ue.$$.fragment,e),g(ge.$$.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(_,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(de),h(I),h(me,e),h(fe),h(ue),h(ge,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};

Xet Storage Details

Size:
27.9 kB
·
Xet hash:
9c5871e205e6c995a309020b4025e3ba71927fb91ea0614a38fcac8ea793d33a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.