import{s as A,n as Y,o as W}from"../chunks/scheduler.e4ff9b64.js";import{S,i as D,e as d,s as n,c as x,h as F,a as T,d as l,b as i,f as z,g as I,j as P,k as O,l as X,m as a,n as J,t as v,o as E,p as H}from"../chunks/index.09f1bca0.js";import{C as V,H as N,E as K}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.b71282d6.js";import{C as tt}from"../chunks/CodeBlock.c52051fd.js";function et(Z){let s,b,g,U,p,G,r,$,u,L='Intel Gaudi AI 加速器系列包括 <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> 和 <a href="https://habana.ai/products/gaudi3/" rel="nofollow">Intel Gaudi 3</a>。每台服务器配备 8 个设备，称为 Habana 处理单元 (HPU)，在 Gaudi 3 上提供 128GB 内存，在 Gaudi 2 上提供 96GB 内存，在第一代 Gaudi 上提供 32GB 内存。有关底层硬件架构的更多详细信息，请查看 <a href="https://docs.habana.ai/en/latest/Gaudi_Overview/Gaudi_Architecture.html" rel="nofollow">Gaudi 架构</a> 概述。',w,m,B='Diffusers 管道可以利用 HPU 加速，即使管道尚未添加到 <a href="https://huggingface.co/docs/optimum/main/en/habana/index" rel="nofollow">Optimum for Intel Gaudi</a>，也可以通过 <a href="https://docs.habana.ai/en/latest/PyTorch/PyTorch_Model_Porting/GPU_Migration_Toolkit/GPU_Migration_Toolkit.html" rel="nofollow">GPU 迁移工具包</a> 实现。',_,f,C="在您的管道上调用 <code>.to(&quot;hpu&quot;)</code> 以将其移动到 HPU 设备，如下所示为 Flux 示例：",Q,c,y,o,q='<p>对于 Gaudi 优化的扩散管道实现，我们推荐使用 <a href="https://huggingface.co/docs/optimum/main/en/habana/index" rel="nofollow">Optimum for Intel Gaudi</a>。</p>',j,h,k,M,R;return p=new V({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),r=new N({props:{title:"Intel Gaudi",local:"intel-gaudi",headingTag:"h1"}}),c=new tt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzJTIwaW1wb3J0JTIwRGlmZnVzaW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMERpZmZ1c2lvblBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMjJibGFjay1mb3Jlc3QtbGFicyUyRkZMVVguMS1zY2huZWxsJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEFwaXBlbGluZS50byglMjJocHUlMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBwaXBlbGluZSglMjIlRTQlQjglODAlRTUlQkMlQTAlRTYlOUQlQkUlRTklQkMlQTAlRTUlOUMlQTglRTYlQUYlOTUlRTUlOEElQTAlRTclQjQlQTIlRTklQTMlOEUlRTYlQTAlQkMlRTQlQjglQUQlRTclOUElODQlRTUlOUIlQkUlRTUlODMlOEYlMjIpLmltYWdlcyU1QjAlNUQ=",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;一张松鼠在毕加索风格中的图像&quot;</span>).images[<span class="hljs-number">0</span>]`,wrap:!1}}),h=new K({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/zh/optimization/habana.md"}}),{c(){s=d("meta"),b=n(),g=d("p"),U=n(),x(p.$$.fragment),G=n(),x(r.$$.fragment),$=n(),u=d("p"),u.innerHTML=L,w=n(),m=d("p"),m.innerHTML=B,_=n(),f=d("p"),f.innerHTML=C,Q=n(),x(c.$$.fragment),y=n(),o=d("blockquote"),o.innerHTML=q,j=n(),x(h.$$.fragment),k=n(),M=d("p"),this.h()},l(t){const e=F("svelte-u9bgzb",document.head);s=T(e,"META",{name:!0,content:!0}),e.forEach(l),b=i(t),g=T(t,"P",{}),z(g).forEach(l),U=i(t),I(p.$$.fragment,t),G=i(t),I(r.$$.fragment,t),$=i(t),u=T(t,"P",{"data-svelte-h":!0}),P(u)!=="svelte-mh5zja"&&(u.innerHTML=L),w=i(t),m=T(t,"P",{"data-svelte-h":!0}),P(m)!=="svelte-7cd3xk"&&(m.innerHTML=B),_=i(t),f=T(t,"P",{"data-svelte-h":!0}),P(f)!=="svelte-1vh47tk"&&(f.innerHTML=C),Q=i(t),I(c.$$.fragment,t),y=i(t),o=T(t,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),P(o)!=="svelte-c1zwav"&&(o.innerHTML=q),j=i(t),I(h.$$.fragment,t),k=i(t),M=T(t,"P",{}),z(M).forEach(l),this.h()},h(){O(s,"name","hf:doc:metadata"),O(s,"content",lt),O(o,"class","tip")},m(t,e){X(document.head,s),a(t,b,e),a(t,g,e),a(t,U,e),J(p,t,e),a(t,G,e),J(r,t,e),a(t,$,e),a(t,u,e),a(t,w,e),a(t,m,e),a(t,_,e),a(t,f,e),a(t,Q,e),J(c,t,e),a(t,y,e),a(t,o,e),a(t,j,e),J(h,t,e),a(t,k,e),a(t,M,e),R=!0},p:Y,i(t){R||(v(p.$$.fragment,t),v(r.$$.fragment,t),v(c.$$.fragment,t),v(h.$$.fragment,t),R=!0)},o(t){E(p.$$.fragment,t),E(r.$$.fragment,t),E(c.$$.fragment,t),E(h.$$.fragment,t),R=!1},d(t){t&&(l(b),l(g),l(U),l(G),l($),l(u),l(w),l(m),l(_),l(f),l(Q),l(y),l(o),l(j),l(k),l(M)),l(s),H(p,t),H(r,t),H(c,t),H(h,t)}}}const lt='{"title":"Intel Gaudi","local":"intel-gaudi","sections":[],"depth":1}';function at(Z){return W(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pt extends S{constructor(s){super(),D(this,s,at,et,A,{})}}export{pt as component};
