import{s as W,o as A,n as R}from"../chunks/scheduler.8c3d61f6.js";import{S,i as V,g,s,r as j,A as X,h as w,f as a,c as o,j as z,u as Z,x,k as L,y as Y,a as i,v as H,d as B,t as I,w as k}from"../chunks/index.da70eac4.js";import{T as D}from"../chunks/Tip.1d9b8c37.js";import{C as O}from"../chunks/CodeBlock.a9c4becf.js";import{H as Q,E as N}from"../chunks/index.ef90fe87.js";function K(M){let n,p='For Gaudi-optimized diffusion pipeline implementations, we recommend using <a href="https://huggingface.co/docs/optimum/main/en/habana/index" rel="nofollow">Optimum for Intel Gaudi</a>.';return{c(){n=g("p"),n.innerHTML=p},l(l){n=w(l,"P",{"data-svelte-h":!0}),x(n)!=="svelte-56x4as"&&(n.innerHTML=p)},m(l,$){i(l,n,$)},p:R,d(l){l&&a(n)}}}function ee(M){let n,p,l,$,u,G,m,C='The Intel Gaudi AI accelerator family includes <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</a> overview.',_,f,E='Diffusers pipelines can take advantage of HPU acceleration, even if a pipeline hasn’t been added to <a href="https://huggingface.co/docs/optimum/main/en/habana/index" rel="nofollow">Optimum for Intel Gaudi</a> yet, with the <a href="https://docs.habana.ai/en/latest/PyTorch/PyTorch_Model_Porting/GPU_Migration_Toolkit/GPU_Migration_Toolkit.html" rel="nofollow">GPU Migration Toolkit</a>.',T,c,F="Call <code>.to(&quot;hpu&quot;)</code> on your pipeline to move it to a HPU device as shown below for Flux:",y,d,v,r,J,h,P,b,U;return u=new Q({props:{title:"Intel Gaudi",local:"intel-gaudi",headingTag:"h1"}}),d=new O({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJibGFjay1mb3Jlc3QtbGFicyUyRkZMVVguMS1zY2huZWxsJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEFwaXBlbGluZS50byglMjJocHUlMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZSglMjJBbiUyMGltYWdlJTIwb2YlMjBhJTIwc3F1aXJyZWwlMjBpbiUyMFBpY2Fzc28lMjBzdHlsZSUyMikuaW1hZ2VzJTVCMCU1RA==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers <span class="hljs-keyword">import</span> DiffusionPipeline

pipeline = DiffusionPipeline.from_pretrained(<span class="hljs-string">&quot;black-forest-labs/FLUX.1-schnell&quot;</span>, torch_dtype=torch.bfloat16)
pipeline.to(<span class="hljs-string">&quot;hpu&quot;</span>)

image = pipeline(<span class="hljs-string">&quot;An image of a squirrel in Picasso style&quot;</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),r=new D({props:{warning:!1,$$slots:{default:[K]},$$scope:{ctx:M}}}),h=new N({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/optimization/habana.md"}}),{c(){n=g("meta"),p=s(),l=g("p"),$=s(),j(u.$$.fragment),G=s(),m=g("p"),m.innerHTML=C,_=s(),f=g("p"),f.innerHTML=E,T=s(),c=g("p"),c.innerHTML=F,y=s(),j(d.$$.fragment),v=s(),j(r.$$.fragment),J=s(),j(h.$$.fragment),P=s(),b=g("p"),this.h()},l(e){const t=X("svelte-u9bgzb",document.head);n=w(t,"META",{name:!0,content:!0}),t.forEach(a),p=o(e),l=w(e,"P",{}),z(l).forEach(a),$=o(e),Z(u.$$.fragment,e),G=o(e),m=w(e,"P",{"data-svelte-h":!0}),x(m)!=="svelte-17co6sl"&&(m.innerHTML=C),_=o(e),f=w(e,"P",{"data-svelte-h":!0}),x(f)!=="svelte-11utcp"&&(f.innerHTML=E),T=o(e),c=w(e,"P",{"data-svelte-h":!0}),x(c)!=="svelte-ejjfs6"&&(c.innerHTML=F),y=o(e),Z(d.$$.fragment,e),v=o(e),Z(r.$$.fragment,e),J=o(e),Z(h.$$.fragment,e),P=o(e),b=w(e,"P",{}),z(b).forEach(a),this.h()},h(){L(n,"name","hf:doc:metadata"),L(n,"content",te)},m(e,t){Y(document.head,n),i(e,p,t),i(e,l,t),i(e,$,t),H(u,e,t),i(e,G,t),i(e,m,t),i(e,_,t),i(e,f,t),i(e,T,t),i(e,c,t),i(e,y,t),H(d,e,t),i(e,v,t),H(r,e,t),i(e,J,t),H(h,e,t),i(e,P,t),i(e,b,t),U=!0},p(e,[t]){const q={};t&2&&(q.$$scope={dirty:t,ctx:e}),r.$set(q)},i(e){U||(B(u.$$.fragment,e),B(d.$$.fragment,e),B(r.$$.fragment,e),B(h.$$.fragment,e),U=!0)},o(e){I(u.$$.fragment,e),I(d.$$.fragment,e),I(r.$$.fragment,e),I(h.$$.fragment,e),U=!1},d(e){e&&(a(p),a(l),a($),a(G),a(m),a(_),a(f),a(T),a(c),a(y),a(v),a(J),a(P),a(b)),a(n),k(u,e),k(d,e),k(r,e),k(h,e)}}}const te='{"title":"Intel Gaudi","local":"intel-gaudi","sections":[],"depth":1}';function ae(M){return A(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class re extends S{constructor(n){super(),V(this,n,ae,ee,W,{})}}export{re as component};
