import{s as ie,n as re,o as oe}from"../chunks/scheduler.56730f09.js";import{S as se,i as pe,g as a,s as r,u as j,m as he,A as ce,h as i,f as e,c as o,j as h,v as J,y as c,n as ue,k as s,o as p,a as l,w as R,d as Z,t as W,x as Y}from"../chunks/index.ba464511.js";import{I as lt}from"../chunks/IconCopyLink.89bde88e.js";import{C as fe}from"../chunks/CodeBlock.2302fd0d.js";function ve(Ut){let u,at,Q,it,f,x,D,g,At,F,Ht="CPU에서 효율적인 훈련",rt,b,St="이 가이드는 CPU에서 대규모 모델을 효율적으로 훈련하는 데 초점을 맞춥니다.",ot,v,C,O,y,It,V,Lt="IPEX와 혼합 정밀도",st,E,Nt="IPEX는 AVX-512 이상을 지원하는 CPU에 최적화되어 있으며, AVX2만 지원하는 CPU에도 기능적으로 작동합니다. 따라서 AVX-512 이상의 Intel CPU 세대에서는 성능상 이점이 있을 것으로 예상되지만, AVX2만 지원하는 CPU (예: AMD CPU 또는 오래된 Intel CPU)의 경우에는 IPEX 아래에서 더 나은 성능을 보일 수 있지만 이는 보장되지 않습니다. IPEX는 Float32와 BFloat16를 모두 사용하여 CPU 훈련을 위한 성능 최적화를 제공합니다. BFloat16의 사용은 다음 섹션의 주요 초점입니다.",pt,T,Bt="저정밀도 데이터 타입인 BFloat16은 3세대 Xeon® Scalable 프로세서 (코드명: Cooper Lake)에서 AVX512 명령어 집합을 네이티브로 지원해 왔으며, 다음 세대의 Intel® Xeon® Scalable 프로세서에서 Intel® Advanced Matrix Extensions (Intel® AMX) 명령어 집합을 지원하여 성능을 크게 향상시킬 예정입니다. CPU 백엔드의 자동 혼합 정밀도 기능은 PyTorch-1.10부터 활성화되었습니다. 동시에, Intel® Extension for PyTorch에서 BFloat16에 대한 CPU의 자동 혼합 정밀도 및 연산자의 BFloat16 최적화를 대규모로 활성화하고, PyTorch 마스터 브랜치로 부분적으로 업스트림을 반영했습니다. 사용자들은 IPEX 자동 혼합 정밀도를 사용하여 더 나은 성능과 사용자 경험을 얻을 수 있습니다.",ht,A,Ft='<a href="https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/features/amp.html" rel="nofollow">자동 혼합 정밀도</a>에 대한 자세한 정보를 확인하십시오.',ct,d,P,K,I,Xt,q,Vt="IPEX 설치:",ut,X,qt="IPEX 릴리스는 PyTorch를 따라갑니다. pip를 통해 설치하려면:",ft,k,zt='<thead><tr><th align="center">PyTorch Version</th> <th align="center">IPEX version</th></tr></thead> <tbody><tr><td align="center">1.13</td> <td align="center">1.13.0+cpu</td></tr> <tr><td align="center">1.12</td> <td align="center">1.12.300+cpu</td></tr> <tr><td align="center">1.11</td> <td align="center">1.11.200+cpu</td></tr> <tr><td align="center">1.10</td> <td align="center">1.10.100+cpu</td></tr></tbody>',vt,M,dt,U,Gt='<a href="https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/installation.html" rel="nofollow">IPEX 설치</a>에 대한 더 많은 접근 방법을 확인하십시오.',mt,m,w,tt,H,kt,z,jt="Trainer에서의 사용법",_t,S,Jt='<a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering" rel="nofollow">Transformers 질문-응답</a>의 사용 사례를 살펴보겠습니다.',xt,L,Rt=`<li>CPU에서 BF16 자동 혼합 정밀도를 사용하여 IPEX로 훈련하기:<pre> python run_qa.py \\
--model_name_or_path bert-base-uncased \\
--dataset_name squad \\
--do_train \\
--do_eval \\
--per_device_train_batch_size 12 \\
--learning_rate 3e-5 \\
--num_train_epochs 2 \\
--max_seq_length 384 \\
--doc_stride 128 \\
--output_dir /tmp/debug_squad/ \\
<b>--use_ipex \\</b>
<b>--bf16 --no_cuda</b></pre></li>`,Ct,_,$,et,N,Mt,G,Zt="실습 예시",Pt,B,Wt='블로그: <a href="https://huggingface.co/blog/intel-sapphire-rapids" rel="nofollow">Intel Sapphire Rapids로 PyTorch Transformers 가속화</a>',wt,nt,$t;return g=new lt({}),y=new lt({}),I=new lt({}),M=new fe({props:{code:"cGlwJTIwaW5zdGFsbCUyMGludGVsX2V4dGVuc2lvbl9mb3JfcHl0b3JjaCUzRCUzRCUzQ3ZlcnNpb25fbmFtZSUzRSUyMC1mJTIwaHR0cHMlM0ElMkYlMkZkZXZlbG9wZXIuaW50ZWwuY29tJTJGaXBleC13aGwtc3RhYmxlLWNwdQ==",highlighted:'pip install <span class="hljs-built_in">int</span>el_extension_for_pytorch==&lt;version_name&gt; -f https:<span class="hljs-comment">//developer.intel.com/ipex-whl-stable-cpu</span>',wrap:!1}}),H=new lt({}),N=new lt({}),{c(){u=a("meta"),at=r(),Q=a("p"),it=r(),f=a("h1"),x=a("a"),D=a("span"),j(g.$$.fragment),At=r(),F=a("span"),F.textContent=Ht,rt=r(),b=a("p"),b.textContent=St,ot=r(),v=a("h2"),C=a("a"),O=a("span"),j(y.$$.fragment),It=r(),V=a("span"),V.textContent=Lt,st=r(),E=a("p"),E.textContent=Nt,pt=r(),T=a("p"),T.textContent=Bt,ht=r(),A=a("p"),A.innerHTML=Ft,ct=r(),d=a("h3"),P=a("a"),K=a("span"),j(I.$$.fragment),Xt=r(),q=a("span"),q.textContent=Vt,ut=r(),X=a("p"),X.textContent=qt,ft=r(),k=a("table"),k.innerHTML=zt,vt=r(),j(M.$$.fragment),dt=r(),U=a("p"),U.innerHTML=Gt,mt=r(),m=a("h3"),w=a("a"),tt=a("span"),j(H.$$.fragment),kt=r(),z=a("span"),z.textContent=jt,_t=he("\n\n\nTrainer에서 IPEX의 자동 혼합 정밀도를 활성화하려면 사용자는 훈련 명령 인수에 `use_ipex`, `bf16`, `no_cuda`를 추가해야 합니다.\n"),S=a("p"),S.innerHTML=Jt,xt=r(),L=a("ul"),L.innerHTML=Rt,Ct=r(),_=a("h3"),$=a("a"),et=a("span"),j(N.$$.fragment),Mt=r(),G=a("span"),G.textContent=Zt,Pt=r(),B=a("p"),B.innerHTML=Wt,wt=r(),nt=a("p"),this.h()},l(t){const n=ce("svelte-1phssyn",document.head);u=i(n,"META",{name:!0,content:!0}),n.forEach(e),at=o(t),Q=i(t,"P",{}),h(Q).forEach(e),it=o(t),f=i(t,"H1",{class:!0});var gt=h(f);x=i(gt,"A",{id:!0,class:!0,href:!0});var Yt=h(x);D=i(Yt,"SPAN",{});var Qt=h(D);J(g.$$.fragment,Qt),Qt.forEach(e),Yt.forEach(e),At=o(gt),F=i(gt,"SPAN",{"data-svelte-h":!0}),c(F)!=="svelte-13v384"&&(F.textContent=Ht),gt.forEach(e),rt=o(t),b=i(t,"P",{"data-svelte-h":!0}),c(b)!=="svelte-1hdugqm"&&(b.textContent=St),ot=o(t),v=i(t,"H2",{class:!0});var bt=h(v);C=i(bt,"A",{id:!0,class:!0,href:!0});var Dt=h(C);O=i(Dt,"SPAN",{});var Ot=h(O);J(y.$$.fragment,Ot),Ot.forEach(e),Dt.forEach(e),It=o(bt),V=i(bt,"SPAN",{"data-svelte-h":!0}),c(V)!=="svelte-13p2lvf"&&(V.textContent=Lt),bt.forEach(e),st=o(t),E=i(t,"P",{"data-svelte-h":!0}),c(E)!=="svelte-40eybl"&&(E.textContent=Nt),pt=o(t),T=i(t,"P",{"data-svelte-h":!0}),c(T)!=="svelte-pijyqv"&&(T.textContent=Bt),ht=o(t),A=i(t,"P",{"data-svelte-h":!0}),c(A)!=="svelte-nnpzlr"&&(A.innerHTML=Ft),ct=o(t),d=i(t,"H3",{class:!0});var yt=h(d);P=i(yt,"A",{id:!0,class:!0,href:!0});var Kt=h(P);K=i(Kt,"SPAN",{});var te=h(K);J(I.$$.fragment,te),te.forEach(e),Kt.forEach(e),Xt=o(yt),q=i(yt,"SPAN",{"data-svelte-h":!0}),c(q)!=="svelte-fb7ufp"&&(q.textContent=Vt),yt.forEach(e),ut=o(t),X=i(t,"P",{"data-svelte-h":!0}),c(X)!=="svelte-armibm"&&(X.textContent=qt),ft=o(t),k=i(t,"TABLE",{"data-svelte-h":!0}),c(k)!=="svelte-okkx16"&&(k.innerHTML=zt),vt=o(t),J(M.$$.fragment,t),dt=o(t),U=i(t,"P",{"data-svelte-h":!0}),c(U)!=="svelte-ipbj1s"&&(U.innerHTML=Gt),mt=o(t),m=i(t,"H3",{class:!0});var Et=h(m);w=i(Et,"A",{id:!0,class:!0,href:!0});var ee=h(w);tt=i(ee,"SPAN",{});var ne=h(tt);J(H.$$.fragment,ne),ne.forEach(e),ee.forEach(e),kt=o(Et),z=i(Et,"SPAN",{"data-svelte-h":!0}),c(z)!=="svelte-1o73ln8"&&(z.textContent=jt),Et.forEach(e),_t=ue(t,"\n\n\nTrainer에서 IPEX의 자동 혼합 정밀도를 활성화하려면 사용자는 훈련 명령 인수에 `use_ipex`, `bf16`, `no_cuda`를 추가해야 합니다.\n"),S=i(t,"P",{"data-svelte-h":!0}),c(S)!=="svelte-152wvr6"&&(S.innerHTML=Jt),xt=o(t),L=i(t,"UL",{"data-svelte-h":!0}),c(L)!=="svelte-1yo4w7a"&&(L.innerHTML=Rt),Ct=o(t),_=i(t,"H3",{class:!0});var Tt=h(_);$=i(Tt,"A",{id:!0,class:!0,href:!0});var le=h($);et=i(le,"SPAN",{});var ae=h(et);J(N.$$.fragment,ae),ae.forEach(e),le.forEach(e),Mt=o(Tt),G=i(Tt,"SPAN",{"data-svelte-h":!0}),c(G)!=="svelte-17jziiw"&&(G.textContent=Zt),Tt.forEach(e),Pt=o(t),B=i(t,"P",{"data-svelte-h":!0}),c(B)!=="svelte-51a2ou"&&(B.innerHTML=Wt),wt=o(t),nt=i(t,"P",{}),h(nt).forEach(e),this.h()},h(){s(u,"name","hf:doc:metadata"),s(u,"content",JSON.stringify(de)),s(x,"id","efficient-training-on-cpu"),s(x,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(x,"href","#efficient-training-on-cpu"),s(f,"class","relative group"),s(C,"id","mixed-precision-with-ipex"),s(C,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(C,"href","#mixed-precision-with-ipex"),s(v,"class","relative group"),s(P,"id","ipex-installation"),s(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(P,"href","#ipex-installation"),s(d,"class","relative group"),s(w,"id","usage-in-trainer"),s(w,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s(w,"href","#usage-in-trainer"),s(m,"class","relative group"),s($,"id","practice-example"),s($,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),s($,"href","#practice-example"),s(_,"class","relative group")},m(t,n){p(document.head,u),l(t,at,n),l(t,Q,n),l(t,it,n),l(t,f,n),p(f,x),p(x,D),R(g,D,null),p(f,At),p(f,F),l(t,rt,n),l(t,b,n),l(t,ot,n),l(t,v,n),p(v,C),p(C,O),R(y,O,null),p(v,It),p(v,V),l(t,st,n),l(t,E,n),l(t,pt,n),l(t,T,n),l(t,ht,n),l(t,A,n),l(t,ct,n),l(t,d,n),p(d,P),p(P,K),R(I,K,null),p(d,Xt),p(d,q),l(t,ut,n),l(t,X,n),l(t,ft,n),l(t,k,n),l(t,vt,n),R(M,t,n),l(t,dt,n),l(t,U,n),l(t,mt,n),l(t,m,n),p(m,w),p(w,tt),R(H,tt,null),p(m,kt),p(m,z),l(t,_t,n),l(t,S,n),l(t,xt,n),l(t,L,n),l(t,Ct,n),l(t,_,n),p(_,$),p($,et),R(N,et,null),p(_,Mt),p(_,G),l(t,Pt,n),l(t,B,n),l(t,wt,n),l(t,nt,n),$t=!0},p:re,i(t){$t||(Z(g.$$.fragment,t),Z(y.$$.fragment,t),Z(I.$$.fragment,t),Z(M.$$.fragment,t),Z(H.$$.fragment,t),Z(N.$$.fragment,t),$t=!0)},o(t){W(g.$$.fragment,t),W(y.$$.fragment,t),W(I.$$.fragment,t),W(M.$$.fragment,t),W(H.$$.fragment,t),W(N.$$.fragment,t),$t=!1},d(t){t&&(e(at),e(Q),e(it),e(f),e(rt),e(b),e(ot),e(v),e(st),e(E),e(pt),e(T),e(ht),e(A),e(ct),e(d),e(ut),e(X),e(ft),e(k),e(vt),e(dt),e(U),e(mt),e(m),e(_t),e(S),e(xt),e(L),e(Ct),e(_),e(Pt),e(B),e(wt),e(nt)),e(u),Y(g),Y(y),Y(I),Y(M,t),Y(H),Y(N)}}}const de={local:"efficient-training-on-cpu",sections:[{local:"mixed-precision-with-ipex",sections:[{local:"ipex-installation",title:"IPEX 설치: "},{local:"usage-in-trainer",title:"Trainer에서의 사용법 "},{local:"practice-example",title:"실습 예시 "}],title:"IPEX와 혼합 정밀도 "}],title:"CPU에서 효율적인 훈련 "};function me(Ut){return oe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class we extends se{constructor(u){super(),pe(this,u,me,ve,ie,{})}}export{we as component};
