import{s as R,n as W,o as D}from"../chunks/scheduler.23542ac5.js";import{S as X,i as Z,e as l,s as r,c as q,h as V,a as m,d as s,b as o,f as Q,g as z,j as g,k as B,l as Y,m as n,n as G,t as O,o as U,p as S}from"../chunks/index.9b1f405b.js";import{C as ee,H as te,E as se}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.ccdc6aab.js";import{C as ne}from"../chunks/CodeBlock.cef191d3.js";function re(I){let i,v,b,C,f,T,p,w,u,J=`추론과 학습 모두에 <a href="https://github.com/facebookresearch/xformers" rel="nofollow">xFormers</a>를 사용하는 것이 좋습니다.
자체 테스트로 어텐션 블록에서 수행된 최적화가 더 빠른 속도와 적은 메모리 소비를 확인했습니다.`,P,c,j="2023년 1월에 출시된 xFormers 버전 ‘0.0.16’부터 사전 빌드된 pip wheel을 사용하여 쉽게 설치할 수 있습니다:",y,h,L,a,A='<p>xFormers PIP 패키지에는 최신 버전의 PyTorch(xFormers 0.0.16에 1.13.1)가 필요합니다. 이전 버전의 PyTorch를 사용해야 하는 경우 <a href="https://github.com/facebookresearch/xformers#installing-xformers" rel="nofollow">프로젝트 지침</a>의 소스를 사용해 xFormers를 설치하는 것이 좋습니다.</p>',M,$,K='xFormers를 설치하면, <a href="fp16#memory-efficient-attention">여기</a>서 설명한 것처럼 ‘enable_xformers_memory_efficient_attention()‘을 사용하여 추론 속도를 높이고 메모리 소비를 줄일 수 있습니다.',H,x,N='<p>[!WARNING][이 이슈](<a href="https://github.com/huggingface/diffusers/issues/2234#issuecomment-1416931212)%EC%97%90" rel="nofollow">https://github.com/huggingface/diffusers/issues/2234#issuecomment-1416931212)에</a> 따르면 xFormers <code>v0.0.16</code>에서 GPU를 사용한 학습(파인 튜닝 또는 Dreambooth)을 할 수 없습니다. 해당 문제가 발견되면. 해당 코멘트를 참고해 development 버전을 설치하세요.</p>',k,_,F,d,E;return f=new ee({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),p=new te({props:{title:"xFormers 설치하기",local:"xformers-설치하기",headingTag:"h1"}}),h=new ne({props:{code:"cGlwJTIwaW5zdGFsbCUyMHhmb3JtZXJz",highlighted:"pip install xformers",wrap:!1}}),_=new se({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/ko/optimization/xformers.md"}}),{c(){i=l("meta"),v=r(),b=l("p"),C=r(),q(f.$$.fragment),T=r(),q(p.$$.fragment),w=r(),u=l("p"),u.innerHTML=J,P=r(),c=l("p"),c.textContent=j,y=r(),q(h.$$.fragment),L=r(),a=l("blockquote"),a.innerHTML=A,M=r(),$=l("p"),$.innerHTML=K,H=r(),x=l("blockquote"),x.innerHTML=N,k=r(),q(_.$$.fragment),F=r(),d=l("p"),this.h()},l(e){const t=V("svelte-u9bgzb",document.head);i=m(t,"META",{name:!0,content:!0}),t.forEach(s),v=o(e),b=m(e,"P",{}),Q(b).forEach(s),C=o(e),z(f.$$.fragment,e),T=o(e),z(p.$$.fragment,e),w=o(e),u=m(e,"P",{"data-svelte-h":!0}),g(u)!=="svelte-82eyhi"&&(u.innerHTML=J),P=o(e),c=m(e,"P",{"data-svelte-h":!0}),g(c)!=="svelte-1tegx9b"&&(c.textContent=j),y=o(e),z(h.$$.fragment,e),L=o(e),a=m(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),g(a)!=="svelte-fdjceu"&&(a.innerHTML=A),M=o(e),$=m(e,"P",{"data-svelte-h":!0}),g($)!=="svelte-1htre74"&&($.innerHTML=K),H=o(e),x=m(e,"BLOCKQUOTE",{"data-svelte-h":!0}),g(x)!=="svelte-144fts9"&&(x.innerHTML=N),k=o(e),z(_.$$.fragment,e),F=o(e),d=m(e,"P",{}),Q(d).forEach(s),this.h()},h(){B(i,"name","hf:doc:metadata"),B(i,"content",oe),B(a,"class","tip")},m(e,t){Y(document.head,i),n(e,v,t),n(e,b,t),n(e,C,t),G(f,e,t),n(e,T,t),G(p,e,t),n(e,w,t),n(e,u,t),n(e,P,t),n(e,c,t),n(e,y,t),G(h,e,t),n(e,L,t),n(e,a,t),n(e,M,t),n(e,$,t),n(e,H,t),n(e,x,t),n(e,k,t),G(_,e,t),n(e,F,t),n(e,d,t),E=!0},p:W,i(e){E||(O(f.$$.fragment,e),O(p.$$.fragment,e),O(h.$$.fragment,e),O(_.$$.fragment,e),E=!0)},o(e){U(f.$$.fragment,e),U(p.$$.fragment,e),U(h.$$.fragment,e),U(_.$$.fragment,e),E=!1},d(e){e&&(s(v),s(b),s(C),s(T),s(w),s(u),s(P),s(c),s(y),s(L),s(a),s(M),s($),s(H),s(x),s(k),s(F),s(d)),s(i),S(f,e),S(p,e),S(h,e),S(_,e)}}}const oe='{"title":"xFormers 설치하기","local":"xformers-설치하기","sections":[],"depth":1}';function ie(I){return D(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class pe extends X{constructor(i){super(),Z(this,i,ie,re,R,{})}}export{pe as component};
