import{s as R,n as N,o as K}from"../chunks/scheduler.defa9a21.js";import{S as Q,i as ee,g as s,s as n,r as v,A as te,h as r,f as a,c as o,j as V,u as y,x as G,k as J,y as ae,a as i,v as x,d as k,t as P,w as T}from"../chunks/index.fe795e71.js";import{C as ie}from"../chunks/CodeBlock.204b6c34.js";import{H as B,E as ne}from"../chunks/getInferenceSnippets.2234a8dd.js";function oe(W){let l,C,_,M,d,H,c,Y=`Users can take advantage of Intel Gaudi AI accelerators for significantly faster and cost-effective model training and inference.
The Intel Gaudi AI accelerator family currently includes three product generations: <a href="https://habana.ai/products/gaudi/" rel="nofollow">Intel Gaudi 1</a>, <a href="https://habana.ai/products/gaudi2/" rel="nofollow">Intel Gaudi 2</a>, and <a href="https://habana.ai/products/gaudi3/" rel="nofollow">Intel Gaudi 3</a>. Each server is equipped with 8 devices, known as Habana Processing Units (HPUs), providing 128GB of memory on Gaudi 3, 96GB on Gaudi 2, and 32GB on the first-gen Gaudi. For more details on the underlying hardware architecture, check out the <a href="https://docs.habana.ai/en/latest/Gaudi_Overview/Gaudi_Architecture.html" rel="nofollow">Gaudi Architecture Overview</a>.`,I,u,L,m,D=`It is enabled by default if an Intel Gaudi device is detected.
To disable it, pass <code>--cpu</code> flag to <code>accelerate launch</code> command or answer the corresponding question when answering the <code>accelerate config</code> questionnaire.`,U,f,F="You can directly run the following script to test it out on Intel Gaudi:",q,p,S,h,A,g,O='The following features are not part of the Accelerate library and requires <a href="https://huggingface.co/docs/optimum/main/en/habana/index" rel="nofollow">Optimum for Intel Gaudi</a>:',E,w,X="<li><code>fast_ddp</code> which implements DDP by applying an all-reduce on gradients instead of the Torch DDP wrapper.</li> <li><code>minimize_memory</code> which is used for fp8 training and enables keeping fp8 weights in memory between the forward and backward passes, leading to a smaller memory footprint at the cost of additional fp8 casts.</li> <li><code>context_parallel_size</code> which is used for Context/Sequence Parallelism (CP/SP) and partitions the network inputs and activations along sequence dimension to reduce memory footprint and increase throughput.</li>",Z,$,j,b,z;return d=new B({props:{title:"Intel Gaudi",local:"intel-gaudi",headingTag:"h1"}}),u=new B({props:{title:"How it works out of the box",local:"how-it-works-out-of-the-box",headingTag:"h2"}}),p=new ie({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMCUyRmV4YW1wbGVzJTJGY3ZfZXhhbXBsZS5weSUyMC0tZGF0YV9kaXIlMjBpbWFnZXM=",highlighted:"accelerate launch /examples/cv_example.py --data_dir images",wrap:!1}}),h=new B({props:{title:"Limitations",local:"limitations",headingTag:"h2"}}),$=new ne({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/usage_guides/gaudi.md"}}),{c(){l=s("meta"),C=n(),_=s("p"),M=n(),v(d.$$.fragment),H=n(),c=s("p"),c.innerHTML=Y,I=n(),v(u.$$.fragment),L=n(),m=s("p"),m.innerHTML=D,U=n(),f=s("p"),f.textContent=F,q=n(),v(p.$$.fragment),S=n(),v(h.$$.fragment),A=n(),g=s("p"),g.innerHTML=O,E=n(),w=s("ul"),w.innerHTML=X,Z=n(),v($.$$.fragment),j=n(),b=s("p"),this.h()},l(e){const t=te("svelte-u9bgzb",document.head);l=r(t,"META",{name:!0,content:!0}),t.forEach(a),C=o(e),_=r(e,"P",{}),V(_).forEach(a),M=o(e),y(d.$$.fragment,e),H=o(e),c=r(e,"P",{"data-svelte-h":!0}),G(c)!=="svelte-13qujnx"&&(c.innerHTML=Y),I=o(e),y(u.$$.fragment,e),L=o(e),m=r(e,"P",{"data-svelte-h":!0}),G(m)!=="svelte-ully00"&&(m.innerHTML=D),U=o(e),f=r(e,"P",{"data-svelte-h":!0}),G(f)!=="svelte-1ukv1cg"&&(f.textContent=F),q=o(e),y(p.$$.fragment,e),S=o(e),y(h.$$.fragment,e),A=o(e),g=r(e,"P",{"data-svelte-h":!0}),G(g)!=="svelte-khzp4z"&&(g.innerHTML=O),E=o(e),w=r(e,"UL",{"data-svelte-h":!0}),G(w)!=="svelte-1jkknr8"&&(w.innerHTML=X),Z=o(e),y($.$$.fragment,e),j=o(e),b=r(e,"P",{}),V(b).forEach(a),this.h()},h(){J(l,"name","hf:doc:metadata"),J(l,"content",le)},m(e,t){ae(document.head,l),i(e,C,t),i(e,_,t),i(e,M,t),x(d,e,t),i(e,H,t),i(e,c,t),i(e,I,t),x(u,e,t),i(e,L,t),i(e,m,t),i(e,U,t),i(e,f,t),i(e,q,t),x(p,e,t),i(e,S,t),x(h,e,t),i(e,A,t),i(e,g,t),i(e,E,t),i(e,w,t),i(e,Z,t),x($,e,t),i(e,j,t),i(e,b,t),z=!0},p:N,i(e){z||(k(d.$$.fragment,e),k(u.$$.fragment,e),k(p.$$.fragment,e),k(h.$$.fragment,e),k($.$$.fragment,e),z=!0)},o(e){P(d.$$.fragment,e),P(u.$$.fragment,e),P(p.$$.fragment,e),P(h.$$.fragment,e),P($.$$.fragment,e),z=!1},d(e){e&&(a(C),a(_),a(M),a(H),a(c),a(I),a(L),a(m),a(U),a(f),a(q),a(S),a(A),a(g),a(E),a(w),a(Z),a(j),a(b)),a(l),T(d,e),T(u,e),T(p,e),T(h,e),T($,e)}}}const le='{"title":"Intel Gaudi","local":"intel-gaudi","sections":[{"title":"How it works out of the box","local":"how-it-works-out-of-the-box","sections":[],"depth":2},{"title":"Limitations","local":"limitations","sections":[],"depth":2}],"depth":1}';function se(W){return K(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class me extends Q{constructor(l){super(),ee(this,l,se,oe,R,{})}}export{me as component};
