Buckets:

rtrm's picture
download
raw
8.52 kB
import{s as xt,n as Pt,o as gt}from"../chunks/scheduler.9bc65507.js";import{S as Ct,i as bt,g as r,s as l,r as X,A as Tt,h as s,f as n,c as a,j as $t,u as I,x as p,k as _t,y as vt,a as i,v as y,d as U,t as H,w as L}from"../chunks/index.707bf1b6.js";import{C as wt}from"../chunks/CodeBlock.54a9f38d.js";import{H as z,E as Mt}from"../chunks/EditOnGithub.922df6ba.js";function Et(lt){let o,B,A,F,m,G,f,at="このガイドは、CPU上で大規模なモデルを効率的にトレーニングする方法に焦点を当てています。",V,c,S,u,rt="IPEXはAVX-512以上のCPUに最適化されており、AVX2のみのCPUでも機能的に動作します。そのため、AVX-512以上のIntel CPU世代ではパフォーマンスの向上が期待されますが、AVX2のみのCPU(例:AMD CPUまたは古いIntel CPU)ではIPEXの下でより良いパフォーマンスが得られるかもしれませんが、保証されません。IPEXは、Float32とBFloat16の両方でCPUトレーニングのパフォーマンスを最適化します。以下のセクションでは、BFloat16の使用に重点を置いて説明します。",q,d,st="低精度データ型であるBFloat16は、AVX512命令セットを備えた第3世代Xeon® Scalable Processors(別名Cooper Lake)でネイティブサポートされており、さらに高性能なIntel® Advanced Matrix Extensions(Intel® AMX)命令セットを備えた次世代のIntel® Xeon® Scalable Processorsでもサポートされます。CPUバックエンド用の自動混合精度がPyTorch-1.10以降で有効になっています。同時に、Intel® Extension for PyTorchでのCPU用BFloat16の自動混合精度サポートと、オペレーターのBFloat16最適化のサポートが大幅に向上し、一部がPyTorchのメインブランチにアップストリームされています。ユーザーはIPEX Auto Mixed Precisionを使用することで、より優れたパフォーマンスとユーザーエクスペリエンスを得ることができます。",R,h,pt='詳細な情報については、<a href="https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/features/amp.html" rel="nofollow">Auto Mixed Precision</a>を確認してください。',Z,$,j,_,ot="IPEXのリリースはPyTorchに従っており、pipを使用してインストールできます:",J,x,mt='<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>',W,P,Y,g,ft='<a href="https://intel.github.io/intel-extension-for-pytorch/cpu/latest/tutorials/installation.html" rel="nofollow">IPEXのインストール方法</a>について、さらなるアプローチを確認してください。',N,C,Q,b,ct="TrainerでIPEXの自動混合精度を有効にするには、ユーザーはトレーニングコマンド引数に <code>use_ipex</code>、<code>bf16</code>、および <code>no_cuda</code> を追加する必要があります。",D,T,ut='<a href="https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering" rel="nofollow">Transformersの質問応答</a>のユースケースを例に説明します。',O,v,dt=`<li>CPU上でBF16自動混合精度を使用してIPEXでトレーニングを行う場合:<pre> python run_qa.py \\
--model_name_or_path google-bert/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>`,K,w,tt,M,ht='Blog: <a href="https://huggingface.co/blog/intel-sapphire-rapids" rel="nofollow">Accelerating PyTorch Transformers with Intel Sapphire Rapids</a>',et,E,nt,k,it;return m=new z({props:{title:"Efficient Training on CPU",local:"efficient-training-on-cpu",headingTag:"h1"}}),c=new z({props:{title:"Mixed precision with IPEX",local:"mixed-precision-with-ipex",headingTag:"h2"}}),$=new z({props:{title:"IPEX installation:",local:"ipex-installation",headingTag:"h3"}}),P=new wt({props:{code:"cGlwJTIwaW5zdGFsbCUyMGludGVsX2V4dGVuc2lvbl9mb3JfcHl0b3JjaCUzRCUzRCUzQ3ZlcnNpb25fbmFtZSUzRSUyMC1mJTIwaHR0cHMlM0ElMkYlMkZkZXZlbG9wZXIuaW50ZWwuY29tJTJGaXBleC13aGwtc3RhYmxlLWNwdQ==",highlighted:"pip install intel_extension_for_pytorch==&lt;version_name&gt; -f https://developer.intel.com/ipex-whl-stable-cpu",wrap:!1}}),C=new z({props:{title:"Trainerでの使用方法",local:"trainerでの使用方法",headingTag:"h3"}}),w=new z({props:{title:"Practice example",local:"practice-example",headingTag:"h3"}}),E=new Mt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ja/perf_train_cpu.md"}}),{c(){o=r("meta"),B=l(),A=r("p"),F=l(),X(m.$$.fragment),G=l(),f=r("p"),f.textContent=at,V=l(),X(c.$$.fragment),S=l(),u=r("p"),u.textContent=rt,q=l(),d=r("p"),d.textContent=st,R=l(),h=r("p"),h.innerHTML=pt,Z=l(),X($.$$.fragment),j=l(),_=r("p"),_.textContent=ot,J=l(),x=r("table"),x.innerHTML=mt,W=l(),X(P.$$.fragment),Y=l(),g=r("p"),g.innerHTML=ft,N=l(),X(C.$$.fragment),Q=l(),b=r("p"),b.innerHTML=ct,D=l(),T=r("p"),T.innerHTML=ut,O=l(),v=r("ul"),v.innerHTML=dt,K=l(),X(w.$$.fragment),tt=l(),M=r("p"),M.innerHTML=ht,et=l(),X(E.$$.fragment),nt=l(),k=r("p"),this.h()},l(t){const e=Tt("svelte-u9bgzb",document.head);o=s(e,"META",{name:!0,content:!0}),e.forEach(n),B=a(t),A=s(t,"P",{}),$t(A).forEach(n),F=a(t),I(m.$$.fragment,t),G=a(t),f=s(t,"P",{"data-svelte-h":!0}),p(f)!=="svelte-11xh6oz"&&(f.textContent=at),V=a(t),I(c.$$.fragment,t),S=a(t),u=s(t,"P",{"data-svelte-h":!0}),p(u)!=="svelte-hle050"&&(u.textContent=rt),q=a(t),d=s(t,"P",{"data-svelte-h":!0}),p(d)!=="svelte-uvmlso"&&(d.textContent=st),R=a(t),h=s(t,"P",{"data-svelte-h":!0}),p(h)!=="svelte-1xnbmj5"&&(h.innerHTML=pt),Z=a(t),I($.$$.fragment,t),j=a(t),_=s(t,"P",{"data-svelte-h":!0}),p(_)!=="svelte-1qi2p9c"&&(_.textContent=ot),J=a(t),x=s(t,"TABLE",{"data-svelte-h":!0}),p(x)!=="svelte-okkx16"&&(x.innerHTML=mt),W=a(t),I(P.$$.fragment,t),Y=a(t),g=s(t,"P",{"data-svelte-h":!0}),p(g)!=="svelte-1xti9kg"&&(g.innerHTML=ft),N=a(t),I(C.$$.fragment,t),Q=a(t),b=s(t,"P",{"data-svelte-h":!0}),p(b)!=="svelte-1szp3tw"&&(b.innerHTML=ct),D=a(t),T=s(t,"P",{"data-svelte-h":!0}),p(T)!=="svelte-yud8x"&&(T.innerHTML=ut),O=a(t),v=s(t,"UL",{"data-svelte-h":!0}),p(v)!=="svelte-jovvsy"&&(v.innerHTML=dt),K=a(t),I(w.$$.fragment,t),tt=a(t),M=s(t,"P",{"data-svelte-h":!0}),p(M)!=="svelte-w7zs5j"&&(M.innerHTML=ht),et=a(t),I(E.$$.fragment,t),nt=a(t),k=s(t,"P",{}),$t(k).forEach(n),this.h()},h(){_t(o,"name","hf:doc:metadata"),_t(o,"content",Xt)},m(t,e){vt(document.head,o),i(t,B,e),i(t,A,e),i(t,F,e),y(m,t,e),i(t,G,e),i(t,f,e),i(t,V,e),y(c,t,e),i(t,S,e),i(t,u,e),i(t,q,e),i(t,d,e),i(t,R,e),i(t,h,e),i(t,Z,e),y($,t,e),i(t,j,e),i(t,_,e),i(t,J,e),i(t,x,e),i(t,W,e),y(P,t,e),i(t,Y,e),i(t,g,e),i(t,N,e),y(C,t,e),i(t,Q,e),i(t,b,e),i(t,D,e),i(t,T,e),i(t,O,e),i(t,v,e),i(t,K,e),y(w,t,e),i(t,tt,e),i(t,M,e),i(t,et,e),y(E,t,e),i(t,nt,e),i(t,k,e),it=!0},p:Pt,i(t){it||(U(m.$$.fragment,t),U(c.$$.fragment,t),U($.$$.fragment,t),U(P.$$.fragment,t),U(C.$$.fragment,t),U(w.$$.fragment,t),U(E.$$.fragment,t),it=!0)},o(t){H(m.$$.fragment,t),H(c.$$.fragment,t),H($.$$.fragment,t),H(P.$$.fragment,t),H(C.$$.fragment,t),H(w.$$.fragment,t),H(E.$$.fragment,t),it=!1},d(t){t&&(n(B),n(A),n(F),n(G),n(f),n(V),n(S),n(u),n(q),n(d),n(R),n(h),n(Z),n(j),n(_),n(J),n(x),n(W),n(Y),n(g),n(N),n(Q),n(b),n(D),n(T),n(O),n(v),n(K),n(tt),n(M),n(et),n(nt),n(k)),n(o),L(m,t),L(c,t),L($,t),L(P,t),L(C,t),L(w,t),L(E,t)}}}const Xt='{"title":"Efficient Training on CPU","local":"efficient-training-on-cpu","sections":[{"title":"Mixed precision with IPEX","local":"mixed-precision-with-ipex","sections":[{"title":"IPEX installation:","local":"ipex-installation","sections":[],"depth":3},{"title":"Trainerでの使用方法","local":"trainerでの使用方法","sections":[],"depth":3},{"title":"Practice example","local":"practice-example","sections":[],"depth":3}],"depth":2}],"depth":1}';function It(lt){return gt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class At extends Ct{constructor(o){super(),bt(this,o,It,Et,xt,{})}}export{At as component};

Xet Storage Details

Size:
8.52 kB
·
Xet hash:
eb439685b561f496a7a41c6c67cceee6ab6625efbcc77a3110af1ab012f04cdc

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.