import{s as O,o as R,n as z}from"../chunks/scheduler.9bc65507.js";import{S as B,i as D,g as r,s as $,u as H,A as F,h as l,f as n,c as g,j as x,v as q,y as b,k as v,o as y,a as s,w as G,d as I,t as j,x as J}from"../chunks/index.78c82d43.js";import{T as K}from"../chunks/Tip.87d55b76.js";import{I as Q}from"../chunks/IconCopyLink.bedaa44d.js";function V(T){let e,m='Note: Most of the strategies introduced in the <a href="perf_train_gpu_one">single GPU section</a> (such as mixed precision training or gradient accumulation) and <a href="perf_train_gpu_many">multi-GPU section</a> are generic and apply to training models in general so make sure to have a look at it before diving into this section.';return{c(){e=r("p"),e.innerHTML=m},l(o){e=l(o,"P",{"data-svelte-h":!0}),b(e)!=="svelte-1abfqa9"&&(e.innerHTML=m)},m(o,d){s(o,e,d)},p:z,d(o){o&&n(e)}}}function W(T){let e,m,o,d,i,p,w,f,U,_,A="Training on TPUs",C,c,k,h,M="This document will be completed soon with information on how to train on TPUs.",E,P,S;return f=new Q({}),c=new K({props:{$$slots:{default:[V]},$$scope:{ctx:T}}}),{c(){e=r("meta"),m=$(),o=r("p"),d=$(),i=r("h1"),p=r("a"),w=r("span"),H(f.$$.fragment),U=$(),_=r("span"),_.textContent=A,C=$(),H(c.$$.fragment),k=$(),h=r("p"),h.textContent=M,E=$(),P=r("p"),this.h()},l(t){const a=F("svelte-1phssyn",document.head);e=l(a,"META",{name:!0,content:!0}),a.forEach(n),m=g(t),o=l(t,"P",{}),x(o).forEach(n),d=g(t),i=l(t,"H1",{class:!0});var u=x(i);p=l(u,"A",{id:!0,class:!0,href:!0});var L=x(p);w=l(L,"SPAN",{});var N=x(w);q(f.$$.fragment,N),N.forEach(n),L.forEach(n),U=g(u),_=l(u,"SPAN",{"data-svelte-h":!0}),b(_)!=="svelte-1s1tmw2"&&(_.textContent=A),u.forEach(n),C=g(t),q(c.$$.fragment,t),k=g(t),h=l(t,"P",{"data-svelte-h":!0}),b(h)!=="svelte-458r7d"&&(h.textContent=M),E=g(t),P=l(t,"P",{}),x(P).forEach(n),this.h()},h(){v(e,"name","hf:doc:metadata"),v(e,"content",JSON.stringify(X)),v(p,"id","training-on-tpus"),v(p,"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"),v(p,"href","#training-on-tpus"),v(i,"class","relative group")},m(t,a){y(document.head,e),s(t,m,a),s(t,o,a),s(t,d,a),s(t,i,a),y(i,p),y(p,w),G(f,w,null),y(i,U),y(i,_),s(t,C,a),G(c,t,a),s(t,k,a),s(t,h,a),s(t,E,a),s(t,P,a),S=!0},p(t,[a]){const u={};a&2&&(u.$$scope={dirty:a,ctx:t}),c.$set(u)},i(t){S||(I(f.$$.fragment,t),I(c.$$.fragment,t),S=!0)},o(t){j(f.$$.fragment,t),j(c.$$.fragment,t),S=!1},d(t){t&&(n(m),n(o),n(d),n(i),n(C),n(k),n(h),n(E),n(P)),n(e),J(f),J(c,t)}}}const X={local:"training-on-tpus",title:"Training on TPUs"};function Y(T){return R(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class at extends B{constructor(e){super(),D(this,e,Y,W,O,{})}}export{at as component};
