Buckets:
| import{s as ct,o as pt,n as Re}from"../chunks/scheduler.defa9a21.js";import{S as mt,i as yt,g as r,s,r as m,A as Mt,h as c,f as l,c as i,j as ot,u as y,x as p,k as rt,y as dt,a,v as M,d,t as h,w as u}from"../chunks/index.fe795e71.js";import{T as ke}from"../chunks/Tip.179eb360.js";import{C as $}from"../chunks/CodeBlock.42404125.js";import{H as Xe,E as ht}from"../chunks/EditOnGithub.0f575778.js";function ut(b){let n,f=`This code snippet is based off the one from the <code>simple_nlp_example</code> notebook found <a href="https://github.com/huggingface/notebooks/blob/main/examples/accelerate_examples/simple_nlp_example.ipynb" rel="nofollow">here</a> with slight | |
| modifications for the sake of simplicity`;return{c(){n=r("p"),n.innerHTML=f},l(o){n=c(o,"P",{"data-svelte-h":!0}),p(n)!=="svelte-yrnjd5"&&(n.innerHTML=f)},m(o,U){a(o,n,U)},p:Re,d(o){o&&l(n)}}}function ft(b){let n,f="The <code>notebook_launcher</code> will default to 8 processes if 🤗 Accelerate has been configured for a TPU";return{c(){n=r("p"),n.innerHTML=f},l(o){n=c(o,"P",{"data-svelte-h":!0}),p(n)!=="svelte-1vfe74j"&&(n.innerHTML=f)},m(o,U){a(o,n,U)},p:Re,d(o){o&&l(n)}}}function Ut(b){let n,f=`The above workaround is only needed when launching a TPU instance from a Jupyter Notebook on a low-resource server such as Google Colaboratory or Kaggle. If | |
| using a script or launching on a much beefier server declaring the model beforehand is not needed.`;return{c(){n=r("p"),n.textContent=f},l(o){n=c(o,"P",{"data-svelte-h":!0}),p(n)!=="svelte-o7huol"&&(n.textContent=f)},m(o,U){a(o,n,U)},p:Re,d(o){o&&l(n)}}}function bt(b){let n,f="Just because the memory is allocated does not mean it will be used or that the batch size will increase when going back to your training dataloader.";return{c(){n=r("p"),n.textContent=f},l(o){n=c(o,"P",{"data-svelte-h":!0}),p(n)!=="svelte-1enbpvz"&&(n.textContent=f)},m(o,U){a(o,n,U)},p:Re,d(o){o&&l(n)}}}function wt(b){let n,f,o,U,g,le,J,Be=`Training on TPUs can be slightly different from training on multi-gpu, even with 🤗 Accelerate. This guide aims to show you | |
| where you should be careful and why, as well as the best practices in general.`,ae,_,ne,v,ze=`The main carepoint when training on TPUs comes from the <a href="/docs/accelerate/main/en/package_reference/launchers#accelerate.notebook_launcher">notebook_launcher()</a>. As mentioned in the <a href="../usage_guides/notebook">notebook tutorial</a>, you need to | |
| restructure your training code into a function that can get passed to the <a href="/docs/accelerate/main/en/package_reference/launchers#accelerate.notebook_launcher">notebook_launcher()</a> function and be careful about not declaring any tensors on the GPU.`,se,G,Fe=`While on a TPU that last part is not as important, a critical part to understand is that when you launch code from a notebook you do so through a process called <strong>forking</strong>. | |
| When launching from the command-line, you perform <strong>spawning</strong>, where a python process is not currently running and you <em>spawn</em> a new process in. Since your Jupyter notebook is already | |
| utilizing a python process, you need to <em>fork</em> a new process from it to launch your code.`,ie,Y,Se=`Where this becomes important is in regard to declaring your model. On forked TPU processes, it is recommended that you instantiate your model <em>once</em> and pass this into your | |
| training function. This is different than training on GPUs where you create <code>n</code> models that have their gradients synced and back-propagated at certain moments. Instead, one | |
| model instance is shared between all the nodes and it is passed back and forth. This is important especially when training on low-resource TPUs such as those provided in Kaggle kernels or | |
| on Google Colaboratory.`,oe,I,He='Below is an example of a training function passed to the <a href="/docs/accelerate/main/en/package_reference/launchers#accelerate.notebook_launcher">notebook_launcher()</a> if training on CPUs or GPUs:',re,w,ce,V,pe,A,me,T,ye,Z,Qe=`If you use this example and declare the model <em>inside</em> the training loop, then on a low-resource system you will potentially see an error | |
| like:`,Me,W,de,x,Ee=`This error is <em>extremely</em> cryptic but the basic explanation is you ran out of system RAM. You can avoid this entirely by reconfiguring the training function to | |
| accept a single <code>model</code> argument, and declare it in an outside cell:`,he,k,ue,X,fe,R,Ne="And finally calling the training function with:",Ue,B,be,j,we,z,Te,F,Pe=`As mentioned in the <a href="../usage_guides/mixed_precision">mixed precision tutorial</a>, 🤗 Accelerate supports fp16 and bf16, both of which can be used on TPUs. | |
| That being said, ideally <code>bf16</code> should be utilized as it is extremely efficient to use.`,je,S,Le="There are two “layers” when using <code>bf16</code> and 🤗 Accelerate on TPUs, at the base level and at the operation level.",Ce,H,qe="At the base level, this is enabled when passing <code>mixed_precision="bf16"</code> to <code>Accelerator</code>, such as:",$e,Q,ge,E,Ke=`By default, this will cast <code>torch.float</code> and <code>torch.double</code> to <code>bfloat16</code> on TPUs. | |
| The specific configuration being set is an environmental variable of <code>XLA_USE_BF16</code> is set to <code>1</code>.`,Je,N,De=`There is a further configuration you can perform which is setting the <code>XLA_DOWNCAST_BF16</code> environmental variable. If set to <code>1</code>, then | |
| <code>torch.float</code> is <code>bfloat16</code> and <code>torch.double</code> is <code>float32</code>.`,_e,P,Oe="This is performed in the <code>Accelerator</code> object when passing <code>downcast_bf16=True</code>:",ve,L,Ge,q,et="Using downcasting instead of bf16 everywhere is good for when you are trying to calculate metrics, log values, and more where raw bf16 tensors would be unusable.",Ye,K,Ie,D,tt=`As you launch your script, you may notice that training seems exceptionally slow at first. This is because TPUs | |
| first run through a few batches of data to see how much memory to allocate before finally utilizing this configured | |
| memory allocation extremely efficiently.`,Ve,O,lt=`If you notice that your evaluation code to calculate the metrics of your model takes longer due to a larger batch size being used, | |
| it is recommended to keep the batch size the same as the training data if it is too slow. Otherwise the memory will reallocate to this | |
| new batch size after the first few iterations.`,Ae,C,Ze,ee,We,te,xe;return g=new Xe({props:{title:"Training on TPUs with 🤗 Accelerate",local:"training-on-tpus-with--accelerate",headingTag:"h1"}}),_=new Xe({props:{title:"Training in a Notebook",local:"training-in-a-notebook",headingTag:"h2"}}),w=new ke({props:{$$slots:{default:[ut]},$$scope:{ctx:b}}}),V=new $({props:{code:"ZGVmJTIwdHJhaW5pbmdfZnVuY3Rpb24oKSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyMEluaXRpYWxpemUlMjBhY2NlbGVyYXRvciUwQSUyMCUyMCUyMCUyMGFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b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wKCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvcHRpbWl6ZXIuemVyb19ncmFkKCk=",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">training_function</span>(): | |
| <span class="hljs-comment"># Initialize accelerator</span> | |
| accelerator = Accelerator() | |
| model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">"bert-base-cased"</span>, num_labels=<span class="hljs-number">2</span>) | |
| train_dataloader, eval_dataloader = create_dataloaders( | |
| train_batch_size=hyperparameters[<span class="hljs-string">"train_batch_size"</span>], eval_batch_size=hyperparameters[<span class="hljs-string">"eval_batch_size"</span>] | |
| ) | |
| <span class="hljs-comment"># Instantiate optimizer</span> | |
| optimizer = AdamW(params=model.parameters(), lr=hyperparameters[<span class="hljs-string">"learning_rate"</span>]) | |
| <span class="hljs-comment"># Prepare everything</span> | |
| <span class="hljs-comment"># There is no specific order to remember, we just need to unpack the objects in the same order we gave them to the</span> | |
| <span class="hljs-comment"># prepare method.</span> | |
| model, optimizer, train_dataloader, eval_dataloader = accelerator.prepare( | |
| model, optimizer, train_dataloader, eval_dataloader | |
| ) | |
| num_epochs = hyperparameters[<span class="hljs-string">"num_epochs"</span>] | |
| <span class="hljs-comment"># Now we train the model</span> | |
| <span class="hljs-keyword">for</span> epoch <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_epochs): | |
| model.train() | |
| <span class="hljs-keyword">for</span> step, batch <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(train_dataloader): | |
| outputs = model(**batch) | |
| loss = outputs.loss | |
| accelerator.backward(loss) | |
| optimizer.step() | |
| optimizer.zero_grad()`,wrap:!1}}),A=new $({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBub3RlYm9va19sYXVuY2hlciUwQSUwQW5vdGVib29rX2xhdW5jaGVyKHRyYWluaW5nX2Z1bmN0aW9uKQ==",highlighted:`<span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> notebook_launcher | |
| notebook_launcher(training_function)`,wrap:!1}}),T=new ke({props:{$$slots:{default:[ft]},$$scope:{ctx:b}}}),W=new $({props:{code:"UHJvY2Vzc0V4aXRlZEV4Y2VwdGlvbiUzQSUyMHByb2Nlc3MlMjAwJTIwdGVybWluYXRlZCUyMHdpdGglMjBzaWduYWwlMjBTSUdTRUdW",highlighted:'<span class="hljs-attribute">ProcessExitedException</span>: process <span class="hljs-number">0</span> terminated <span class="hljs-keyword">with</span> <span class="hljs-keyword">signal</span><span class="hljs-string"> SIGSEGV</span>',wrap:!1}}),k=new $({props:{code:"JTIzJTIwSW4lMjBhbm90aGVyJTIwSnVweXRlciUyMGNlbGwlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS1jYXNlZCUyMiUyQyUyMG51bV9sYWJlbHMlM0QyKQ==",highlighted:`<span class="hljs-comment"># In another Jupyter cell</span> | |
| model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">"bert-base-cased"</span>, num_labels=<span class="hljs-number">2</span>)`,wrap:!1}}),X=new $({props:{code:"JTJCJTIwZGVmJTIwdHJhaW5pbmdfZnVuY3Rpb24obW9kZWwpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwSW5pdGlhbGl6ZSUyMGFjY2VsZXJhdG9yJTBBJTIwJTIwJTIwJTIwJTIwJTIwYWNjZWxlcmF0b3IlMjAlM0QlMjBBY2NlbGVyYXRvcigpJTBBLSUyMCUyMCUyMCUyMCUyMG1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyYmVydC1iYXNlLWNhc2VkJTIyJTJDJTIwbnVtX2xhYmVscyUzRDIpJTBBJTIwJTIwJTIwJTIwJTIwJTIwdHJhaW5fZGF0YWxvYWRlciUyQyUyMGV2YWxfZGF0YWxvYWRlciUyMCUzRCUyMGNyZWF0ZV9kYXRhbG9hZGVycyglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB0cmFpbl9iYXRjaF9zaXplJTNEaHlwZXJwYXJhbWV0ZXJzJTVCJTIydHJhaW5fYmF0Y2hfc2l6ZSUyMiU1RCUyQyUyMGV2YWxfYmF0Y2hfc2l6ZSUzRGh5cGVycGFyYW1ldGVycyU1QiUyMmV2YWxfYmF0Y2hfc2l6ZSUyMiU1RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCklMEElMjAlMjAuLi4=",highlighted:`<span class="hljs-addition">+ def training_function(model):</span> | |
| # Initialize accelerator | |
| accelerator = Accelerator() | |
| <span class="hljs-deletion">- model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased", num_labels=2)</span> | |
| train_dataloader, eval_dataloader = create_dataloaders( | |
| train_batch_size=hyperparameters["train_batch_size"], eval_batch_size=hyperparameters["eval_batch_size"] | |
| ) | |
| ...`,wrap:!1}}),B=new $({props:{code:"JTIwJTIwZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBub3RlYm9va19sYXVuY2hlciUwQS0lMjBub3RlYm9va19sYXVuY2hlcih0cmFpbmluZ19mdW5jdGlvbiklMEElMkIlMjBub3RlYm9va19sYXVuY2hlcih0cmFpbmluZ19mdW5jdGlvbiUyQyUyMChtb2RlbCUyQykp",highlighted:` from accelerate import notebook_launcher | |
| <span class="hljs-deletion">- notebook_launcher(training_function)</span> | |
| <span class="hljs-addition">+ notebook_launcher(training_function, (model,))</span>`,wrap:!1}}),j=new ke({props:{$$slots:{default:[Ut]},$$scope:{ctx:b}}}),z=new Xe({props:{title:"Mixed Precision and Global Variables",local:"mixed-precision-and-global-variables",headingTag:"h2"}}),Q=new $({props:{code:"YWNjZWxlcmF0b3IlMjAlM0QlMjBBY2NlbGVyYXRvcihtaXhlZF9wcmVjaXNpb24lM0QlMjJiZjE2JTIyKQ==",highlighted:'accelerator = Accelerator(mixed_precision=<span class="hljs-string">"bf16"</span>)',wrap:!1}}),L=new $({props:{code:"YWNjZWxlcmF0b3IlMjAlM0QlMjBBY2NlbGVyYXRvcihtaXhlZF9wcmVjaXNpb24lM0QlMjJiZjE2JTIyJTJDJTIwZG93bmNhc3RfYmYxNiUzRFRydWUp",highlighted:'accelerator = Accelerator(mixed_precision=<span class="hljs-string">"bf16"</span>, downcast_bf16=<span class="hljs-literal">True</span>)',wrap:!1}}),K=new Xe({props:{title:"Training Times on TPUs",local:"training-times-on-tpus",headingTag:"h2"}}),C=new ke({props:{$$slots:{default:[bt]},$$scope:{ctx:b}}}),ee=new ht({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/concept_guides/training_tpu.md"}}),{c(){n=r("meta"),f=s(),o=r("p"),U=s(),m(g.$$.fragment),le=s(),J=r("p"),J.textContent=Be,ae=s(),m(_.$$.fragment),ne=s(),v=r("p"),v.innerHTML=ze,se=s(),G=r("p"),G.innerHTML=Fe,ie=s(),Y=r("p"),Y.innerHTML=Se,oe=s(),I=r("p"),I.innerHTML=He,re=s(),m(w.$$.fragment),ce=s(),m(V.$$.fragment),pe=s(),m(A.$$.fragment),me=s(),m(T.$$.fragment),ye=s(),Z=r("p"),Z.innerHTML=Qe,Me=s(),m(W.$$.fragment),de=s(),x=r("p"),x.innerHTML=Ee,he=s(),m(k.$$.fragment),ue=s(),m(X.$$.fragment),fe=s(),R=r("p"),R.textContent=Ne,Ue=s(),m(B.$$.fragment),be=s(),m(j.$$.fragment),we=s(),m(z.$$.fragment),Te=s(),F=r("p"),F.innerHTML=Pe,je=s(),S=r("p"),S.innerHTML=Le,Ce=s(),H=r("p"),H.innerHTML=qe,$e=s(),m(Q.$$.fragment),ge=s(),E=r("p"),E.innerHTML=Ke,Je=s(),N=r("p"),N.innerHTML=De,_e=s(),P=r("p"),P.innerHTML=Oe,ve=s(),m(L.$$.fragment),Ge=s(),q=r("p"),q.textContent=et,Ye=s(),m(K.$$.fragment),Ie=s(),D=r("p"),D.textContent=tt,Ve=s(),O=r("p"),O.textContent=lt,Ae=s(),m(C.$$.fragment),Ze=s(),m(ee.$$.fragment),We=s(),te=r("p"),this.h()},l(e){const t=Mt("svelte-u9bgzb",document.head);n=c(t,"META",{name:!0,content:!0}),t.forEach(l),f=i(e),o=c(e,"P",{}),ot(o).forEach(l),U=i(e),y(g.$$.fragment,e),le=i(e),J=c(e,"P",{"data-svelte-h":!0}),p(J)!=="svelte-mklosk"&&(J.textContent=Be),ae=i(e),y(_.$$.fragment,e),ne=i(e),v=c(e,"P",{"data-svelte-h":!0}),p(v)!=="svelte-1srxrxc"&&(v.innerHTML=ze),se=i(e),G=c(e,"P",{"data-svelte-h":!0}),p(G)!=="svelte-jduzug"&&(G.innerHTML=Fe),ie=i(e),Y=c(e,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-1p7m292"&&(Y.innerHTML=Se),oe=i(e),I=c(e,"P",{"data-svelte-h":!0}),p(I)!=="svelte-18bfwf0"&&(I.innerHTML=He),re=i(e),y(w.$$.fragment,e),ce=i(e),y(V.$$.fragment,e),pe=i(e),y(A.$$.fragment,e),me=i(e),y(T.$$.fragment,e),ye=i(e),Z=c(e,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-ty61hq"&&(Z.innerHTML=Qe),Me=i(e),y(W.$$.fragment,e),de=i(e),x=c(e,"P",{"data-svelte-h":!0}),p(x)!=="svelte-wyby5p"&&(x.innerHTML=Ee),he=i(e),y(k.$$.fragment,e),ue=i(e),y(X.$$.fragment,e),fe=i(e),R=c(e,"P",{"data-svelte-h":!0}),p(R)!=="svelte-4gz0l1"&&(R.textContent=Ne),Ue=i(e),y(B.$$.fragment,e),be=i(e),y(j.$$.fragment,e),we=i(e),y(z.$$.fragment,e),Te=i(e),F=c(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-yzuh09"&&(F.innerHTML=Pe),je=i(e),S=c(e,"P",{"data-svelte-h":!0}),p(S)!=="svelte-12pgkz4"&&(S.innerHTML=Le),Ce=i(e),H=c(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-1x5gbwm"&&(H.innerHTML=qe),$e=i(e),y(Q.$$.fragment,e),ge=i(e),E=c(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-g1oxbw"&&(E.innerHTML=Ke),Je=i(e),N=c(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-13m84js"&&(N.innerHTML=De),_e=i(e),P=c(e,"P",{"data-svelte-h":!0}),p(P)!=="svelte-qa71s5"&&(P.innerHTML=Oe),ve=i(e),y(L.$$.fragment,e),Ge=i(e),q=c(e,"P",{"data-svelte-h":!0}),p(q)!=="svelte-90ggge"&&(q.textContent=et),Ye=i(e),y(K.$$.fragment,e),Ie=i(e),D=c(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-1404l3y"&&(D.textContent=tt),Ve=i(e),O=c(e,"P",{"data-svelte-h":!0}),p(O)!=="svelte-cqp35u"&&(O.textContent=lt),Ae=i(e),y(C.$$.fragment,e),Ze=i(e),y(ee.$$.fragment,e),We=i(e),te=c(e,"P",{}),ot(te).forEach(l),this.h()},h(){rt(n,"name","hf:doc:metadata"),rt(n,"content",Tt)},m(e,t){dt(document.head,n),a(e,f,t),a(e,o,t),a(e,U,t),M(g,e,t),a(e,le,t),a(e,J,t),a(e,ae,t),M(_,e,t),a(e,ne,t),a(e,v,t),a(e,se,t),a(e,G,t),a(e,ie,t),a(e,Y,t),a(e,oe,t),a(e,I,t),a(e,re,t),M(w,e,t),a(e,ce,t),M(V,e,t),a(e,pe,t),M(A,e,t),a(e,me,t),M(T,e,t),a(e,ye,t),a(e,Z,t),a(e,Me,t),M(W,e,t),a(e,de,t),a(e,x,t),a(e,he,t),M(k,e,t),a(e,ue,t),M(X,e,t),a(e,fe,t),a(e,R,t),a(e,Ue,t),M(B,e,t),a(e,be,t),M(j,e,t),a(e,we,t),M(z,e,t),a(e,Te,t),a(e,F,t),a(e,je,t),a(e,S,t),a(e,Ce,t),a(e,H,t),a(e,$e,t),M(Q,e,t),a(e,ge,t),a(e,E,t),a(e,Je,t),a(e,N,t),a(e,_e,t),a(e,P,t),a(e,ve,t),M(L,e,t),a(e,Ge,t),a(e,q,t),a(e,Ye,t),M(K,e,t),a(e,Ie,t),a(e,D,t),a(e,Ve,t),a(e,O,t),a(e,Ae,t),M(C,e,t),a(e,Ze,t),M(ee,e,t),a(e,We,t),a(e,te,t),xe=!0},p(e,[t]){const at={};t&2&&(at.$$scope={dirty:t,ctx:e}),w.$set(at);const nt={};t&2&&(nt.$$scope={dirty:t,ctx:e}),T.$set(nt);const st={};t&2&&(st.$$scope={dirty:t,ctx:e}),j.$set(st);const it={};t&2&&(it.$$scope={dirty:t,ctx:e}),C.$set(it)},i(e){xe||(d(g.$$.fragment,e),d(_.$$.fragment,e),d(w.$$.fragment,e),d(V.$$.fragment,e),d(A.$$.fragment,e),d(T.$$.fragment,e),d(W.$$.fragment,e),d(k.$$.fragment,e),d(X.$$.fragment,e),d(B.$$.fragment,e),d(j.$$.fragment,e),d(z.$$.fragment,e),d(Q.$$.fragment,e),d(L.$$.fragment,e),d(K.$$.fragment,e),d(C.$$.fragment,e),d(ee.$$.fragment,e),xe=!0)},o(e){h(g.$$.fragment,e),h(_.$$.fragment,e),h(w.$$.fragment,e),h(V.$$.fragment,e),h(A.$$.fragment,e),h(T.$$.fragment,e),h(W.$$.fragment,e),h(k.$$.fragment,e),h(X.$$.fragment,e),h(B.$$.fragment,e),h(j.$$.fragment,e),h(z.$$.fragment,e),h(Q.$$.fragment,e),h(L.$$.fragment,e),h(K.$$.fragment,e),h(C.$$.fragment,e),h(ee.$$.fragment,e),xe=!1},d(e){e&&(l(f),l(o),l(U),l(le),l(J),l(ae),l(ne),l(v),l(se),l(G),l(ie),l(Y),l(oe),l(I),l(re),l(ce),l(pe),l(me),l(ye),l(Z),l(Me),l(de),l(x),l(he),l(ue),l(fe),l(R),l(Ue),l(be),l(we),l(Te),l(F),l(je),l(S),l(Ce),l(H),l($e),l(ge),l(E),l(Je),l(N),l(_e),l(P),l(ve),l(Ge),l(q),l(Ye),l(Ie),l(D),l(Ve),l(O),l(Ae),l(Ze),l(We),l(te)),l(n),u(g,e),u(_,e),u(w,e),u(V,e),u(A,e),u(T,e),u(W,e),u(k,e),u(X,e),u(B,e),u(j,e),u(z,e),u(Q,e),u(L,e),u(K,e),u(C,e),u(ee,e)}}}const Tt='{"title":"Training on TPUs with 🤗 Accelerate","local":"training-on-tpus-with--accelerate","sections":[{"title":"Training in a Notebook","local":"training-in-a-notebook","sections":[],"depth":2},{"title":"Mixed Precision and Global Variables","local":"mixed-precision-and-global-variables","sections":[],"depth":2},{"title":"Training Times on TPUs","local":"training-times-on-tpus","sections":[],"depth":2}],"depth":1}';function jt(b){return pt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vt extends mt{constructor(n){super(),yt(this,n,jt,wt,ct,{})}}export{vt as component}; | |
Xet Storage Details
- Size:
- 20.8 kB
- Xet hash:
- d604e46c9ec96b511c8059040c2ce3d9269ed93aaf3f2e8da1628b20eaddbe2a
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.