import{S as ac,i as rc,s as sc,e as r,k as i,w as y,t as l,M as nc,c as s,d as t,m as c,a as n,x as $,h as o,b as u,G as e,g as b,y as E,q as j,o as T,B as M,v as lc,L as Ba}from"../../chunks/vendor-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Wa}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as vt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ha}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function oc(C){let g,k,w,f,D;return f=new Wa({props:{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsKQ==",highlighted:"debug_overflow = DebugUnderflowOverflow(model)"}}),{c(){g=r("p"),k=l("To activate the underflow/overflow detection, initialize the object with the model :"),w=i(),y(f.$$.fragment)},l(p){g=s(p,"P",{});var _=n(g);k=o(_,"To activate the underflow/overflow detection, initialize the object with the model :"),_.forEach(t),w=c(p),$(f.$$.fragment,p)},m(p,_){b(p,g,_),e(g,k),b(p,w,_),E(f,p,_),D=!0},p:Ba,i(p){D||(j(f.$$.fragment,p),D=!0)},o(p){T(f.$$.fragment,p),D=!1},d(p){p&&t(g),p&&t(w),M(f,p)}}}function ic(C){let g,k,w,f,D;return f=new Wa({props:{code:"RGV0ZWN0ZWQlMjBpbmYlMkZuYW4lMjBkdXJpbmclMjBiYXRjaF9udW1iZXIlM0QwJTBBTGFzdCUyMDIxJTIwZm9yd2FyZCUyMGZyYW1lcyUzQSUwQWFicyUyMG1pbiUyMCUyMGFicyUyMG1heCUyMCUyMG1ldGFkYXRhJTBBJTVCLi4uJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZW5jb2Rlci5ibG9jay4yLmxheWVyLjEuRGVuc2VSZWx1RGVuc2Uud2lfMCUyMExpbmVhciUwQTIuMTdlLTA3JTIwNC41MGUlMkIwMCUyMHdlaWdodCUwQTEuNzllLTA2JTIwNC42NWUlMkIwMCUyMGlucHV0JTVCMCU1RCUwQTIuNjhlLTA2JTIwMy43MGUlMkIwMSUyMG91dHB1dCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGVuY29kZXIuYmxvY2suMi5sYXllci4xLkRlbnNlUmVsdURlbnNlLndpXzElMjBMaW5lYXIlMEE4LjA4ZS0wNyUyMDIuNjZlJTJCMDElMjB3ZWlnaHQlMEExLjc5ZS0wNiUyMDQuNjVlJTJCMDAlMjBpbnB1dCU1QjAlNUQlMEExLjI3ZS0wNCUyMDIuMzdlJTJCMDIlMjBvdXRwdXQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbmNvZGVyLmJsb2NrLjIubGF5ZXIuMS5EZW5zZVJlbHVEZW5zZS53byUyMExpbmVhciUwQTEuMDFlLTA2JTIwNi40NGUlMkIwMCUyMHdlaWdodCUwQTAuMDBlJTJCMDAlMjA5Ljc0ZSUyQjAzJTIwaW5wdXQlNUIwJTVEJTBBMy4xOGUtMDQlMjA2LjI3ZSUyQjA0JTIwb3V0cHV0JTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZW5jb2Rlci5ibG9jay4yLmxheWVyLjEuRGVuc2VSZWx1RGVuc2UlMjBUNURlbnNlR2F0ZWRHZWx1RGVuc2UlMEExLjc5ZS0wNiUyMDQuNjVlJTJCMDAlMjBpbnB1dCU1QjAlNUQlMEEzLjE4ZS0wNCUyMDYuMjdlJTJCMDQlMjBvdXRwdXQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbmNvZGVyLmJsb2NrLjIubGF5ZXIuMS5kcm9wb3V0JTIwRHJvcG91dCUwQTMuMThlLTA0JTIwNi4yN2UlMkIwNCUyMGlucHV0JTVCMCU1RCUwQTAuMDBlJTJCMDAlMjAlMjAlMjAlMjAlMjAlMjBpbmYlMjBvdXRwdXQ=",highlighted:`<span class="hljs-attribute">Detected</span> inf/nan during batch_number=<span class="hljs-number">0</span>
<span class="hljs-attribute">Last</span> <span class="hljs-number">21</span> forward frames:
<span class="hljs-attribute">abs</span> min  abs max  metadata<span class="hljs-meta">
[...]</span>
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wi_0 Linear
<span class="hljs-attribute">2</span>.<span class="hljs-number">17</span>e-<span class="hljs-number">07</span> <span class="hljs-number">4</span>.<span class="hljs-number">50</span>e+<span class="hljs-number">00</span> weight
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">2</span>.<span class="hljs-number">68</span>e-<span class="hljs-number">06</span> <span class="hljs-number">3</span>.<span class="hljs-number">70</span>e+<span class="hljs-number">01</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wi_1 Linear
<span class="hljs-attribute">8</span>.<span class="hljs-number">08</span>e-<span class="hljs-number">07</span> <span class="hljs-number">2</span>.<span class="hljs-number">66</span>e+<span class="hljs-number">01</span> weight
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">1</span>.<span class="hljs-number">27</span>e-<span class="hljs-number">04</span> <span class="hljs-number">2</span>.<span class="hljs-number">37</span>e+<span class="hljs-number">02</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense.wo Linear
<span class="hljs-attribute">1</span>.<span class="hljs-number">01</span>e-<span class="hljs-number">06</span> <span class="hljs-number">6</span>.<span class="hljs-number">44</span>e+<span class="hljs-number">00</span> weight
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span> <span class="hljs-number">9</span>.<span class="hljs-number">74</span>e+<span class="hljs-number">03</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.DenseReluDense T5DenseGatedGeluDense
<span class="hljs-attribute">1</span>.<span class="hljs-number">79</span>e-<span class="hljs-number">06</span> <span class="hljs-number">4</span>.<span class="hljs-number">65</span>e+<span class="hljs-number">00</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> output
                  <span class="hljs-attribute">encoder</span>.block.<span class="hljs-number">2</span>.layer.<span class="hljs-number">1</span>.dropout Dropout
<span class="hljs-attribute">3</span>.<span class="hljs-number">18</span>e-<span class="hljs-number">04</span> <span class="hljs-number">6</span>.<span class="hljs-number">27</span>e+<span class="hljs-number">04</span> input[<span class="hljs-number">0</span>]
<span class="hljs-attribute">0</span>.<span class="hljs-number">00</span>e+<span class="hljs-number">00</span>      inf output`}}),{c(){g=r("p"),k=l("mixed precision :"),w=i(),y(f.$$.fragment)},l(p){g=s(p,"P",{});var _=n(g);k=o(_,"mixed precision :"),_.forEach(t),w=c(p),$(f.$$.fragment,p)},m(p,_){b(p,g,_),e(g,k),b(p,w,_),E(f,p,_),D=!0},p:Ba,i(p){D||(j(f.$$.fragment,p),D=!0)},o(p){T(f.$$.fragment,p),D=!1},d(p){p&&t(g),p&&t(w),M(f,p)}}}function cc(C){let g,k,w,f,D;return f=new Wa({props:{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsJTJDJTIwbWF4X2ZyYW1lc190b19zYXZlJTNEMTAwKQ==",highlighted:'debug_overflow = DebugUnderflowOverflow(model, max_frames_to_save=<span class="hljs-number">100</span>)'}}),{c(){g=r("p"),k=l("By default the last 21 frames are printed. You can change the default to adjust for your needs. For example :"),w=i(),y(f.$$.fragment)},l(p){g=s(p,"P",{});var _=n(g);k=o(_,"By default the last 21 frames are printed. You can change the default to adjust for your needs. For example :"),_.forEach(t),w=c(p),$(f.$$.fragment,p)},m(p,_){b(p,g,_),e(g,k),b(p,w,_),E(f,p,_),D=!0},p:Ba,i(p){D||(j(f.$$.fragment,p),D=!0)},o(p){T(f.$$.fragment,p),D=!1},d(p){p&&t(g),p&&t(w),M(f,p)}}}function pc(C){let g,k,w,f,D;return f=new Wa({props:{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsJTJDJTIwdHJhY2VfYmF0Y2hfbnVtcyUzRCU1QjElMkMlMjAzJTVEKQ==",highlighted:'debug_overflow = DebugUnderflowOverflow(model, trace_batch_nums=[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>])'}}),{c(){g=r("p"),k=l("given batch, and only do that for batches 1 and 3. Then you instantiate this class as :"),w=i(),y(f.$$.fragment)},l(p){g=s(p,"P",{});var _=n(g);k=o(_,"given batch, and only do that for batches 1 and 3. Then you instantiate this class as :"),_.forEach(t),w=c(p),$(f.$$.fragment,p)},m(p,_){b(p,g,_),e(g,k),b(p,w,_),E(f,p,_),D=!0},p:Ba,i(p){D||(j(f.$$.fragment,p),D=!0)},o(p){T(f.$$.fragment,p),D=!1},d(p){p&&t(g),p&&t(w),M(f,p)}}}function dc(C){let g,k,w,f,D;return f=new Wa({props:{code:"ZGVidWdfb3ZlcmZsb3clMjAlM0QlMjBEZWJ1Z1VuZGVyZmxvd092ZXJmbG93KG1vZGVsJTJDJTIwdHJhY2VfYmF0Y2hfbnVtcyUzRCU1QjElMkMlMjAzJTVEJTJDJTIwYWJvcnRfYWZ0ZXJfYmF0Y2hfbnVtJTNEMyk=",highlighted:'debug_overflow = DebugUnderflowOverflow(model, trace_batch_nums=[<span class="hljs-number">1</span>, <span class="hljs-number">3</span>], abort_after_batch_num=<span class="hljs-number">3</span>)'}}),{c(){g=r("p"),k=l("You can also specify the batch number after which to stop the training, with :"),w=i(),y(f.$$.fragment)},l(p){g=s(p,"P",{});var _=n(g);k=o(_,"You can also specify the batch number after which to stop the training, with :"),_.forEach(t),w=c(p),$(f.$$.fragment,p)},m(p,_){b(p,g,_),e(g,k),b(p,w,_),E(f,p,_),D=!0},p:Ba,i(p){D||(j(f.$$.fragment,p),D=!0)},o(p){T(f.$$.fragment,p),D=!1},d(p){p&&t(g),p&&t(w),M(f,p)}}}function hc(C){let g,k,w,f,D,p,_,wt,Gr,Qa,ee,Or,tt,Nr,zr,Fa,at,Sr,Ra,G,te,yt,be,Hr,$t,Br,Ya,O,_e,Wr,Et,Qr,Xa,N,ve,Fr,jt,Rr,Ka,J,we,Yr,Tt,Xr,Kr,ye,rt,$e,qr,es,ts,st,Ee,as,rs,qa,z,je,ss,I,ns,Mt,ls,os,Dt,is,cs,xt,ps,ds,kt,hs,fs,er,S,Te,ms,At,us,tr,H,ae,Pt,Me,gs,Ut,bs,ar,B,De,_s,It,vs,rr,W,re,Ct,xe,ws,Jt,ys,sr,v,ke,$s,Zt,Es,js,Lt,Ts,Ms,Vt,Gt,Ds,xs,Ot,ks,As,Q,nt,Ps,Nt,Us,Is,lt,Cs,zt,Js,Zs,ot,Ls,St,Vs,Gs,Ht,Os,Ns,F,it,zs,Bt,Ss,Hs,ct,Bs,Wt,Ws,Qs,pt,Fs,Qt,Rs,Ys,Ft,Xs,Ks,Rt,Yt,qs,en,Xt,tn,an,Kt,qt,rn,sn,ea,nn,ln,se,Ae,on,Pe,cn,ta,pn,dn,hn,ne,Ue,fn,aa,mn,nr,R,le,ra,Ie,un,sa,gn,lr,A,Ce,bn,Je,_n,na,vn,wn,yn,Ze,$n,la,En,jn,Tn,L,Le,Mn,oa,Dn,xn,Ve,kn,ia,An,Pn,Un,oe,Ge,In,Oe,Cn,ca,Jn,Zn,Ln,ie,Ne,Vn,ze,Gn,pa,On,Nn,zn,ce,Se,Sn,He,Hn,da,Bn,Wn,or,Y,pe,ha,Be,Qn,fa,Fn,ir,d,We,Rn,X,Yn,ma,Xn,Kn,ua,qn,el,tl,ga,al,rl,Qe,ba,sl,nl,_a,ll,ol,va,il,cl,de,pl,Z,dl,wa,hl,fl,ya,ml,ul,$a,gl,bl,_l,Fe,Re,vl,Ea,wl,yl,$l,ja,El,jl,Ye,Tl,Ta,Ml,Dl,xl,he,kl,K,Al,Ma,Pl,Ul,Da,Il,Cl,Jl,xa,Zl,Ll,Xe,Vl,ka,Gl,Ol,Nl,fe,zl,Aa,Sl,Hl,Pa,Bl,Wl,Ua,Ql,Fl,Ke,Rl,Ia,Yl,Xl,Kl,me,ql,Ca,eo,to,Ja,ao,ro,Za,so,no,ue,lo,La,oo,io,dt,Va,co,po,ho,q,fo,Ga,mo,uo,Oa,go,bo,cr;return p=new vt({}),be=new vt({}),_e=new P({props:{name:"class transformers.EvalPrediction",anchor:"transformers.EvalPrediction",parameters:[{name:"predictions",val:": typing.Union[numpy.ndarray, typing.Tuple[numpy.ndarray]]"},{name:"label_ids",val:": typing.Union[numpy.ndarray, typing.Tuple[numpy.ndarray]]"},{name:"inputs",val:": typing.Union[numpy.ndarray, typing.Tuple[numpy.ndarray], NoneType] = None"}],parametersDescription:[{anchor:"transformers.EvalPrediction.predictions",description:"<strong>predictions</strong> (<code>np.ndarray</code>) &#x2014; Predictions of the model.",name:"predictions"},{anchor:"transformers.EvalPrediction.label_ids",description:"<strong>label_ids</strong> (<code>np.ndarray</code>) &#x2014; Targets to be matched.",name:"label_ids"},{anchor:"transformers.EvalPrediction.inputs",description:"<strong>inputs</strong> (<code>np.ndarray</code>, <em>optional</em>) &#x2014;",name:"inputs"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_utils.py#L100"}}),ve=new P({props:{name:"class transformers.IntervalStrategy",anchor:"transformers.IntervalStrategy",parameters:[{name:"value",val:""},{name:"names",val:" = None"},{name:"module",val:" = None"},{name:"qualname",val:" = None"},{name:"type",val:" = None"},{name:"start",val:" = 1"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_utils.py#L174"}}),we=new P({props:{name:"transformers.enable_full_determinism",anchor:"transformers.enable_full_determinism",parameters:[{name:"seed",val:": int"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_utils.py#L58"}}),je=new P({props:{name:"transformers.set_seed",anchor:"transformers.set_seed",parameters:[{name:"seed",val:": int"}],parametersDescription:[{anchor:"transformers.set_seed.seed",description:"<strong>seed</strong> (<code>int</code>) &#x2014; The seed to set.",name:"seed"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_utils.py#L83"}}),Te=new P({props:{name:"transformers.torch_distributed_zero_first",anchor:"transformers.torch_distributed_zero_first",parameters:[{name:"local_rank",val:": int"}],parametersDescription:[{anchor:"transformers.torch_distributed_zero_first.local_rank",description:"<strong>local_rank</strong> (<code>int</code>) &#x2014; The rank of the local process.",name:"local_rank"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_pt_utils.py#L235"}}),Me=new vt({}),De=new P({props:{name:"class transformers.trainer_callback.CallbackHandler",anchor:"transformers.trainer_callback.CallbackHandler",parameters:[{name:"callbacks",val:""},{name:"model",val:""},{name:"tokenizer",val:""},{name:"optimizer",val:""},{name:"lr_scheduler",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_callback.py#L290"}}),xe=new vt({}),ke=new P({props:{name:"class transformers.trainer_pt_utils.DistributedTensorGatherer",anchor:"transformers.trainer_pt_utils.DistributedTensorGatherer",parameters:[{name:"world_size",val:""},{name:"num_samples",val:""},{name:"make_multiple_of",val:" = None"},{name:"padding_index",val:" = -100"}],parametersDescription:[{anchor:"transformers.trainer_pt_utils.DistributedTensorGatherer.world_size",description:`<strong>world_size</strong> (<code>int</code>) &#x2014;
The number of processes used in the distributed training.`,name:"world_size"},{anchor:"transformers.trainer_pt_utils.DistributedTensorGatherer.num_samples",description:`<strong>num_samples</strong> (<code>int</code>) &#x2014;
The number of samples in our dataset.`,name:"num_samples"},{anchor:"transformers.trainer_pt_utils.DistributedTensorGatherer.make_multiple_of",description:`<strong>make_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If passed, the class assumes the datasets passed to each process are made to be a multiple of this argument
(by adding samples).`,name:"make_multiple_of"},{anchor:"transformers.trainer_pt_utils.DistributedTensorGatherer.padding_index",description:`<strong>padding_index</strong> (<code>int</code>, <em>optional</em>, defaults to -100) &#x2014;
The padding index to use if the arrays don&#x2019;t all have the same sequence length.`,name:"padding_index"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_pt_utils.py#L364"}}),Ae=new P({props:{name:"add_arrays",anchor:"transformers.trainer_pt_utils.DistributedTensorGatherer.add_arrays",parameters:[{name:"arrays",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_pt_utils.py#L424"}}),Ue=new P({props:{name:"finalize",anchor:"transformers.trainer_pt_utils.DistributedTensorGatherer.finalize",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/trainer_pt_utils.py#L460"}}),Ie=new vt({}),Ce=new P({props:{name:"class transformers.HfArgumentParser",anchor:"transformers.HfArgumentParser",parameters:[{name:"dataclass_types",val:": typing.Union[DataClassType, typing.Iterable[DataClassType]]"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/hf_argparser.py#L117"}}),Le=new P({props:{name:"parse_args_into_dataclasses",anchor:"transformers.HfArgumentParser.parse_args_into_dataclasses",parameters:[{name:"args",val:" = None"},{name:"return_remaining_strings",val:" = False"},{name:"look_for_args_file",val:" = True"},{name:"args_filename",val:" = None"},{name:"args_file_flag",val:" = None"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/hf_argparser.py#L273",returnDescription:`
<ul>
<li>the dataclass instances in the same order as they were passed to the initializer.abspath</li>
<li>if applicable, an additional namespace for more (non-dataclass backed) arguments added to the parser
after initialization.</li>
<li>The potential list of remaining argument strings. (same as argparse.ArgumentParser.parse_known_args)</li>
</ul>
`,returnType:`
<p>Tuple consisting of</p>
`}}),Ge=new P({props:{name:"parse_dict",anchor:"transformers.HfArgumentParser.parse_dict",parameters:[{name:"args",val:": typing.Dict[str, typing.Any]"},{name:"allow_extra_keys",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HfArgumentParser.parse_dict.args",description:`<strong>args</strong> (<code>dict</code>) &#x2014;
dict containing config values`,name:"args"},{anchor:"transformers.HfArgumentParser.parse_dict.allow_extra_keys",description:`<strong>allow_extra_keys</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Defaults to False. If False, will raise an exception if the dict contains keys that are not parsed.`,name:"allow_extra_keys"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/hf_argparser.py#L359",returnDescription:`
<ul>
<li>the dataclass instances in the same order as they were passed to the initializer.</li>
</ul>
`,returnType:`
<p>Tuple consisting of</p>
`}}),Ne=new P({props:{name:"parse_json_file",anchor:"transformers.HfArgumentParser.parse_json_file",parameters:[{name:"json_file",val:": str"},{name:"allow_extra_keys",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HfArgumentParser.parse_json_file.json_file",description:`<strong>json_file</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
File name of the json file to parse`,name:"json_file"},{anchor:"transformers.HfArgumentParser.parse_json_file.allow_extra_keys",description:`<strong>allow_extra_keys</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Defaults to False. If False, will raise an exception if the json file contains keys that are not
parsed.`,name:"allow_extra_keys"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/hf_argparser.py#L387",returnDescription:`
<ul>
<li>the dataclass instances in the same order as they were passed to the initializer.</li>
</ul>
`,returnType:`
<p>Tuple consisting of</p>
`}}),Se=new P({props:{name:"parse_yaml_file",anchor:"transformers.HfArgumentParser.parse_yaml_file",parameters:[{name:"yaml_file",val:": str"},{name:"allow_extra_keys",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HfArgumentParser.parse_yaml_file.yaml_file",description:`<strong>yaml_file</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
File name of the yaml file to parse`,name:"yaml_file"},{anchor:"transformers.HfArgumentParser.parse_yaml_file.allow_extra_keys",description:`<strong>allow_extra_keys</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Defaults to False. If False, will raise an exception if the json file contains keys that are not
parsed.`,name:"allow_extra_keys"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/hf_argparser.py#L409",returnDescription:`
<ul>
<li>the dataclass instances in the same order as they were passed to the initializer.</li>
</ul>
`,returnType:`
<p>Tuple consisting of</p>
`}}),Be=new vt({}),We=new P({props:{name:"class transformers.debug_utils.DebugUnderflowOverflow",anchor:"transformers.debug_utils.DebugUnderflowOverflow",parameters:[{name:"model",val:""},{name:"max_frames_to_save",val:" = 21"},{name:"trace_batch_nums",val:" = []"},{name:"abort_after_batch_num",val:" = None"}],parametersDescription:[{anchor:"transformers.debug_utils.DebugUnderflowOverflow.model",description:`<strong>model</strong> (<code>nn.Module</code>) &#x2014;
The model to debug.`,name:"model"},{anchor:"transformers.debug_utils.DebugUnderflowOverflow.max_frames_to_save",description:`<strong>max_frames_to_save</strong> (<code>int</code>, <em>optional</em>, defaults to 21) &#x2014;
How many frames back to record`,name:"max_frames_to_save"},{anchor:"transformers.debug_utils.DebugUnderflowOverflow.trace_batch_nums(List[int],",description:`<strong>trace_batch_nums(<code>List[int]</code>,</strong> <em>optional</em>, defaults to <code>[]</code>) &#x2014;
Which batch numbers to trace (turns detection off)`,name:"trace_batch_nums(List[int],"},{anchor:"transformers.debug_utils.DebugUnderflowOverflow.abort_after_batch_num",description:"<strong>abort_after_batch_num</strong>  (`int&#x201C;, <em>optional</em>) &#x2014;\nWhether to abort after a certain batch number has finished",name:"abort_after_batch_num"}],source:"https://github.com/huggingface/transformers/blob/v4.30.0/src/transformers/debug_utils.py#L27"}}),de=new Ha({props:{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example",$$slots:{default:[oc]},$$scope:{ctx:C}}}),he=new Ha({props:{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example-2",$$slots:{default:[ic]},$$scope:{ctx:C}}}),fe=new Ha({props:{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example-3",$$slots:{default:[cc]},$$scope:{ctx:C}}}),me=new Ha({props:{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example-4",$$slots:{default:[pc]},$$scope:{ctx:C}}}),ue=new Ha({props:{anchor:"transformers.debug_utils.DebugUnderflowOverflow.example-5",$$slots:{default:[dc]},$$scope:{ctx:C}}}),{c(){g=r("meta"),k=i(),w=r("h1"),f=r("a"),D=r("span"),y(p.$$.fragment),_=i(),wt=r("span"),Gr=l("Utilities for Trainer"),Qa=i(),ee=r("p"),Or=l("This page lists all the utility functions used by "),tt=r("a"),Nr=l("Trainer"),zr=l("."),Fa=i(),at=r("p"),Sr=l("Most of those are only useful if you are studying the code of the Trainer in the library."),Ra=i(),G=r("h2"),te=r("a"),yt=r("span"),y(be.$$.fragment),Hr=i(),$t=r("span"),Br=l("Utilities"),Ya=i(),O=r("div"),y(_e.$$.fragment),Wr=i(),Et=r("p"),Qr=l("Evaluation output (always contains labels), to be used to compute metrics."),Xa=i(),N=r("div"),y(ve.$$.fragment),Fr=i(),jt=r("p"),Rr=l("An enumeration."),Ka=i(),J=r("div"),y(we.$$.fragment),Yr=i(),Tt=r("p"),Xr=l("Helper function for reproducible behavior during distributed training. See"),Kr=i(),ye=r("ul"),rt=r("li"),$e=r("a"),qr=l("https://pytorch.org/docs/stable/notes/randomness.html"),es=l(" for pytorch"),ts=i(),st=r("li"),Ee=r("a"),as=l("https://www.tensorflow.org/api_docs/python/tf/config/experimental/enable_op_determinism"),rs=l(" for tensorflow"),qa=i(),z=r("div"),y(je.$$.fragment),ss=i(),I=r("p"),ns=l("Helper function for reproducible behavior to set the seed in "),Mt=r("code"),ls=l("random"),os=l(", "),Dt=r("code"),is=l("numpy"),cs=l(", "),xt=r("code"),ps=l("torch"),ds=l(" and/or "),kt=r("code"),hs=l("tf"),fs=l(" (if installed)."),er=i(),S=r("div"),y(Te.$$.fragment),ms=i(),At=r("p"),us=l("Decorator to make all processes in distributed training wait for each local_master to do something."),tr=i(),H=r("h2"),ae=r("a"),Pt=r("span"),y(Me.$$.fragment),gs=i(),Ut=r("span"),bs=l("Callbacks internals"),ar=i(),B=r("div"),y(De.$$.fragment),_s=i(),It=r("p"),vs=l("Internal class that just calls the list of callbacks in order."),rr=i(),W=r("h2"),re=r("a"),Ct=r("span"),y(xe.$$.fragment),ws=i(),Jt=r("span"),ys=l("Distributed Evaluation"),sr=i(),v=r("div"),y(ke.$$.fragment),$s=i(),Zt=r("p"),Es=l("A class responsible for properly gathering tensors (or nested list/tuple of tensors) on the CPU by chunks."),js=i(),Lt=r("p"),Ts=l(`If our dataset has 16 samples with a batch size of 2 on 3 processes and we gather then transfer on CPU at every
step, our sampler will generate the following indices:`),Ms=i(),Vt=r("p"),Gt=r("code"),Ds=l("[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1]"),xs=i(),Ot=r("p"),ks=l(`to get something of size a multiple of 3 (so that each process gets the same dataset length). Then process 0, 1 and
2 will be responsible of making predictions for the following samples:`),As=i(),Q=r("ul"),nt=r("li"),Ps=l("P0: "),Nt=r("code"),Us=l("[0, 1, 2, 3, 4, 5]"),Is=i(),lt=r("li"),Cs=l("P1: "),zt=r("code"),Js=l("[6, 7, 8, 9, 10, 11]"),Zs=i(),ot=r("li"),Ls=l("P2: "),St=r("code"),Vs=l("[12, 13, 14, 15, 0, 1]"),Gs=i(),Ht=r("p"),Os=l("The first batch treated on each process will be"),Ns=i(),F=r("ul"),it=r("li"),zs=l("P0: "),Bt=r("code"),Ss=l("[0, 1]"),Hs=i(),ct=r("li"),Bs=l("P1: "),Wt=r("code"),Ws=l("[6, 7]"),Qs=i(),pt=r("li"),Fs=l("P2: "),Qt=r("code"),Rs=l("[12, 13]"),Ys=i(),Ft=r("p"),Xs=l(`So if we gather at the end of the first batch, we will get a tensor (nested list/tuple of tensor) corresponding to
the following indices:`),Ks=i(),Rt=r("p"),Yt=r("code"),qs=l("[0, 1, 6, 7, 12, 13]"),en=i(),Xt=r("p"),tn=l(`If we directly concatenate our results without taking any precautions, the user will then get the predictions for
the indices in this order at the end of the prediction loop:`),an=i(),Kt=r("p"),qt=r("code"),rn=l("[0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11, 0, 1]"),sn=i(),ea=r("p"),nn=l("For some reason, that\u2019s not going to roll their boat. This class is there to solve that problem."),ln=i(),se=r("div"),y(Ae.$$.fragment),on=i(),Pe=r("p"),cn=l("Add "),ta=r("code"),pn=l("arrays"),dn=l(` to the internal storage, Will initialize the storage to the full size at the first arrays passed
so that if we\u2019re bound to get an OOM, it happens at the beginning.`),hn=i(),ne=r("div"),y(Ue.$$.fragment),fn=i(),aa=r("p"),mn=l(`Return the properly gathered arrays and truncate to the number of samples (since the sampler added some extras
to get each process a dataset of the same length).`),nr=i(),R=r("h2"),le=r("a"),ra=r("span"),y(Ie.$$.fragment),un=i(),sa=r("span"),gn=l("Distributed Evaluation"),lr=i(),A=r("div"),y(Ce.$$.fragment),bn=i(),Je=r("p"),_n=l("This subclass of "),na=r("code"),vn=l("argparse.ArgumentParser"),wn=l(" uses type hints on dataclasses to generate arguments."),yn=i(),Ze=r("p"),$n=l(`The class is designed to play well with the native argparse. In particular, you can add more (non-dataclass backed)
arguments to the parser after initialization and you\u2019ll get the output back after parsing as an additional
namespace. Optional: To create sub argument groups use the `),la=r("code"),En=l("_argument_group_name"),jn=l(" attribute in the dataclass."),Tn=i(),L=r("div"),y(Le.$$.fragment),Mn=i(),oa=r("p"),Dn=l("Parse command-line args into instances of the specified dataclass types."),xn=i(),Ve=r("p"),kn=l("This relies on argparse\u2019s "),ia=r("code"),An=l("ArgumentParser.parse_known_args"),Pn=l(`. See the doc at:
docs.python.org/3.7/library/argparse.html#argparse.ArgumentParser.parse_args`),Un=i(),oe=r("div"),y(Ge.$$.fragment),In=i(),Oe=r("p"),Cn=l("Alternative helper method that does not use "),ca=r("code"),Jn=l("argparse"),Zn=l(` at all, instead uses a dict and populating the dataclass
types.`),Ln=i(),ie=r("div"),y(Ne.$$.fragment),Vn=i(),ze=r("p"),Gn=l("Alternative helper method that does not use "),pa=r("code"),On=l("argparse"),Nn=l(` at all, instead loading a json file and populating the
dataclass types.`),zn=i(),ce=r("div"),y(Se.$$.fragment),Sn=i(),He=r("p"),Hn=l("Alternative helper method that does not use "),da=r("code"),Bn=l("argparse"),Wn=l(` at all, instead loading a yaml file and populating the
dataclass types.`),or=i(),Y=r("h2"),pe=r("a"),ha=r("span"),y(Be.$$.fragment),Qn=i(),fa=r("span"),Fn=l("Debug Utilities"),ir=i(),d=r("div"),y(We.$$.fragment),Rn=i(),X=r("p"),Yn=l(`This debug class helps detect and understand where the model starts getting very large or very small, and more
importantly `),ma=r("code"),Xn=l("nan"),Kn=l(" or "),ua=r("code"),qn=l("inf"),el=l(" weight and activation elements."),tl=i(),ga=r("p"),al=l("There are 2 working modes:"),rl=i(),Qe=r("ol"),ba=r("li"),sl=l("Underflow/overflow detection (default)"),nl=i(),_a=r("li"),ll=l("Specific batch absolute min/max tracing without detection"),ol=i(),va=r("p"),il=l("Mode 1: Underflow/overflow detection"),cl=i(),y(de.$$.fragment),pl=i(),Z=r("p"),dl=l("then run the training as normal and if "),wa=r("code"),hl=l("nan"),fl=l(" or "),ya=r("code"),ml=l("inf"),ul=l(` gets detected in at least one of the weight, input or output
elements this module will throw an exception and will print `),$a=r("code"),gl=l("max_frames_to_save"),bl=l(` frames that lead to this event,
each frame reporting`),_l=i(),Fe=r("ol"),Re=r("li"),vl=l("the fully qualified module name plus the class name whose "),Ea=r("code"),wl=l("forward"),yl=l(" was run"),$l=i(),ja=r("li"),El=l("the absolute min and max value of all elements for each module weights, and the inputs and output"),jl=i(),Ye=r("p"),Tl=l("For example, here is the header and the last few frames in detection report for "),Ta=r("code"),Ml=l("google/mt5-small"),Dl=l(" run in fp16"),xl=i(),y(he.$$.fragment),kl=i(),K=r("p"),Al=l("You can see here, that "),Ma=r("code"),Pl=l("T5DenseGatedGeluDense.forward"),Ul=l(` resulted in output activations, whose absolute max value was
around 62.7K, which is very close to fp16\u2019s top limit of 64K. In the next frame we have `),Da=r("code"),Il=l("Dropout"),Cl=l(` which
renormalizes the weights, after it zeroed some of the elements, which pushes the absolute max value to more than
64K, and we get an overlow.`),Jl=i(),xa=r("p"),Zl=l(`As you can see it\u2019s the previous frames that we need to look into when the numbers start going into very large for
fp16 numbers.`),Ll=i(),Xe=r("p"),Vl=l("The tracking is done in a forward hook, which gets invoked immediately after "),ka=r("code"),Gl=l("forward"),Ol=l(" has completed."),Nl=i(),y(fe.$$.fragment),zl=i(),Aa=r("p"),Sl=l(`To validate that you have set up this debugging feature correctly, and you intend to use it in a training that
may take hours to complete, first run it with normal tracing enabled for one of a few batches as explained in
the next section.`),Hl=i(),Pa=r("p"),Bl=l("Mode 2. Specific batch absolute min/max tracing without detection"),Wl=i(),Ua=r("p"),Ql=l("The second work mode is per-batch tracing with the underflow/overflow detection feature turned off."),Fl=i(),Ke=r("p"),Rl=l("Let\u2019s say you want to watch the absolute min and max values for all the ingredients of each "),Ia=r("code"),Yl=l("forward"),Xl=l(" call of a"),Kl=i(),y(me.$$.fragment),ql=i(),Ca=r("p"),eo=l("And now full batches 1 and 3 will be traced using the same format as explained above. Batches are 0-indexed."),to=i(),Ja=r("p"),ao=l(`This is helpful if you know that the program starts misbehaving after a certain batch number, so you can
fast-forward right to that area.`),ro=i(),Za=r("p"),so=l("Early stopping:"),no=i(),y(ue.$$.fragment),lo=i(),La=r("p"),oo=l("This feature is mainly useful in the tracing mode, but you can use it for any mode."),io=i(),dt=r("p"),Va=r("strong"),co=l("Performance"),po=l(":"),ho=i(),q=r("p"),fo=l("As this module measures absolute "),Ga=r("code"),mo=l("min"),uo=l("/`"),Oa=r("code"),go=l("max"),bo=l(` of each weight of the model on every forward it\u2019ll slow the training
down. Therefore remember to turn it off once the debugging needs have been met.`),this.h()},l(a){const m=nc('[data-svelte="svelte-1phssyn"]',document.head);g=s(m,"META",{name:!0,content:!0}),m.forEach(t),k=c(a),w=s(a,"H1",{class:!0});var qe=n(w);f=s(qe,"A",{id:!0,class:!0,href:!0});var Na=n(f);D=s(Na,"SPAN",{});var za=n(D);$(p.$$.fragment,za),za.forEach(t),Na.forEach(t),_=c(qe),wt=s(qe,"SPAN",{});var Sa=n(wt);Gr=o(Sa,"Utilities for Trainer"),Sa.forEach(t),qe.forEach(t),Qa=c(a),ee=s(a,"P",{});var et=n(ee);Or=o(et,"This page lists all the utility functions used by "),tt=s(et,"A",{href:!0});var Do=n(tt);Nr=o(Do,"Trainer"),Do.forEach(t),zr=o(et,"."),et.forEach(t),Fa=c(a),at=s(a,"P",{});var xo=n(at);Sr=o(xo,"Most of those are only useful if you are studying the code of the Trainer in the library."),xo.forEach(t),Ra=c(a),G=s(a,"H2",{class:!0});var pr=n(G);te=s(pr,"A",{id:!0,class:!0,href:!0});var ko=n(te);yt=s(ko,"SPAN",{});var Ao=n(yt);$(be.$$.fragment,Ao),Ao.forEach(t),ko.forEach(t),Hr=c(pr),$t=s(pr,"SPAN",{});var Po=n($t);Br=o(Po,"Utilities"),Po.forEach(t),pr.forEach(t),Ya=c(a),O=s(a,"DIV",{class:!0});var dr=n(O);$(_e.$$.fragment,dr),Wr=c(dr),Et=s(dr,"P",{});var Uo=n(Et);Qr=o(Uo,"Evaluation output (always contains labels), to be used to compute metrics."),Uo.forEach(t),dr.forEach(t),Xa=c(a),N=s(a,"DIV",{class:!0});var hr=n(N);$(ve.$$.fragment,hr),Fr=c(hr),jt=s(hr,"P",{});var Io=n(jt);Rr=o(Io,"An enumeration."),Io.forEach(t),hr.forEach(t),Ka=c(a),J=s(a,"DIV",{class:!0});var ht=n(J);$(we.$$.fragment,ht),Yr=c(ht),Tt=s(ht,"P",{});var Co=n(Tt);Xr=o(Co,"Helper function for reproducible behavior during distributed training. See"),Co.forEach(t),Kr=c(ht),ye=s(ht,"UL",{});var fr=n(ye);rt=s(fr,"LI",{});var _o=n(rt);$e=s(_o,"A",{href:!0,rel:!0});var Jo=n($e);qr=o(Jo,"https://pytorch.org/docs/stable/notes/randomness.html"),Jo.forEach(t),es=o(_o," for pytorch"),_o.forEach(t),ts=c(fr),st=s(fr,"LI",{});var vo=n(st);Ee=s(vo,"A",{href:!0,rel:!0});var Zo=n(Ee);as=o(Zo,"https://www.tensorflow.org/api_docs/python/tf/config/experimental/enable_op_determinism"),Zo.forEach(t),rs=o(vo," for tensorflow"),vo.forEach(t),fr.forEach(t),ht.forEach(t),qa=c(a),z=s(a,"DIV",{class:!0});var mr=n(z);$(je.$$.fragment,mr),ss=c(mr),I=s(mr,"P",{});var V=n(I);ns=o(V,"Helper function for reproducible behavior to set the seed in "),Mt=s(V,"CODE",{});var Lo=n(Mt);ls=o(Lo,"random"),Lo.forEach(t),os=o(V,", "),Dt=s(V,"CODE",{});var Vo=n(Dt);is=o(Vo,"numpy"),Vo.forEach(t),cs=o(V,", "),xt=s(V,"CODE",{});var Go=n(xt);ps=o(Go,"torch"),Go.forEach(t),ds=o(V," and/or "),kt=s(V,"CODE",{});var Oo=n(kt);hs=o(Oo,"tf"),Oo.forEach(t),fs=o(V," (if installed)."),V.forEach(t),mr.forEach(t),er=c(a),S=s(a,"DIV",{class:!0});var ur=n(S);$(Te.$$.fragment,ur),ms=c(ur),At=s(ur,"P",{});var No=n(At);us=o(No,"Decorator to make all processes in distributed training wait for each local_master to do something."),No.forEach(t),ur.forEach(t),tr=c(a),H=s(a,"H2",{class:!0});var gr=n(H);ae=s(gr,"A",{id:!0,class:!0,href:!0});var zo=n(ae);Pt=s(zo,"SPAN",{});var So=n(Pt);$(Me.$$.fragment,So),So.forEach(t),zo.forEach(t),gs=c(gr),Ut=s(gr,"SPAN",{});var Ho=n(Ut);bs=o(Ho,"Callbacks internals"),Ho.forEach(t),gr.forEach(t),ar=c(a),B=s(a,"DIV",{class:!0});var br=n(B);$(De.$$.fragment,br),_s=c(br),It=s(br,"P",{});var Bo=n(It);vs=o(Bo,"Internal class that just calls the list of callbacks in order."),Bo.forEach(t),br.forEach(t),rr=c(a),W=s(a,"H2",{class:!0});var _r=n(W);re=s(_r,"A",{id:!0,class:!0,href:!0});var Wo=n(re);Ct=s(Wo,"SPAN",{});var Qo=n(Ct);$(xe.$$.fragment,Qo),Qo.forEach(t),Wo.forEach(t),ws=c(_r),Jt=s(_r,"SPAN",{});var Fo=n(Jt);ys=o(Fo,"Distributed Evaluation"),Fo.forEach(t),_r.forEach(t),sr=c(a),v=s(a,"DIV",{class:!0});var x=n(v);$(ke.$$.fragment,x),$s=c(x),Zt=s(x,"P",{});var Ro=n(Zt);Es=o(Ro,"A class responsible for properly gathering tensors (or nested list/tuple of tensors) on the CPU by chunks."),Ro.forEach(t),js=c(x),Lt=s(x,"P",{});var Yo=n(Lt);Ts=o(Yo,`If our dataset has 16 samples with a batch size of 2 on 3 processes and we gather then transfer on CPU at every
step, our sampler will generate the following indices:`),Yo.forEach(t),Ms=c(x),Vt=s(x,"P",{});var Xo=n(Vt);Gt=s(Xo,"CODE",{});var Ko=n(Gt);Ds=o(Ko,"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1]"),Ko.forEach(t),Xo.forEach(t),xs=c(x),Ot=s(x,"P",{});var qo=n(Ot);ks=o(qo,`to get something of size a multiple of 3 (so that each process gets the same dataset length). Then process 0, 1 and
2 will be responsible of making predictions for the following samples:`),qo.forEach(t),As=c(x),Q=s(x,"UL",{});var ft=n(Q);nt=s(ft,"LI",{});var wo=n(nt);Ps=o(wo,"P0: "),Nt=s(wo,"CODE",{});var ei=n(Nt);Us=o(ei,"[0, 1, 2, 3, 4, 5]"),ei.forEach(t),wo.forEach(t),Is=c(ft),lt=s(ft,"LI",{});var yo=n(lt);Cs=o(yo,"P1: "),zt=s(yo,"CODE",{});var ti=n(zt);Js=o(ti,"[6, 7, 8, 9, 10, 11]"),ti.forEach(t),yo.forEach(t),Zs=c(ft),ot=s(ft,"LI",{});var $o=n(ot);Ls=o($o,"P2: "),St=s($o,"CODE",{});var ai=n(St);Vs=o(ai,"[12, 13, 14, 15, 0, 1]"),ai.forEach(t),$o.forEach(t),ft.forEach(t),Gs=c(x),Ht=s(x,"P",{});var ri=n(Ht);Os=o(ri,"The first batch treated on each process will be"),ri.forEach(t),Ns=c(x),F=s(x,"UL",{});var mt=n(F);it=s(mt,"LI",{});var Eo=n(it);zs=o(Eo,"P0: "),Bt=s(Eo,"CODE",{});var si=n(Bt);Ss=o(si,"[0, 1]"),si.forEach(t),Eo.forEach(t),Hs=c(mt),ct=s(mt,"LI",{});var jo=n(ct);Bs=o(jo,"P1: "),Wt=s(jo,"CODE",{});var ni=n(Wt);Ws=o(ni,"[6, 7]"),ni.forEach(t),jo.forEach(t),Qs=c(mt),pt=s(mt,"LI",{});var To=n(pt);Fs=o(To,"P2: "),Qt=s(To,"CODE",{});var li=n(Qt);Rs=o(li,"[12, 13]"),li.forEach(t),To.forEach(t),mt.forEach(t),Ys=c(x),Ft=s(x,"P",{});var oi=n(Ft);Xs=o(oi,`So if we gather at the end of the first batch, we will get a tensor (nested list/tuple of tensor) corresponding to
the following indices:`),oi.forEach(t),Ks=c(x),Rt=s(x,"P",{});var ii=n(Rt);Yt=s(ii,"CODE",{});var ci=n(Yt);qs=o(ci,"[0, 1, 6, 7, 12, 13]"),ci.forEach(t),ii.forEach(t),en=c(x),Xt=s(x,"P",{});var pi=n(Xt);tn=o(pi,`If we directly concatenate our results without taking any precautions, the user will then get the predictions for
the indices in this order at the end of the prediction loop:`),pi.forEach(t),an=c(x),Kt=s(x,"P",{});var di=n(Kt);qt=s(di,"CODE",{});var hi=n(qt);rn=o(hi,"[0, 1, 6, 7, 12, 13, 2, 3, 8, 9, 14, 15, 4, 5, 10, 11, 0, 1]"),hi.forEach(t),di.forEach(t),sn=c(x),ea=s(x,"P",{});var fi=n(ea);nn=o(fi,"For some reason, that\u2019s not going to roll their boat. This class is there to solve that problem."),fi.forEach(t),ln=c(x),se=s(x,"DIV",{class:!0});var vr=n(se);$(Ae.$$.fragment,vr),on=c(vr),Pe=s(vr,"P",{});var wr=n(Pe);cn=o(wr,"Add "),ta=s(wr,"CODE",{});var mi=n(ta);pn=o(mi,"arrays"),mi.forEach(t),dn=o(wr,` to the internal storage, Will initialize the storage to the full size at the first arrays passed
so that if we\u2019re bound to get an OOM, it happens at the beginning.`),wr.forEach(t),vr.forEach(t),hn=c(x),ne=s(x,"DIV",{class:!0});var yr=n(ne);$(Ue.$$.fragment,yr),fn=c(yr),aa=s(yr,"P",{});var ui=n(aa);mn=o(ui,`Return the properly gathered arrays and truncate to the number of samples (since the sampler added some extras
to get each process a dataset of the same length).`),ui.forEach(t),yr.forEach(t),x.forEach(t),nr=c(a),R=s(a,"H2",{class:!0});var $r=n(R);le=s($r,"A",{id:!0,class:!0,href:!0});var gi=n(le);ra=s(gi,"SPAN",{});var bi=n(ra);$(Ie.$$.fragment,bi),bi.forEach(t),gi.forEach(t),un=c($r),sa=s($r,"SPAN",{});var _i=n(sa);gn=o(_i,"Distributed Evaluation"),_i.forEach(t),$r.forEach(t),lr=c(a),A=s(a,"DIV",{class:!0});var U=n(A);$(Ce.$$.fragment,U),bn=c(U),Je=s(U,"P",{});var Er=n(Je);_n=o(Er,"This subclass of "),na=s(Er,"CODE",{});var vi=n(na);vn=o(vi,"argparse.ArgumentParser"),vi.forEach(t),wn=o(Er," uses type hints on dataclasses to generate arguments."),Er.forEach(t),yn=c(U),Ze=s(U,"P",{});var jr=n(Ze);$n=o(jr,`The class is designed to play well with the native argparse. In particular, you can add more (non-dataclass backed)
arguments to the parser after initialization and you\u2019ll get the output back after parsing as an additional
namespace. Optional: To create sub argument groups use the `),la=s(jr,"CODE",{});var wi=n(la);En=o(wi,"_argument_group_name"),wi.forEach(t),jn=o(jr," attribute in the dataclass."),jr.forEach(t),Tn=c(U),L=s(U,"DIV",{class:!0});var ut=n(L);$(Le.$$.fragment,ut),Mn=c(ut),oa=s(ut,"P",{});var yi=n(oa);Dn=o(yi,"Parse command-line args into instances of the specified dataclass types."),yi.forEach(t),xn=c(ut),Ve=s(ut,"P",{});var Tr=n(Ve);kn=o(Tr,"This relies on argparse\u2019s "),ia=s(Tr,"CODE",{});var $i=n(ia);An=o($i,"ArgumentParser.parse_known_args"),$i.forEach(t),Pn=o(Tr,`. See the doc at:
docs.python.org/3.7/library/argparse.html#argparse.ArgumentParser.parse_args`),Tr.forEach(t),ut.forEach(t),Un=c(U),oe=s(U,"DIV",{class:!0});var Mr=n(oe);$(Ge.$$.fragment,Mr),In=c(Mr),Oe=s(Mr,"P",{});var Dr=n(Oe);Cn=o(Dr,"Alternative helper method that does not use "),ca=s(Dr,"CODE",{});var Ei=n(ca);Jn=o(Ei,"argparse"),Ei.forEach(t),Zn=o(Dr,` at all, instead uses a dict and populating the dataclass
types.`),Dr.forEach(t),Mr.forEach(t),Ln=c(U),ie=s(U,"DIV",{class:!0});var xr=n(ie);$(Ne.$$.fragment,xr),Vn=c(xr),ze=s(xr,"P",{});var kr=n(ze);Gn=o(kr,"Alternative helper method that does not use "),pa=s(kr,"CODE",{});var ji=n(pa);On=o(ji,"argparse"),ji.forEach(t),Nn=o(kr,` at all, instead loading a json file and populating the
dataclass types.`),kr.forEach(t),xr.forEach(t),zn=c(U),ce=s(U,"DIV",{class:!0});var Ar=n(ce);$(Se.$$.fragment,Ar),Sn=c(Ar),He=s(Ar,"P",{});var Pr=n(He);Hn=o(Pr,"Alternative helper method that does not use "),da=s(Pr,"CODE",{});var Ti=n(da);Bn=o(Ti,"argparse"),Ti.forEach(t),Wn=o(Pr,` at all, instead loading a yaml file and populating the
dataclass types.`),Pr.forEach(t),Ar.forEach(t),U.forEach(t),or=c(a),Y=s(a,"H2",{class:!0});var Ur=n(Y);pe=s(Ur,"A",{id:!0,class:!0,href:!0});var Mi=n(pe);ha=s(Mi,"SPAN",{});var Di=n(ha);$(Be.$$.fragment,Di),Di.forEach(t),Mi.forEach(t),Qn=c(Ur),fa=s(Ur,"SPAN",{});var xi=n(fa);Fn=o(xi,"Debug Utilities"),xi.forEach(t),Ur.forEach(t),ir=c(a),d=s(a,"DIV",{class:!0});var h=n(d);$(We.$$.fragment,h),Rn=c(h),X=s(h,"P",{});var gt=n(X);Yn=o(gt,`This debug class helps detect and understand where the model starts getting very large or very small, and more
importantly `),ma=s(gt,"CODE",{});var ki=n(ma);Xn=o(ki,"nan"),ki.forEach(t),Kn=o(gt," or "),ua=s(gt,"CODE",{});var Ai=n(ua);qn=o(Ai,"inf"),Ai.forEach(t),el=o(gt," weight and activation elements."),gt.forEach(t),tl=c(h),ga=s(h,"P",{});var Pi=n(ga);al=o(Pi,"There are 2 working modes:"),Pi.forEach(t),rl=c(h),Qe=s(h,"OL",{});var Ir=n(Qe);ba=s(Ir,"LI",{});var Ui=n(ba);sl=o(Ui,"Underflow/overflow detection (default)"),Ui.forEach(t),nl=c(Ir),_a=s(Ir,"LI",{});var Ii=n(_a);ll=o(Ii,"Specific batch absolute min/max tracing without detection"),Ii.forEach(t),Ir.forEach(t),ol=c(h),va=s(h,"P",{});var Ci=n(va);il=o(Ci,"Mode 1: Underflow/overflow detection"),Ci.forEach(t),cl=c(h),$(de.$$.fragment,h),pl=c(h),Z=s(h,"P",{});var ge=n(Z);dl=o(ge,"then run the training as normal and if "),wa=s(ge,"CODE",{});var Ji=n(wa);hl=o(Ji,"nan"),Ji.forEach(t),fl=o(ge," or "),ya=s(ge,"CODE",{});var Zi=n(ya);ml=o(Zi,"inf"),Zi.forEach(t),ul=o(ge,` gets detected in at least one of the weight, input or output
elements this module will throw an exception and will print `),$a=s(ge,"CODE",{});var Li=n($a);gl=o(Li,"max_frames_to_save"),Li.forEach(t),bl=o(ge,` frames that lead to this event,
each frame reporting`),ge.forEach(t),_l=c(h),Fe=s(h,"OL",{});var Cr=n(Fe);Re=s(Cr,"LI",{});var Jr=n(Re);vl=o(Jr,"the fully qualified module name plus the class name whose "),Ea=s(Jr,"CODE",{});var Vi=n(Ea);wl=o(Vi,"forward"),Vi.forEach(t),yl=o(Jr," was run"),Jr.forEach(t),$l=c(Cr),ja=s(Cr,"LI",{});var Gi=n(ja);El=o(Gi,"the absolute min and max value of all elements for each module weights, and the inputs and output"),Gi.forEach(t),Cr.forEach(t),jl=c(h),Ye=s(h,"P",{});var Zr=n(Ye);Tl=o(Zr,"For example, here is the header and the last few frames in detection report for "),Ta=s(Zr,"CODE",{});var Oi=n(Ta);Ml=o(Oi,"google/mt5-small"),Oi.forEach(t),Dl=o(Zr," run in fp16"),Zr.forEach(t),xl=c(h),$(he.$$.fragment,h),kl=c(h),K=s(h,"P",{});var bt=n(K);Al=o(bt,"You can see here, that "),Ma=s(bt,"CODE",{});var Ni=n(Ma);Pl=o(Ni,"T5DenseGatedGeluDense.forward"),Ni.forEach(t),Ul=o(bt,` resulted in output activations, whose absolute max value was
around 62.7K, which is very close to fp16\u2019s top limit of 64K. In the next frame we have `),Da=s(bt,"CODE",{});var zi=n(Da);Il=o(zi,"Dropout"),zi.forEach(t),Cl=o(bt,` which
renormalizes the weights, after it zeroed some of the elements, which pushes the absolute max value to more than
64K, and we get an overlow.`),bt.forEach(t),Jl=c(h),xa=s(h,"P",{});var Si=n(xa);Zl=o(Si,`As you can see it\u2019s the previous frames that we need to look into when the numbers start going into very large for
fp16 numbers.`),Si.forEach(t),Ll=c(h),Xe=s(h,"P",{});var Lr=n(Xe);Vl=o(Lr,"The tracking is done in a forward hook, which gets invoked immediately after "),ka=s(Lr,"CODE",{});var Hi=n(ka);Gl=o(Hi,"forward"),Hi.forEach(t),Ol=o(Lr," has completed."),Lr.forEach(t),Nl=c(h),$(fe.$$.fragment,h),zl=c(h),Aa=s(h,"P",{});var Bi=n(Aa);Sl=o(Bi,`To validate that you have set up this debugging feature correctly, and you intend to use it in a training that
may take hours to complete, first run it with normal tracing enabled for one of a few batches as explained in
the next section.`),Bi.forEach(t),Hl=c(h),Pa=s(h,"P",{});var Wi=n(Pa);Bl=o(Wi,"Mode 2. Specific batch absolute min/max tracing without detection"),Wi.forEach(t),Wl=c(h),Ua=s(h,"P",{});var Qi=n(Ua);Ql=o(Qi,"The second work mode is per-batch tracing with the underflow/overflow detection feature turned off."),Qi.forEach(t),Fl=c(h),Ke=s(h,"P",{});var Vr=n(Ke);Rl=o(Vr,"Let\u2019s say you want to watch the absolute min and max values for all the ingredients of each "),Ia=s(Vr,"CODE",{});var Fi=n(Ia);Yl=o(Fi,"forward"),Fi.forEach(t),Xl=o(Vr," call of a"),Vr.forEach(t),Kl=c(h),$(me.$$.fragment,h),ql=c(h),Ca=s(h,"P",{});var Ri=n(Ca);eo=o(Ri,"And now full batches 1 and 3 will be traced using the same format as explained above. Batches are 0-indexed."),Ri.forEach(t),to=c(h),Ja=s(h,"P",{});var Yi=n(Ja);ao=o(Yi,`This is helpful if you know that the program starts misbehaving after a certain batch number, so you can
fast-forward right to that area.`),Yi.forEach(t),ro=c(h),Za=s(h,"P",{});var Xi=n(Za);so=o(Xi,"Early stopping:"),Xi.forEach(t),no=c(h),$(ue.$$.fragment,h),lo=c(h),La=s(h,"P",{});var Ki=n(La);oo=o(Ki,"This feature is mainly useful in the tracing mode, but you can use it for any mode."),Ki.forEach(t),io=c(h),dt=s(h,"P",{});var Mo=n(dt);Va=s(Mo,"STRONG",{});var qi=n(Va);co=o(qi,"Performance"),qi.forEach(t),po=o(Mo,":"),Mo.forEach(t),ho=c(h),q=s(h,"P",{});var _t=n(q);fo=o(_t,"As this module measures absolute "),Ga=s(_t,"CODE",{});var ec=n(Ga);mo=o(ec,"min"),ec.forEach(t),uo=o(_t,"/`"),Oa=s(_t,"CODE",{});var tc=n(Oa);go=o(tc,"max"),tc.forEach(t),bo=o(_t,` of each weight of the model on every forward it\u2019ll slow the training
down. Therefore remember to turn it off once the debugging needs have been met.`),_t.forEach(t),h.forEach(t),this.h()},h(){u(g,"name","hf:doc:metadata"),u(g,"content",JSON.stringify(fc)),u(f,"id","utilities-for-trainer"),u(f,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(f,"href","#utilities-for-trainer"),u(w,"class","relative group"),u(tt,"href","/docs/transformers/v4.30.0/en/main_classes/trainer#transformers.Trainer"),u(te,"id","transformers.EvalPrediction"),u(te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(te,"href","#transformers.EvalPrediction"),u(G,"class","relative group"),u(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u($e,"href","https://pytorch.org/docs/stable/notes/randomness.html"),u($e,"rel","nofollow"),u(Ee,"href","https://www.tensorflow.org/api_docs/python/tf/config/experimental/enable_op_determinism"),u(Ee,"rel","nofollow"),u(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ae,"id","transformers.trainer_callback.CallbackHandler"),u(ae,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(ae,"href","#transformers.trainer_callback.CallbackHandler"),u(H,"class","relative group"),u(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(re,"id","transformers.trainer_pt_utils.DistributedTensorGatherer"),u(re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(re,"href","#transformers.trainer_pt_utils.DistributedTensorGatherer"),u(W,"class","relative group"),u(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(le,"id","transformers.HfArgumentParser"),u(le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(le,"href","#transformers.HfArgumentParser"),u(R,"class","relative group"),u(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),u(pe,"id","transformers.debug_utils.DebugUnderflowOverflow"),u(pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),u(pe,"href","#transformers.debug_utils.DebugUnderflowOverflow"),u(Y,"class","relative group"),u(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(a,m){e(document.head,g),b(a,k,m),b(a,w,m),e(w,f),e(f,D),E(p,D,null),e(w,_),e(w,wt),e(wt,Gr),b(a,Qa,m),b(a,ee,m),e(ee,Or),e(ee,tt),e(tt,Nr),e(ee,zr),b(a,Fa,m),b(a,at,m),e(at,Sr),b(a,Ra,m),b(a,G,m),e(G,te),e(te,yt),E(be,yt,null),e(G,Hr),e(G,$t),e($t,Br),b(a,Ya,m),b(a,O,m),E(_e,O,null),e(O,Wr),e(O,Et),e(Et,Qr),b(a,Xa,m),b(a,N,m),E(ve,N,null),e(N,Fr),e(N,jt),e(jt,Rr),b(a,Ka,m),b(a,J,m),E(we,J,null),e(J,Yr),e(J,Tt),e(Tt,Xr),e(J,Kr),e(J,ye),e(ye,rt),e(rt,$e),e($e,qr),e(rt,es),e(ye,ts),e(ye,st),e(st,Ee),e(Ee,as),e(st,rs),b(a,qa,m),b(a,z,m),E(je,z,null),e(z,ss),e(z,I),e(I,ns),e(I,Mt),e(Mt,ls),e(I,os),e(I,Dt),e(Dt,is),e(I,cs),e(I,xt),e(xt,ps),e(I,ds),e(I,kt),e(kt,hs),e(I,fs),b(a,er,m),b(a,S,m),E(Te,S,null),e(S,ms),e(S,At),e(At,us),b(a,tr,m),b(a,H,m),e(H,ae),e(ae,Pt),E(Me,Pt,null),e(H,gs),e(H,Ut),e(Ut,bs),b(a,ar,m),b(a,B,m),E(De,B,null),e(B,_s),e(B,It),e(It,vs),b(a,rr,m),b(a,W,m),e(W,re),e(re,Ct),E(xe,Ct,null),e(W,ws),e(W,Jt),e(Jt,ys),b(a,sr,m),b(a,v,m),E(ke,v,null),e(v,$s),e(v,Zt),e(Zt,Es),e(v,js),e(v,Lt),e(Lt,Ts),e(v,Ms),e(v,Vt),e(Vt,Gt),e(Gt,Ds),e(v,xs),e(v,Ot),e(Ot,ks),e(v,As),e(v,Q),e(Q,nt),e(nt,Ps),e(nt,Nt),e(Nt,Us),e(Q,Is),e(Q,lt),e(lt,Cs),e(lt,zt),e(zt,Js),e(Q,Zs),e(Q,ot),e(ot,Ls),e(ot,St),e(St,Vs),e(v,Gs),e(v,Ht),e(Ht,Os),e(v,Ns),e(v,F),e(F,it),e(it,zs),e(it,Bt),e(Bt,Ss),e(F,Hs),e(F,ct),e(ct,Bs),e(ct,Wt),e(Wt,Ws),e(F,Qs),e(F,pt),e(pt,Fs),e(pt,Qt),e(Qt,Rs),e(v,Ys),e(v,Ft),e(Ft,Xs),e(v,Ks),e(v,Rt),e(Rt,Yt),e(Yt,qs),e(v,en),e(v,Xt),e(Xt,tn),e(v,an),e(v,Kt),e(Kt,qt),e(qt,rn),e(v,sn),e(v,ea),e(ea,nn),e(v,ln),e(v,se),E(Ae,se,null),e(se,on),e(se,Pe),e(Pe,cn),e(Pe,ta),e(ta,pn),e(Pe,dn),e(v,hn),e(v,ne),E(Ue,ne,null),e(ne,fn),e(ne,aa),e(aa,mn),b(a,nr,m),b(a,R,m),e(R,le),e(le,ra),E(Ie,ra,null),e(R,un),e(R,sa),e(sa,gn),b(a,lr,m),b(a,A,m),E(Ce,A,null),e(A,bn),e(A,Je),e(Je,_n),e(Je,na),e(na,vn),e(Je,wn),e(A,yn),e(A,Ze),e(Ze,$n),e(Ze,la),e(la,En),e(Ze,jn),e(A,Tn),e(A,L),E(Le,L,null),e(L,Mn),e(L,oa),e(oa,Dn),e(L,xn),e(L,Ve),e(Ve,kn),e(Ve,ia),e(ia,An),e(Ve,Pn),e(A,Un),e(A,oe),E(Ge,oe,null),e(oe,In),e(oe,Oe),e(Oe,Cn),e(Oe,ca),e(ca,Jn),e(Oe,Zn),e(A,Ln),e(A,ie),E(Ne,ie,null),e(ie,Vn),e(ie,ze),e(ze,Gn),e(ze,pa),e(pa,On),e(ze,Nn),e(A,zn),e(A,ce),E(Se,ce,null),e(ce,Sn),e(ce,He),e(He,Hn),e(He,da),e(da,Bn),e(He,Wn),b(a,or,m),b(a,Y,m),e(Y,pe),e(pe,ha),E(Be,ha,null),e(Y,Qn),e(Y,fa),e(fa,Fn),b(a,ir,m),b(a,d,m),E(We,d,null),e(d,Rn),e(d,X),e(X,Yn),e(X,ma),e(ma,Xn),e(X,Kn),e(X,ua),e(ua,qn),e(X,el),e(d,tl),e(d,ga),e(ga,al),e(d,rl),e(d,Qe),e(Qe,ba),e(ba,sl),e(Qe,nl),e(Qe,_a),e(_a,ll),e(d,ol),e(d,va),e(va,il),e(d,cl),E(de,d,null),e(d,pl),e(d,Z),e(Z,dl),e(Z,wa),e(wa,hl),e(Z,fl),e(Z,ya),e(ya,ml),e(Z,ul),e(Z,$a),e($a,gl),e(Z,bl),e(d,_l),e(d,Fe),e(Fe,Re),e(Re,vl),e(Re,Ea),e(Ea,wl),e(Re,yl),e(Fe,$l),e(Fe,ja),e(ja,El),e(d,jl),e(d,Ye),e(Ye,Tl),e(Ye,Ta),e(Ta,Ml),e(Ye,Dl),e(d,xl),E(he,d,null),e(d,kl),e(d,K),e(K,Al),e(K,Ma),e(Ma,Pl),e(K,Ul),e(K,Da),e(Da,Il),e(K,Cl),e(d,Jl),e(d,xa),e(xa,Zl),e(d,Ll),e(d,Xe),e(Xe,Vl),e(Xe,ka),e(ka,Gl),e(Xe,Ol),e(d,Nl),E(fe,d,null),e(d,zl),e(d,Aa),e(Aa,Sl),e(d,Hl),e(d,Pa),e(Pa,Bl),e(d,Wl),e(d,Ua),e(Ua,Ql),e(d,Fl),e(d,Ke),e(Ke,Rl),e(Ke,Ia),e(Ia,Yl),e(Ke,Xl),e(d,Kl),E(me,d,null),e(d,ql),e(d,Ca),e(Ca,eo),e(d,to),e(d,Ja),e(Ja,ao),e(d,ro),e(d,Za),e(Za,so),e(d,no),E(ue,d,null),e(d,lo),e(d,La),e(La,oo),e(d,io),e(d,dt),e(dt,Va),e(Va,co),e(dt,po),e(d,ho),e(d,q),e(q,fo),e(q,Ga),e(Ga,mo),e(q,uo),e(q,Oa),e(Oa,go),e(q,bo),cr=!0},p(a,[m]){const qe={};m&2&&(qe.$$scope={dirty:m,ctx:a}),de.$set(qe);const Na={};m&2&&(Na.$$scope={dirty:m,ctx:a}),he.$set(Na);const za={};m&2&&(za.$$scope={dirty:m,ctx:a}),fe.$set(za);const Sa={};m&2&&(Sa.$$scope={dirty:m,ctx:a}),me.$set(Sa);const et={};m&2&&(et.$$scope={dirty:m,ctx:a}),ue.$set(et)},i(a){cr||(j(p.$$.fragment,a),j(be.$$.fragment,a),j(_e.$$.fragment,a),j(ve.$$.fragment,a),j(we.$$.fragment,a),j(je.$$.fragment,a),j(Te.$$.fragment,a),j(Me.$$.fragment,a),j(De.$$.fragment,a),j(xe.$$.fragment,a),j(ke.$$.fragment,a),j(Ae.$$.fragment,a),j(Ue.$$.fragment,a),j(Ie.$$.fragment,a),j(Ce.$$.fragment,a),j(Le.$$.fragment,a),j(Ge.$$.fragment,a),j(Ne.$$.fragment,a),j(Se.$$.fragment,a),j(Be.$$.fragment,a),j(We.$$.fragment,a),j(de.$$.fragment,a),j(he.$$.fragment,a),j(fe.$$.fragment,a),j(me.$$.fragment,a),j(ue.$$.fragment,a),cr=!0)},o(a){T(p.$$.fragment,a),T(be.$$.fragment,a),T(_e.$$.fragment,a),T(ve.$$.fragment,a),T(we.$$.fragment,a),T(je.$$.fragment,a),T(Te.$$.fragment,a),T(Me.$$.fragment,a),T(De.$$.fragment,a),T(xe.$$.fragment,a),T(ke.$$.fragment,a),T(Ae.$$.fragment,a),T(Ue.$$.fragment,a),T(Ie.$$.fragment,a),T(Ce.$$.fragment,a),T(Le.$$.fragment,a),T(Ge.$$.fragment,a),T(Ne.$$.fragment,a),T(Se.$$.fragment,a),T(Be.$$.fragment,a),T(We.$$.fragment,a),T(de.$$.fragment,a),T(he.$$.fragment,a),T(fe.$$.fragment,a),T(me.$$.fragment,a),T(ue.$$.fragment,a),cr=!1},d(a){t(g),a&&t(k),a&&t(w),M(p),a&&t(Qa),a&&t(ee),a&&t(Fa),a&&t(at),a&&t(Ra),a&&t(G),M(be),a&&t(Ya),a&&t(O),M(_e),a&&t(Xa),a&&t(N),M(ve),a&&t(Ka),a&&t(J),M(we),a&&t(qa),a&&t(z),M(je),a&&t(er),a&&t(S),M(Te),a&&t(tr),a&&t(H),M(Me),a&&t(ar),a&&t(B),M(De),a&&t(rr),a&&t(W),M(xe),a&&t(sr),a&&t(v),M(ke),M(Ae),M(Ue),a&&t(nr),a&&t(R),M(Ie),a&&t(lr),a&&t(A),M(Ce),M(Le),M(Ge),M(Ne),M(Se),a&&t(or),a&&t(Y),M(Be),a&&t(ir),a&&t(d),M(We),M(de),M(he),M(fe),M(me),M(ue)}}}const fc={local:"utilities-for-trainer",sections:[{local:"transformers.EvalPrediction",title:"Utilities"},{local:"transformers.trainer_callback.CallbackHandler",title:"Callbacks internals"},{local:"transformers.trainer_pt_utils.DistributedTensorGatherer",title:"Distributed Evaluation"},{local:"transformers.HfArgumentParser",title:"Distributed Evaluation"},{local:"transformers.debug_utils.DebugUnderflowOverflow",title:"Debug Utilities"}],title:"Utilities for Trainer"};function mc(C){return lc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wc extends ac{constructor(g){super();rc(this,g,mc,hc,sc,{})}}export{wc as default,fc as metadata};
