import{s as ce,n as de,o as ge}from"../chunks/scheduler.9bc65507.js";import{S as _e,i as Pe,g as l,s as a,r as G,A as $e,h as o,f as n,c as r,j as me,u as M,x as s,k as he,y as ve,a as i,v as L,d as H,t as I,w as k}from"../chunks/index.707bf1b6.js";import{H as q}from"../chunks/Heading.342b1fa6.js";function ye(ee){let f,A,U,E,u,S,p,te=`Training large transformer models and deploying them to production present various challenges.<br/>
During training, the model may require more GPU memory than available or exhibit slow training speed. In the deployment
phase, the model can struggle to handle the required throughput in a production environment.`,z,m,ne=`This documentation aims to assist you in overcoming these challenges and finding the optimal setting for your use-case.
The guides are divided into training and inference sections, as each comes with different challenges and solutions.
Within each section you’ll find separate guides for different hardware configurations, such as single GPU vs. multi-GPU
for training or CPU vs. GPU for inference.`,W,h,ie="Use this document as your starting point to navigate further to the methods that match your scenario.",F,c,R,d,ae=`Training large transformer models efficiently requires an accelerator such as a GPU or TPU. The most common case is where
you have a single GPU. The methods that you can apply to improve training efficiency on a single GPU extend to other setups
such as multiple GPU. However, there are also techniques that are specific to multi-GPU or CPU training. We cover them in
separate sections.`,X,g,re='<li><a href="perf_train_gpu_one">Methods and tools for efficient training on a single GPU</a>: start here to learn common approaches that can help optimize GPU memory utilization, speed up the training, or both.</li> <li><a href="perf_train_gpu_many">Multi-GPU training section</a>: explore this section to learn about further optimization methods that apply to a multi-GPU settings, such as data, tensor, and pipeline parallelism.</li> <li><a href="perf_train_cpu">CPU training section</a>: learn about mixed precision training on CPU.</li> <li><a href="perf_train_cpu_many">Efficient Training on Multiple CPUs</a>: learn about distributed CPU training.</li> <li><a href="perf_train_tpu_tf">Training on TPU with TensorFlow</a>: if you are new to TPUs, refer to this section for an opinionated introduction to training on TPUs and using XLA.</li> <li><a href="perf_hardware">Custom hardware for training</a>: find tips and tricks when building your own deep learning rig.</li> <li><a href="hpo_train">Hyperparameter Search using Trainer API</a></li>',j,_,B,P,le=`Efficient inference with large models in a production environment can be as challenging as training them. In the following
sections we go through the steps to run inference on CPU and single/multi-GPU setups.`,D,$,oe='<li><a href="perf_infer_cpu">Inference on a single CPU</a></li> <li><a href="perf_infer_gpu_one">Inference on a single GPU</a></li> <li><a href="perf_infer_gpu_many">Multi-GPU inference</a></li> <li><a href="tf_xla">XLA Integration for TensorFlow Models</a></li>',J,v,K,y,se="Here you’ll find techniques, tips and tricks that apply whether you are training a model, or running inference with it.",N,C,fe='<li><a href="big_models">Instantiating a big model</a></li> <li><a href="debugging">Troubleshooting performance issues</a></li>',O,w,Q,x,ue=`This document is far from being complete and a lot more needs to be added, so if you have additions or corrections to
make please don’t hesitate to open a PR or if you aren’t sure start an Issue and we can discuss the details there.`,V,T,pe=`When making contributions that A is better than B, please try to include a reproducible benchmark and/or a link to the
source of that information (unless it comes directly from you).`,Y,b,Z;return u=new q({props:{title:"Performance and Scalability",local:"performance-and-scalability",headingTag:"h1"}}),c=new q({props:{title:"Training",local:"training",headingTag:"h2"}}),_=new q({props:{title:"Inference",local:"inference",headingTag:"h2"}}),v=new q({props:{title:"Training and inference",local:"training-and-inference",headingTag:"h2"}}),w=new q({props:{title:"Contribute",local:"contribute",headingTag:"h2"}}),{c(){f=l("meta"),A=a(),U=l("p"),E=a(),G(u.$$.fragment),S=a(),p=l("p"),p.innerHTML=te,z=a(),m=l("p"),m.textContent=ne,W=a(),h=l("p"),h.textContent=ie,F=a(),G(c.$$.fragment),R=a(),d=l("p"),d.textContent=ae,X=a(),g=l("ul"),g.innerHTML=re,j=a(),G(_.$$.fragment),B=a(),P=l("p"),P.textContent=le,D=a(),$=l("ul"),$.innerHTML=oe,J=a(),G(v.$$.fragment),K=a(),y=l("p"),y.textContent=se,N=a(),C=l("ul"),C.innerHTML=fe,O=a(),G(w.$$.fragment),Q=a(),x=l("p"),x.textContent=ue,V=a(),T=l("p"),T.textContent=pe,Y=a(),b=l("p"),this.h()},l(e){const t=$e("svelte-u9bgzb",document.head);f=o(t,"META",{name:!0,content:!0}),t.forEach(n),A=r(e),U=o(e,"P",{}),me(U).forEach(n),E=r(e),M(u.$$.fragment,e),S=r(e),p=o(e,"P",{"data-svelte-h":!0}),s(p)!=="svelte-1wq4i4b"&&(p.innerHTML=te),z=r(e),m=o(e,"P",{"data-svelte-h":!0}),s(m)!=="svelte-g5ptwa"&&(m.textContent=ne),W=r(e),h=o(e,"P",{"data-svelte-h":!0}),s(h)!=="svelte-6nd06u"&&(h.textContent=ie),F=r(e),M(c.$$.fragment,e),R=r(e),d=o(e,"P",{"data-svelte-h":!0}),s(d)!=="svelte-1hwmwxf"&&(d.textContent=ae),X=r(e),g=o(e,"UL",{"data-svelte-h":!0}),s(g)!=="svelte-uklrf2"&&(g.innerHTML=re),j=r(e),M(_.$$.fragment,e),B=r(e),P=o(e,"P",{"data-svelte-h":!0}),s(P)!=="svelte-l8wb5c"&&(P.textContent=le),D=r(e),$=o(e,"UL",{"data-svelte-h":!0}),s($)!=="svelte-slh3iy"&&($.innerHTML=oe),J=r(e),M(v.$$.fragment,e),K=r(e),y=o(e,"P",{"data-svelte-h":!0}),s(y)!=="svelte-47g9l2"&&(y.textContent=se),N=r(e),C=o(e,"UL",{"data-svelte-h":!0}),s(C)!=="svelte-nwukeg"&&(C.innerHTML=fe),O=r(e),M(w.$$.fragment,e),Q=r(e),x=o(e,"P",{"data-svelte-h":!0}),s(x)!=="svelte-1v03uxh"&&(x.textContent=ue),V=r(e),T=o(e,"P",{"data-svelte-h":!0}),s(T)!=="svelte-uw4rm0"&&(T.textContent=pe),Y=r(e),b=o(e,"P",{}),me(b).forEach(n),this.h()},h(){he(f,"name","hf:doc:metadata"),he(f,"content",Ce)},m(e,t){ve(document.head,f),i(e,A,t),i(e,U,t),i(e,E,t),L(u,e,t),i(e,S,t),i(e,p,t),i(e,z,t),i(e,m,t),i(e,W,t),i(e,h,t),i(e,F,t),L(c,e,t),i(e,R,t),i(e,d,t),i(e,X,t),i(e,g,t),i(e,j,t),L(_,e,t),i(e,B,t),i(e,P,t),i(e,D,t),i(e,$,t),i(e,J,t),L(v,e,t),i(e,K,t),i(e,y,t),i(e,N,t),i(e,C,t),i(e,O,t),L(w,e,t),i(e,Q,t),i(e,x,t),i(e,V,t),i(e,T,t),i(e,Y,t),i(e,b,t),Z=!0},p:de,i(e){Z||(H(u.$$.fragment,e),H(c.$$.fragment,e),H(_.$$.fragment,e),H(v.$$.fragment,e),H(w.$$.fragment,e),Z=!0)},o(e){I(u.$$.fragment,e),I(c.$$.fragment,e),I(_.$$.fragment,e),I(v.$$.fragment,e),I(w.$$.fragment,e),Z=!1},d(e){e&&(n(A),n(U),n(E),n(S),n(p),n(z),n(m),n(W),n(h),n(F),n(R),n(d),n(X),n(g),n(j),n(B),n(P),n(D),n($),n(J),n(K),n(y),n(N),n(C),n(O),n(Q),n(x),n(V),n(T),n(Y),n(b)),n(f),k(u,e),k(c,e),k(_,e),k(v,e),k(w,e)}}}const Ce='{"title":"Performance and Scalability","local":"performance-and-scalability","sections":[{"title":"Training","local":"training","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2},{"title":"Training and inference","local":"training-and-inference","sections":[],"depth":2},{"title":"Contribute","local":"contribute","sections":[],"depth":2}],"depth":1}';function we(ee){return ge(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class be extends _e{constructor(f){super(),Pe(this,f,we,ye,ce,{})}}export{be as component};
