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