import{s as K,n as Q,o as ee}from"../chunks/scheduler.b9285784.js";import{S as te,i as ae,e as r,s as n,c as _,h as ie,a as s,d as a,b as l,f as R,g as v,j as M,k as N,l as ne,m as i,n as x,t as y,o as G,p as k}from"../chunks/index.26bc89a1.js";import{C as le,H as Y,E as oe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.f2e029e4.js";import{C as re}from"../chunks/CodeBlock.191169df.js";function se(D){let o,P,T,H,d,I,u,L,m,F=`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>.`,S,c,U,f,O=`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.`,q,p,X="You can directly run the following script to test it out on Intel Gaudi:",z,h,E,g,Z,$,V='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>:',j,w,J="<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>",A,b,B,C,W;return d=new le({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),u=new Y({props:{title:"Intel Gaudi",local:"intel-gaudi",headingTag:"h1"}}),c=new Y({props:{title:"How it works out of the box",local:"how-it-works-out-of-the-box",headingTag:"h2"}}),h=new re({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMCUyRmV4YW1wbGVzJTJGY3ZfZXhhbXBsZS5weSUyMC0tZGF0YV9kaXIlMjBpbWFnZXM=",highlighted:"accelerate launch /examples/cv_example.py --data_dir images",wrap:!1}}),g=new Y({props:{title:"Limitations",local:"limitations",headingTag:"h2"}}),b=new oe({props:{source:"https://github.com/huggingface/accelerate/blob/main/docs/source/usage_guides/gaudi.md"}}),{c(){o=r("meta"),P=n(),T=r("p"),H=n(),_(d.$$.fragment),I=n(),_(u.$$.fragment),L=n(),m=r("p"),m.innerHTML=F,S=n(),_(c.$$.fragment),U=n(),f=r("p"),f.innerHTML=O,q=n(),p=r("p"),p.textContent=X,z=n(),_(h.$$.fragment),E=n(),_(g.$$.fragment),Z=n(),$=r("p"),$.innerHTML=V,j=n(),w=r("ul"),w.innerHTML=J,A=n(),_(b.$$.fragment),B=n(),C=r("p"),this.h()},l(e){const t=ie("svelte-u9bgzb",document.head);o=s(t,"META",{name:!0,content:!0}),t.forEach(a),P=l(e),T=s(e,"P",{}),R(T).forEach(a),H=l(e),v(d.$$.fragment,e),I=l(e),v(u.$$.fragment,e),L=l(e),m=s(e,"P",{"data-svelte-h":!0}),M(m)!=="svelte-13qujnx"&&(m.innerHTML=F),S=l(e),v(c.$$.fragment,e),U=l(e),f=s(e,"P",{"data-svelte-h":!0}),M(f)!=="svelte-ully00"&&(f.innerHTML=O),q=l(e),p=s(e,"P",{"data-svelte-h":!0}),M(p)!=="svelte-1ukv1cg"&&(p.textContent=X),z=l(e),v(h.$$.fragment,e),E=l(e),v(g.$$.fragment,e),Z=l(e),$=s(e,"P",{"data-svelte-h":!0}),M($)!=="svelte-khzp4z"&&($.innerHTML=V),j=l(e),w=s(e,"UL",{"data-svelte-h":!0}),M(w)!=="svelte-1jkknr8"&&(w.innerHTML=J),A=l(e),v(b.$$.fragment,e),B=l(e),C=s(e,"P",{}),R(C).forEach(a),this.h()},h(){N(o,"name","hf:doc:metadata"),N(o,"content",de)},m(e,t){ne(document.head,o),i(e,P,t),i(e,T,t),i(e,H,t),x(d,e,t),i(e,I,t),x(u,e,t),i(e,L,t),i(e,m,t),i(e,S,t),x(c,e,t),i(e,U,t),i(e,f,t),i(e,q,t),i(e,p,t),i(e,z,t),x(h,e,t),i(e,E,t),x(g,e,t),i(e,Z,t),i(e,$,t),i(e,j,t),i(e,w,t),i(e,A,t),x(b,e,t),i(e,B,t),i(e,C,t),W=!0},p:Q,i(e){W||(y(d.$$.fragment,e),y(u.$$.fragment,e),y(c.$$.fragment,e),y(h.$$.fragment,e),y(g.$$.fragment,e),y(b.$$.fragment,e),W=!0)},o(e){G(d.$$.fragment,e),G(u.$$.fragment,e),G(c.$$.fragment,e),G(h.$$.fragment,e),G(g.$$.fragment,e),G(b.$$.fragment,e),W=!1},d(e){e&&(a(P),a(T),a(H),a(I),a(L),a(m),a(S),a(U),a(f),a(q),a(p),a(z),a(E),a(Z),a($),a(j),a(w),a(A),a(B),a(C)),a(o),k(d,e),k(u,e),k(c,e),k(h,e),k(g,e),k(b,e)}}}const de='{"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 ue(D){return ee(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class he extends te{constructor(o){super(),ae(this,o,ue,se,K,{})}}export{he as component};
