import{S as ll,i as al,s as sl,e as o,k as p,w as $,t as l,M as pl,c as n,d as r,m as c,a as i,x as y,h as a,b as s,G as t,g as f,y as T,q as C,o as w,B as z,v as cl}from"../chunks/vendor-hf-doc-builder.js";import{T as dl}from"../chunks/Tip-hf-doc-builder.js";import{I as ut}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as _t}from"../chunks/CodeBlock-hf-doc-builder.js";function fl(Ot){let u,K;return{c(){u=o("p"),K=l(`oneccl_bindings_for_pytorch 1.12.0 prebuilt wheel does not work with PyTorch 1.12.1 (it is for PyTorch 1.12.0)
PyTorch 1.12.1 should work with oneccl_bindings_for_pytorch 1.12.100`)},l(_){u=n(_,"P",{});var x=i(u);K=a(x,`oneccl_bindings_for_pytorch 1.12.0 prebuilt wheel does not work with PyTorch 1.12.1 (it is for PyTorch 1.12.0)
PyTorch 1.12.1 should work with oneccl_bindings_for_pytorch 1.12.100`),x.forEach(r)},m(_,x){f(_,u,x),t(u,K)},d(_){_&&r(u)}}}function ul(Ot){let u,K,_,x,ht,re,zr,mt,Dr,St,$e,Ir,Ht,O,Q,vt,oe,Ar,gt,kr,Bt,U,ne,Lr,Rr,ie,Ur,Nr,le,qr,Mr,Xt,N,Or,Et,Sr,Hr,bt,Br,Xr,Kt,W,Kr,ae,Qr,Wr,Qt,S,G,xt,se,Gr,Pt,jr,Wt,ye,Fr,Gt,j,$t,h,Te,Vr,Jr,Ce,Yr,Zr,we,eo,to,ze,ro,oo,De,no,io,Ie,lo,ao,P,m,Ae,so,po,yt,co,ke,fo,uo,Le,_o,ho,Re,mo,vo,Ue,go,Eo,v,Ne,bo,xo,Tt,Po,qe,$o,yo,Me,To,Co,Oe,wo,zo,Se,Do,Io,g,He,Ao,ko,Ct,Lo,Be,Ro,Uo,Xe,No,qo,Ke,Mo,Oo,Qe,So,Ho,E,We,Bo,Xo,wt,Ko,Ge,Qo,Wo,je,Go,jo,Fe,Fo,Vo,Ve,Jo,Yo,b,Je,Zo,en,Ye,tn,rn,Ze,on,nn,et,ln,an,tt,sn,pn,zt,jt,pe,Ft,q,cn,Dt,dn,fn,ce,un,_n,Vt,F,Jt,H,V,It,de,hn,At,mn,Yt,rt,vn,Zt,ot,gn,er,nt,En,tr,fe,rr,it,bn,or,ue,nr,B,J,kt,_e,xn,Lt,Pn,ir,Y,$n,lt,yn,Tn,lr,at,Cn,ar,X,Z,Rt,he,wn,Ut,zn,sr,ee,Dn,Nt,qt,In,An,pr,me,kn,ve,Ln,cr,st,Rn,dr,ge,fr,pt,Un,ur,ct,Nn,_r,Ee,hr,te,qn,Mt,Mn,On,mr,be,vr;return re=new ut({}),oe=new ut({}),se=new ut({}),pe=new _t({props:{code:"pip install oneccl_bind_pt=={pytorch_version} -f https://developer.intel.com/ipex-whl-stable-cpu",highlighted:"pip install oneccl_bind_pt=={pytorch_version} -f https://developer.intel.com/ipex-whl-stable-cpu"}}),F=new dl({props:{warning:!0,$$slots:{default:[fl]},$$scope:{ctx:Ot}}}),de=new ut({}),fe=new _t({props:{code:`oneccl_bindings_for_pytorch_path=$(python -c "from oneccl_bindings_for_pytorch import cwd; print(cwd)")
source $oneccl_bindings_for_pytorch_path/env/setvars.sh`,highlighted:`oneccl_bindings_for_pytorch_path=$(python -c <span class="hljs-string">&quot;from oneccl_bindings_for_pytorch import cwd; print(cwd)&quot;</span>)
<span class="hljs-built_in">source</span> <span class="hljs-variable">$oneccl_bindings_for_pytorch_path</span>/env/setvars.sh`}}),ue=new _t({props:{code:`torch_ccl_path=$(python -c "import torch; import torch_ccl; import os;  print(os.path.abspath(os.path.dirname(torch_ccl.__file__)))")
source $torch_ccl_path/env/setvars.sh`,highlighted:`torch_ccl_path=$(python -c <span class="hljs-string">&quot;import torch; import torch_ccl; import os;  print(os.path.abspath(os.path.dirname(torch_ccl.__file__)))&quot;</span>)
<span class="hljs-built_in">source</span> <span class="hljs-variable">$torch_ccl_path</span>/env/setvars.sh`}}),_e=new ut({}),he=new ut({}),ge=new _t({props:{code:` export CCL_WORKER_COUNT=1
 export MASTER_ADDR=127.0.0.1
 mpirun -n 2 -genv OMP_NUM_THREADS=23 \\
 python3 run_qa.py \\
 --model_name_or_path bert-large-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/ \\
 --no_cuda \\
 --xpu_backend ccl \\
 --use_ipex`,highlighted:` export CCL_WORKER_COUNT=1
 export MASTER_ADDR=127.0.0.1
 mpirun -n 2 -genv OMP_NUM_THREADS=23 \\
 python3 run_qa.py \\
 --model_name_or_path bert-large-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/ \\
 --no_cuda \\
 --xpu_backend ccl \\
 --use_ipex`}}),Ee=new _t({props:{code:` cat hostfile
 xxx.xxx.xxx.xxx #node0 ip
 xxx.xxx.xxx.xxx #node1 ip`,highlighted:` cat hostfile
 xxx.xxx.xxx.xxx #node0 ip
 xxx.xxx.xxx.xxx #node1 ip`}}),be=new _t({props:{code:` export CCL_WORKER_COUNT=1
 export MASTER_ADDR=xxx.xxx.xxx.xxx #node0 ip
 mpirun -f hostfile -n 4 -ppn 2 \\
 -genv OMP_NUM_THREADS=23 \\
 python3 run_qa.py \\
 --model_name_or_path bert-large-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/ \\
 --no_cuda \\
 --xpu_backend ccl \\
 --use_ipex \\
 --bf16`,highlighted:` export CCL_WORKER_COUNT=1
 export MASTER_ADDR=xxx.xxx.xxx.xxx #node0 ip
 mpirun -f hostfile -n 4 -ppn 2 \\
 -genv OMP_NUM_THREADS=23 \\
 python3 run_qa.py \\
 --model_name_or_path bert-large-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/ \\
 --no_cuda \\
 --xpu_backend ccl \\
 --use_ipex \\
 --bf16`}}),{c(){u=o("meta"),K=p(),_=o("h1"),x=o("a"),ht=o("span"),$(re.$$.fragment),zr=p(),mt=o("span"),Dr=l("Addestramento effciente su multiple CPU"),St=p(),$e=o("p"),Ir=l("Quando l\u2019addestramento su una singola CPU \xE8 troppo lento, possiamo usare CPU multiple. Quasta guida si concentra su DDP basato su PyTorch abilitando l\u2019addetramento distribuito su CPU in maniera efficiente."),Ht=p(),O=o("h2"),Q=o("a"),vt=o("span"),$(oe.$$.fragment),Ar=p(),gt=o("span"),kr=l("Intel\xAE oneCCL Bindings per PyTorch"),Bt=p(),U=o("p"),ne=o("a"),Lr=l("Intel\xAE oneCCL"),Rr=l(" (collective communications library) \xE8 una libreria per l\u2019addestramento efficiente del deep learning in distribuito e implementa collettivi come allreduce, allgather, alltoall. Per maggiori informazioni su oneCCL, fai riferimento a "),ie=o("a"),Ur=l("oneCCL documentation"),Nr=l(" e "),le=o("a"),qr=l("oneCCL specification"),Mr=l("."),Xt=p(),N=o("p"),Or=l("Il modulo "),Et=o("code"),Sr=l("oneccl_bindings_for_pytorch"),Hr=l(" ("),bt=o("code"),Br=l("torch_ccl"),Xr=l(" precedentemente alla versione 1.12)  implementa PyTorch C10D ProcessGroup API e pu\xF2 essere caricato dinamicamente com external ProcessGroup e funziona solo su piattaforma Linux al momento."),Kt=p(),W=o("p"),Kr=l("Qui trovi informazioni pi\xF9 dettagliate per "),ae=o("a"),Qr=l("oneccl_bind_pt"),Wr=l("."),Qt=p(),S=o("h3"),G=o("a"),xt=o("span"),$(se.$$.fragment),Gr=p(),Pt=o("span"),jr=l("Intel\xAE oneCCL Bindings per l'installazione PyTorch:"),Wt=p(),ye=o("p"),Fr=l("I file wheel sono disponibili per le seguenti versioni di Python:"),Gt=p(),j=o("table"),$t=o("thead"),h=o("tr"),Te=o("th"),Vr=l("Extension Version"),Jr=p(),Ce=o("th"),Yr=l("Python 3.6"),Zr=p(),we=o("th"),eo=l("Python 3.7"),to=p(),ze=o("th"),ro=l("Python 3.8"),oo=p(),De=o("th"),no=l("Python 3.9"),io=p(),Ie=o("th"),lo=l("Python 3.10"),ao=p(),P=o("tbody"),m=o("tr"),Ae=o("td"),so=l("1.13.0"),po=p(),yt=o("td"),co=p(),ke=o("td"),fo=l("\u221A"),uo=p(),Le=o("td"),_o=l("\u221A"),ho=p(),Re=o("td"),mo=l("\u221A"),vo=p(),Ue=o("td"),go=l("\u221A"),Eo=p(),v=o("tr"),Ne=o("td"),bo=l("1.12.100"),xo=p(),Tt=o("td"),Po=p(),qe=o("td"),$o=l("\u221A"),yo=p(),Me=o("td"),To=l("\u221A"),Co=p(),Oe=o("td"),wo=l("\u221A"),zo=p(),Se=o("td"),Do=l("\u221A"),Io=p(),g=o("tr"),He=o("td"),Ao=l("1.12.0"),ko=p(),Ct=o("td"),Lo=p(),Be=o("td"),Ro=l("\u221A"),Uo=p(),Xe=o("td"),No=l("\u221A"),qo=p(),Ke=o("td"),Mo=l("\u221A"),Oo=p(),Qe=o("td"),So=l("\u221A"),Ho=p(),E=o("tr"),We=o("td"),Bo=l("1.11.0"),Xo=p(),wt=o("td"),Ko=p(),Ge=o("td"),Qo=l("\u221A"),Wo=p(),je=o("td"),Go=l("\u221A"),jo=p(),Fe=o("td"),Fo=l("\u221A"),Vo=p(),Ve=o("td"),Jo=l("\u221A"),Yo=p(),b=o("tr"),Je=o("td"),Zo=l("1.10.0"),en=p(),Ye=o("td"),tn=l("\u221A"),rn=p(),Ze=o("td"),on=l("\u221A"),nn=p(),et=o("td"),ln=l("\u221A"),an=p(),tt=o("td"),sn=l("\u221A"),pn=p(),zt=o("td"),jt=p(),$(pe.$$.fragment),Ft=p(),q=o("p"),cn=l("dove "),Dt=o("code"),dn=l("{pytorch_version}"),fn=l(` deve essere la tua versione di PyTorch, per l\u2019stanza 1.13.0.
Verifica altri approcci per `),ce=o("a"),un=l("oneccl_bind_pt installation"),_n=l(`.
Le versioni di oneCCL e PyTorch devono combaciare.`),Vt=p(),$(F.$$.fragment),Jt=p(),H=o("h2"),V=o("a"),It=o("span"),$(de.$$.fragment),hn=p(),At=o("span"),mn=l("Intel\xAE MPI library"),Yt=p(),rt=o("p"),vn=l("Usa questa implementazione basata su standard MPI per fornire una architettura flessibile, efficiente, scalabile su cluster per Intel\xAE. Questo componente \xE8 parte di Intel\xAE oneAPI HPC Toolkit."),Zt=p(),ot=o("p"),gn=l("oneccl_bindings_for_pytorch \xE8 installato insieme al set di strumenti MPI. Necessit\xE0 di reperire l\u2019ambiente prima di utilizzarlo."),er=p(),nt=o("p"),En=l("per Intel\xAE oneCCL >= 1.12.0"),tr=p(),$(fe.$$.fragment),rr=p(),it=o("p"),bn=l("per Intel\xAE oneCCL con versione < 1.12.0"),or=p(),$(ue.$$.fragment),nr=p(),B=o("h4"),J=o("a"),kt=o("span"),$(_e.$$.fragment),xn=p(),Lt=o("span"),Pn=l("Installazione IPEX:"),ir=p(),Y=o("p"),$n=l("IPEX fornisce ottimizzazioni delle prestazioni per l\u2019addestramento della CPU sia con Float32 che con BFloat16; puoi fare riferimento a "),lt=o("a"),yn=l("single CPU section"),Tn=l("."),lr=p(),at=o("p"),Cn=l("Il seguente \u201CUtilizzo in Trainer\u201D prende come esempio mpirun nella libreria Intel\xAE MPI."),ar=p(),X=o("h2"),Z=o("a"),Rt=o("span"),$(he.$$.fragment),wn=p(),Ut=o("span"),zn=l("Utilizzo in Trainer"),sr=p(),ee=o("p"),Dn=l("Per abilitare l\u2019addestramento distribuito multi CPU nel Trainer con il ccl backend, gli utenti devono aggiungere "),Nt=o("strong"),qt=o("code"),In=l("--xpu_backend ccl"),An=l(" negli argomenti del comando."),pr=p(),me=o("p"),kn=l("Vediamo un esempio per il "),ve=o("a"),Ln=l("question-answering example"),cr=p(),st=o("p"),Rn=l("Il seguente comando abilita due processi sul nodo Xeon, con un processo in esecuzione per ogni socket. Le variabili OMP_NUM_THREADS/CCL_WORKER_COUNT possono essere impostate per una prestazione ottimale."),dr=p(),$(ge.$$.fragment),fr=p(),pt=o("p"),Un=l("Il seguente comando abilita l\u2019addestramento per un totale di quattro processi su due Xeon (node0 e node1, prendendo node0 come processo principale), ppn (processes per node) \xE8 impostato a 2, on un processo in esecuzione per ogni socket. Le variabili OMP_NUM_THREADS/CCL_WORKER_COUNT possono essere impostate per una prestazione ottimale."),ur=p(),ct=o("p"),Nn=l("In node0, \xE8 necessario creare un file di configurazione che contenga gli indirizzi IP di ciascun nodo (per esempio hostfile) e passare il percorso del file di configurazione come parametro."),_r=p(),$(Ee.$$.fragment),hr=p(),te=o("p"),qn=l("A questo punto, esegui il seguente comando nel nodo0 e "),Mt=o("strong"),Mn=l("4DDP"),On=l(" sar\xE0 abilitato in node0 e node1 con BF16 auto mixed precision:"),mr=p(),$(be.$$.fragment),this.h()},l(e){const d=pl('[data-svelte="svelte-1phssyn"]',document.head);u=n(d,"META",{name:!0,content:!0}),d.forEach(r),K=c(e),_=n(e,"H1",{class:!0});var xe=i(_);x=n(xe,"A",{id:!0,class:!0,href:!0});var Hn=i(x);ht=n(Hn,"SPAN",{});var Bn=i(ht);y(re.$$.fragment,Bn),Bn.forEach(r),Hn.forEach(r),zr=c(xe),mt=n(xe,"SPAN",{});var Xn=i(mt);Dr=a(Xn,"Addestramento effciente su multiple CPU"),Xn.forEach(r),xe.forEach(r),St=c(e),$e=n(e,"P",{});var Kn=i($e);Ir=a(Kn,"Quando l\u2019addestramento su una singola CPU \xE8 troppo lento, possiamo usare CPU multiple. Quasta guida si concentra su DDP basato su PyTorch abilitando l\u2019addetramento distribuito su CPU in maniera efficiente."),Kn.forEach(r),Ht=c(e),O=n(e,"H2",{class:!0});var gr=i(O);Q=n(gr,"A",{id:!0,class:!0,href:!0});var Qn=i(Q);vt=n(Qn,"SPAN",{});var Wn=i(vt);y(oe.$$.fragment,Wn),Wn.forEach(r),Qn.forEach(r),Ar=c(gr),gt=n(gr,"SPAN",{});var Gn=i(gt);kr=a(Gn,"Intel\xAE oneCCL Bindings per PyTorch"),Gn.forEach(r),gr.forEach(r),Bt=c(e),U=n(e,"P",{});var Pe=i(U);ne=n(Pe,"A",{href:!0,rel:!0});var jn=i(ne);Lr=a(jn,"Intel\xAE oneCCL"),jn.forEach(r),Rr=a(Pe," (collective communications library) \xE8 una libreria per l\u2019addestramento efficiente del deep learning in distribuito e implementa collettivi come allreduce, allgather, alltoall. Per maggiori informazioni su oneCCL, fai riferimento a "),ie=n(Pe,"A",{href:!0,rel:!0});var Fn=i(ie);Ur=a(Fn,"oneCCL documentation"),Fn.forEach(r),Nr=a(Pe," e "),le=n(Pe,"A",{href:!0,rel:!0});var Vn=i(le);qr=a(Vn,"oneCCL specification"),Vn.forEach(r),Mr=a(Pe,"."),Pe.forEach(r),Xt=c(e),N=n(e,"P",{});var dt=i(N);Or=a(dt,"Il modulo "),Et=n(dt,"CODE",{});var Jn=i(Et);Sr=a(Jn,"oneccl_bindings_for_pytorch"),Jn.forEach(r),Hr=a(dt," ("),bt=n(dt,"CODE",{});var Yn=i(bt);Br=a(Yn,"torch_ccl"),Yn.forEach(r),Xr=a(dt," precedentemente alla versione 1.12)  implementa PyTorch C10D ProcessGroup API e pu\xF2 essere caricato dinamicamente com external ProcessGroup e funziona solo su piattaforma Linux al momento."),dt.forEach(r),Kt=c(e),W=n(e,"P",{});var Er=i(W);Kr=a(Er,"Qui trovi informazioni pi\xF9 dettagliate per "),ae=n(Er,"A",{href:!0,rel:!0});var Zn=i(ae);Qr=a(Zn,"oneccl_bind_pt"),Zn.forEach(r),Wr=a(Er,"."),Er.forEach(r),Qt=c(e),S=n(e,"H3",{class:!0});var br=i(S);G=n(br,"A",{id:!0,class:!0,href:!0});var ei=i(G);xt=n(ei,"SPAN",{});var ti=i(xt);y(se.$$.fragment,ti),ti.forEach(r),ei.forEach(r),Gr=c(br),Pt=n(br,"SPAN",{});var ri=i(Pt);jr=a(ri,"Intel\xAE oneCCL Bindings per l'installazione PyTorch:"),ri.forEach(r),br.forEach(r),Wt=c(e),ye=n(e,"P",{});var oi=i(ye);Fr=a(oi,"I file wheel sono disponibili per le seguenti versioni di Python:"),oi.forEach(r),Gt=c(e),j=n(e,"TABLE",{});var xr=i(j);$t=n(xr,"THEAD",{});var ni=i($t);h=n(ni,"TR",{});var D=i(h);Te=n(D,"TH",{align:!0});var ii=i(Te);Vr=a(ii,"Extension Version"),ii.forEach(r),Jr=c(D),Ce=n(D,"TH",{align:!0});var li=i(Ce);Yr=a(li,"Python 3.6"),li.forEach(r),Zr=c(D),we=n(D,"TH",{align:!0});var ai=i(we);eo=a(ai,"Python 3.7"),ai.forEach(r),to=c(D),ze=n(D,"TH",{align:!0});var si=i(ze);ro=a(si,"Python 3.8"),si.forEach(r),oo=c(D),De=n(D,"TH",{align:!0});var pi=i(De);no=a(pi,"Python 3.9"),pi.forEach(r),io=c(D),Ie=n(D,"TH",{align:!0});var ci=i(Ie);lo=a(ci,"Python 3.10"),ci.forEach(r),D.forEach(r),ni.forEach(r),ao=c(xr),P=n(xr,"TBODY",{});var M=i(P);m=n(M,"TR",{});var I=i(m);Ae=n(I,"TD",{align:!0});var di=i(Ae);so=a(di,"1.13.0"),di.forEach(r),po=c(I),yt=n(I,"TD",{align:!0}),i(yt).forEach(r),co=c(I),ke=n(I,"TD",{align:!0});var fi=i(ke);fo=a(fi,"\u221A"),fi.forEach(r),uo=c(I),Le=n(I,"TD",{align:!0});var ui=i(Le);_o=a(ui,"\u221A"),ui.forEach(r),ho=c(I),Re=n(I,"TD",{align:!0});var _i=i(Re);mo=a(_i,"\u221A"),_i.forEach(r),vo=c(I),Ue=n(I,"TD",{align:!0});var hi=i(Ue);go=a(hi,"\u221A"),hi.forEach(r),I.forEach(r),Eo=c(M),v=n(M,"TR",{});var A=i(v);Ne=n(A,"TD",{align:!0});var mi=i(Ne);bo=a(mi,"1.12.100"),mi.forEach(r),xo=c(A),Tt=n(A,"TD",{align:!0}),i(Tt).forEach(r),Po=c(A),qe=n(A,"TD",{align:!0});var vi=i(qe);$o=a(vi,"\u221A"),vi.forEach(r),yo=c(A),Me=n(A,"TD",{align:!0});var gi=i(Me);To=a(gi,"\u221A"),gi.forEach(r),Co=c(A),Oe=n(A,"TD",{align:!0});var Ei=i(Oe);wo=a(Ei,"\u221A"),Ei.forEach(r),zo=c(A),Se=n(A,"TD",{align:!0});var bi=i(Se);Do=a(bi,"\u221A"),bi.forEach(r),A.forEach(r),Io=c(M),g=n(M,"TR",{});var k=i(g);He=n(k,"TD",{align:!0});var xi=i(He);Ao=a(xi,"1.12.0"),xi.forEach(r),ko=c(k),Ct=n(k,"TD",{align:!0}),i(Ct).forEach(r),Lo=c(k),Be=n(k,"TD",{align:!0});var Pi=i(Be);Ro=a(Pi,"\u221A"),Pi.forEach(r),Uo=c(k),Xe=n(k,"TD",{align:!0});var $i=i(Xe);No=a($i,"\u221A"),$i.forEach(r),qo=c(k),Ke=n(k,"TD",{align:!0});var yi=i(Ke);Mo=a(yi,"\u221A"),yi.forEach(r),Oo=c(k),Qe=n(k,"TD",{align:!0});var Ti=i(Qe);So=a(Ti,"\u221A"),Ti.forEach(r),k.forEach(r),Ho=c(M),E=n(M,"TR",{});var L=i(E);We=n(L,"TD",{align:!0});var Ci=i(We);Bo=a(Ci,"1.11.0"),Ci.forEach(r),Xo=c(L),wt=n(L,"TD",{align:!0}),i(wt).forEach(r),Ko=c(L),Ge=n(L,"TD",{align:!0});var wi=i(Ge);Qo=a(wi,"\u221A"),wi.forEach(r),Wo=c(L),je=n(L,"TD",{align:!0});var zi=i(je);Go=a(zi,"\u221A"),zi.forEach(r),jo=c(L),Fe=n(L,"TD",{align:!0});var Di=i(Fe);Fo=a(Di,"\u221A"),Di.forEach(r),Vo=c(L),Ve=n(L,"TD",{align:!0});var Ii=i(Ve);Jo=a(Ii,"\u221A"),Ii.forEach(r),L.forEach(r),Yo=c(M),b=n(M,"TR",{});var R=i(b);Je=n(R,"TD",{align:!0});var Ai=i(Je);Zo=a(Ai,"1.10.0"),Ai.forEach(r),en=c(R),Ye=n(R,"TD",{align:!0});var ki=i(Ye);tn=a(ki,"\u221A"),ki.forEach(r),rn=c(R),Ze=n(R,"TD",{align:!0});var Li=i(Ze);on=a(Li,"\u221A"),Li.forEach(r),nn=c(R),et=n(R,"TD",{align:!0});var Ri=i(et);ln=a(Ri,"\u221A"),Ri.forEach(r),an=c(R),tt=n(R,"TD",{align:!0});var Ui=i(tt);sn=a(Ui,"\u221A"),Ui.forEach(r),pn=c(R),zt=n(R,"TD",{align:!0}),i(zt).forEach(r),R.forEach(r),M.forEach(r),xr.forEach(r),jt=c(e),y(pe.$$.fragment,e),Ft=c(e),q=n(e,"P",{});var ft=i(q);cn=a(ft,"dove "),Dt=n(ft,"CODE",{});var Ni=i(Dt);dn=a(Ni,"{pytorch_version}"),Ni.forEach(r),fn=a(ft,` deve essere la tua versione di PyTorch, per l\u2019stanza 1.13.0.
Verifica altri approcci per `),ce=n(ft,"A",{href:!0,rel:!0});var qi=i(ce);un=a(qi,"oneccl_bind_pt installation"),qi.forEach(r),_n=a(ft,`.
Le versioni di oneCCL e PyTorch devono combaciare.`),ft.forEach(r),Vt=c(e),y(F.$$.fragment,e),Jt=c(e),H=n(e,"H2",{class:!0});var Pr=i(H);V=n(Pr,"A",{id:!0,class:!0,href:!0});var Mi=i(V);It=n(Mi,"SPAN",{});var Oi=i(It);y(de.$$.fragment,Oi),Oi.forEach(r),Mi.forEach(r),hn=c(Pr),At=n(Pr,"SPAN",{});var Si=i(At);mn=a(Si,"Intel\xAE MPI library"),Si.forEach(r),Pr.forEach(r),Yt=c(e),rt=n(e,"P",{});var Hi=i(rt);vn=a(Hi,"Usa questa implementazione basata su standard MPI per fornire una architettura flessibile, efficiente, scalabile su cluster per Intel\xAE. Questo componente \xE8 parte di Intel\xAE oneAPI HPC Toolkit."),Hi.forEach(r),Zt=c(e),ot=n(e,"P",{});var Bi=i(ot);gn=a(Bi,"oneccl_bindings_for_pytorch \xE8 installato insieme al set di strumenti MPI. Necessit\xE0 di reperire l\u2019ambiente prima di utilizzarlo."),Bi.forEach(r),er=c(e),nt=n(e,"P",{});var Xi=i(nt);En=a(Xi,"per Intel\xAE oneCCL >= 1.12.0"),Xi.forEach(r),tr=c(e),y(fe.$$.fragment,e),rr=c(e),it=n(e,"P",{});var Ki=i(it);bn=a(Ki,"per Intel\xAE oneCCL con versione < 1.12.0"),Ki.forEach(r),or=c(e),y(ue.$$.fragment,e),nr=c(e),B=n(e,"H4",{class:!0});var $r=i(B);J=n($r,"A",{id:!0,class:!0,href:!0});var Qi=i(J);kt=n(Qi,"SPAN",{});var Wi=i(kt);y(_e.$$.fragment,Wi),Wi.forEach(r),Qi.forEach(r),xn=c($r),Lt=n($r,"SPAN",{});var Gi=i(Lt);Pn=a(Gi,"Installazione IPEX:"),Gi.forEach(r),$r.forEach(r),ir=c(e),Y=n(e,"P",{});var yr=i(Y);$n=a(yr,"IPEX fornisce ottimizzazioni delle prestazioni per l\u2019addestramento della CPU sia con Float32 che con BFloat16; puoi fare riferimento a "),lt=n(yr,"A",{href:!0});var ji=i(lt);yn=a(ji,"single CPU section"),ji.forEach(r),Tn=a(yr,"."),yr.forEach(r),lr=c(e),at=n(e,"P",{});var Fi=i(at);Cn=a(Fi,"Il seguente \u201CUtilizzo in Trainer\u201D prende come esempio mpirun nella libreria Intel\xAE MPI."),Fi.forEach(r),ar=c(e),X=n(e,"H2",{class:!0});var Tr=i(X);Z=n(Tr,"A",{id:!0,class:!0,href:!0});var Vi=i(Z);Rt=n(Vi,"SPAN",{});var Ji=i(Rt);y(he.$$.fragment,Ji),Ji.forEach(r),Vi.forEach(r),wn=c(Tr),Ut=n(Tr,"SPAN",{});var Yi=i(Ut);zn=a(Yi,"Utilizzo in Trainer"),Yi.forEach(r),Tr.forEach(r),sr=c(e),ee=n(e,"P",{});var Cr=i(ee);Dn=a(Cr,"Per abilitare l\u2019addestramento distribuito multi CPU nel Trainer con il ccl backend, gli utenti devono aggiungere "),Nt=n(Cr,"STRONG",{});var Zi=i(Nt);qt=n(Zi,"CODE",{});var el=i(qt);In=a(el,"--xpu_backend ccl"),el.forEach(r),Zi.forEach(r),An=a(Cr," negli argomenti del comando."),Cr.forEach(r),pr=c(e),me=n(e,"P",{});var Sn=i(me);kn=a(Sn,"Vediamo un esempio per il "),ve=n(Sn,"A",{href:!0,rel:!0});var tl=i(ve);Ln=a(tl,"question-answering example"),tl.forEach(r),Sn.forEach(r),cr=c(e),st=n(e,"P",{});var rl=i(st);Rn=a(rl,"Il seguente comando abilita due processi sul nodo Xeon, con un processo in esecuzione per ogni socket. Le variabili OMP_NUM_THREADS/CCL_WORKER_COUNT possono essere impostate per una prestazione ottimale."),rl.forEach(r),dr=c(e),y(ge.$$.fragment,e),fr=c(e),pt=n(e,"P",{});var ol=i(pt);Un=a(ol,"Il seguente comando abilita l\u2019addestramento per un totale di quattro processi su due Xeon (node0 e node1, prendendo node0 come processo principale), ppn (processes per node) \xE8 impostato a 2, on un processo in esecuzione per ogni socket. Le variabili OMP_NUM_THREADS/CCL_WORKER_COUNT possono essere impostate per una prestazione ottimale."),ol.forEach(r),ur=c(e),ct=n(e,"P",{});var nl=i(ct);Nn=a(nl,"In node0, \xE8 necessario creare un file di configurazione che contenga gli indirizzi IP di ciascun nodo (per esempio hostfile) e passare il percorso del file di configurazione come parametro."),nl.forEach(r),_r=c(e),y(Ee.$$.fragment,e),hr=c(e),te=n(e,"P",{});var wr=i(te);qn=a(wr,"A questo punto, esegui il seguente comando nel nodo0 e "),Mt=n(wr,"STRONG",{});var il=i(Mt);Mn=a(il,"4DDP"),il.forEach(r),On=a(wr," sar\xE0 abilitato in node0 e node1 con BF16 auto mixed precision:"),wr.forEach(r),mr=c(e),y(be.$$.fragment,e),this.h()},h(){s(u,"name","hf:doc:metadata"),s(u,"content",JSON.stringify(_l)),s(x,"id","addestramento-effciente-su-multiple-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","#addestramento-effciente-su-multiple-cpu"),s(_,"class","relative group"),s(Q,"id","intel-oneccl-bindings-per-pytorch"),s(Q,"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(Q,"href","#intel-oneccl-bindings-per-pytorch"),s(O,"class","relative group"),s(ne,"href","https://github.com/oneapi-src/oneCCL"),s(ne,"rel","nofollow"),s(ie,"href","https://spec.oneapi.com/versions/latest/elements/oneCCL/source/index.html"),s(ie,"rel","nofollow"),s(le,"href","https://spec.oneapi.com/versions/latest/elements/oneCCL/source/index.html"),s(le,"rel","nofollow"),s(ae,"href","https://github.com/intel/torch-ccl"),s(ae,"rel","nofollow"),s(G,"id","intel-oneccl-bindings-per-linstallazione-pytorch"),s(G,"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(G,"href","#intel-oneccl-bindings-per-linstallazione-pytorch"),s(S,"class","relative group"),s(Te,"align","center"),s(Ce,"align","center"),s(we,"align","center"),s(ze,"align","center"),s(De,"align","center"),s(Ie,"align","center"),s(Ae,"align","center"),s(yt,"align","center"),s(ke,"align","center"),s(Le,"align","center"),s(Re,"align","center"),s(Ue,"align","center"),s(Ne,"align","center"),s(Tt,"align","center"),s(qe,"align","center"),s(Me,"align","center"),s(Oe,"align","center"),s(Se,"align","center"),s(He,"align","center"),s(Ct,"align","center"),s(Be,"align","center"),s(Xe,"align","center"),s(Ke,"align","center"),s(Qe,"align","center"),s(We,"align","center"),s(wt,"align","center"),s(Ge,"align","center"),s(je,"align","center"),s(Fe,"align","center"),s(Ve,"align","center"),s(Je,"align","center"),s(Ye,"align","center"),s(Ze,"align","center"),s(et,"align","center"),s(tt,"align","center"),s(zt,"align","center"),s(ce,"href","https://github.com/intel/torch-ccl"),s(ce,"rel","nofollow"),s(V,"id","intel-mpi-library"),s(V,"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(V,"href","#intel-mpi-library"),s(H,"class","relative group"),s(J,"id","installazione-ipex"),s(J,"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(J,"href","#installazione-ipex"),s(B,"class","relative group"),s(lt,"href","./perf_train_cpu"),s(Z,"id","utilizzo-in-trainer"),s(Z,"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(Z,"href","#utilizzo-in-trainer"),s(X,"class","relative group"),s(ve,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/question-answering"),s(ve,"rel","nofollow")},m(e,d){t(document.head,u),f(e,K,d),f(e,_,d),t(_,x),t(x,ht),T(re,ht,null),t(_,zr),t(_,mt),t(mt,Dr),f(e,St,d),f(e,$e,d),t($e,Ir),f(e,Ht,d),f(e,O,d),t(O,Q),t(Q,vt),T(oe,vt,null),t(O,Ar),t(O,gt),t(gt,kr),f(e,Bt,d),f(e,U,d),t(U,ne),t(ne,Lr),t(U,Rr),t(U,ie),t(ie,Ur),t(U,Nr),t(U,le),t(le,qr),t(U,Mr),f(e,Xt,d),f(e,N,d),t(N,Or),t(N,Et),t(Et,Sr),t(N,Hr),t(N,bt),t(bt,Br),t(N,Xr),f(e,Kt,d),f(e,W,d),t(W,Kr),t(W,ae),t(ae,Qr),t(W,Wr),f(e,Qt,d),f(e,S,d),t(S,G),t(G,xt),T(se,xt,null),t(S,Gr),t(S,Pt),t(Pt,jr),f(e,Wt,d),f(e,ye,d),t(ye,Fr),f(e,Gt,d),f(e,j,d),t(j,$t),t($t,h),t(h,Te),t(Te,Vr),t(h,Jr),t(h,Ce),t(Ce,Yr),t(h,Zr),t(h,we),t(we,eo),t(h,to),t(h,ze),t(ze,ro),t(h,oo),t(h,De),t(De,no),t(h,io),t(h,Ie),t(Ie,lo),t(j,ao),t(j,P),t(P,m),t(m,Ae),t(Ae,so),t(m,po),t(m,yt),t(m,co),t(m,ke),t(ke,fo),t(m,uo),t(m,Le),t(Le,_o),t(m,ho),t(m,Re),t(Re,mo),t(m,vo),t(m,Ue),t(Ue,go),t(P,Eo),t(P,v),t(v,Ne),t(Ne,bo),t(v,xo),t(v,Tt),t(v,Po),t(v,qe),t(qe,$o),t(v,yo),t(v,Me),t(Me,To),t(v,Co),t(v,Oe),t(Oe,wo),t(v,zo),t(v,Se),t(Se,Do),t(P,Io),t(P,g),t(g,He),t(He,Ao),t(g,ko),t(g,Ct),t(g,Lo),t(g,Be),t(Be,Ro),t(g,Uo),t(g,Xe),t(Xe,No),t(g,qo),t(g,Ke),t(Ke,Mo),t(g,Oo),t(g,Qe),t(Qe,So),t(P,Ho),t(P,E),t(E,We),t(We,Bo),t(E,Xo),t(E,wt),t(E,Ko),t(E,Ge),t(Ge,Qo),t(E,Wo),t(E,je),t(je,Go),t(E,jo),t(E,Fe),t(Fe,Fo),t(E,Vo),t(E,Ve),t(Ve,Jo),t(P,Yo),t(P,b),t(b,Je),t(Je,Zo),t(b,en),t(b,Ye),t(Ye,tn),t(b,rn),t(b,Ze),t(Ze,on),t(b,nn),t(b,et),t(et,ln),t(b,an),t(b,tt),t(tt,sn),t(b,pn),t(b,zt),f(e,jt,d),T(pe,e,d),f(e,Ft,d),f(e,q,d),t(q,cn),t(q,Dt),t(Dt,dn),t(q,fn),t(q,ce),t(ce,un),t(q,_n),f(e,Vt,d),T(F,e,d),f(e,Jt,d),f(e,H,d),t(H,V),t(V,It),T(de,It,null),t(H,hn),t(H,At),t(At,mn),f(e,Yt,d),f(e,rt,d),t(rt,vn),f(e,Zt,d),f(e,ot,d),t(ot,gn),f(e,er,d),f(e,nt,d),t(nt,En),f(e,tr,d),T(fe,e,d),f(e,rr,d),f(e,it,d),t(it,bn),f(e,or,d),T(ue,e,d),f(e,nr,d),f(e,B,d),t(B,J),t(J,kt),T(_e,kt,null),t(B,xn),t(B,Lt),t(Lt,Pn),f(e,ir,d),f(e,Y,d),t(Y,$n),t(Y,lt),t(lt,yn),t(Y,Tn),f(e,lr,d),f(e,at,d),t(at,Cn),f(e,ar,d),f(e,X,d),t(X,Z),t(Z,Rt),T(he,Rt,null),t(X,wn),t(X,Ut),t(Ut,zn),f(e,sr,d),f(e,ee,d),t(ee,Dn),t(ee,Nt),t(Nt,qt),t(qt,In),t(ee,An),f(e,pr,d),f(e,me,d),t(me,kn),t(me,ve),t(ve,Ln),f(e,cr,d),f(e,st,d),t(st,Rn),f(e,dr,d),T(ge,e,d),f(e,fr,d),f(e,pt,d),t(pt,Un),f(e,ur,d),f(e,ct,d),t(ct,Nn),f(e,_r,d),T(Ee,e,d),f(e,hr,d),f(e,te,d),t(te,qn),t(te,Mt),t(Mt,Mn),t(te,On),f(e,mr,d),T(be,e,d),vr=!0},p(e,[d]){const xe={};d&2&&(xe.$$scope={dirty:d,ctx:e}),F.$set(xe)},i(e){vr||(C(re.$$.fragment,e),C(oe.$$.fragment,e),C(se.$$.fragment,e),C(pe.$$.fragment,e),C(F.$$.fragment,e),C(de.$$.fragment,e),C(fe.$$.fragment,e),C(ue.$$.fragment,e),C(_e.$$.fragment,e),C(he.$$.fragment,e),C(ge.$$.fragment,e),C(Ee.$$.fragment,e),C(be.$$.fragment,e),vr=!0)},o(e){w(re.$$.fragment,e),w(oe.$$.fragment,e),w(se.$$.fragment,e),w(pe.$$.fragment,e),w(F.$$.fragment,e),w(de.$$.fragment,e),w(fe.$$.fragment,e),w(ue.$$.fragment,e),w(_e.$$.fragment,e),w(he.$$.fragment,e),w(ge.$$.fragment,e),w(Ee.$$.fragment,e),w(be.$$.fragment,e),vr=!1},d(e){r(u),e&&r(K),e&&r(_),z(re),e&&r(St),e&&r($e),e&&r(Ht),e&&r(O),z(oe),e&&r(Bt),e&&r(U),e&&r(Xt),e&&r(N),e&&r(Kt),e&&r(W),e&&r(Qt),e&&r(S),z(se),e&&r(Wt),e&&r(ye),e&&r(Gt),e&&r(j),e&&r(jt),z(pe,e),e&&r(Ft),e&&r(q),e&&r(Vt),z(F,e),e&&r(Jt),e&&r(H),z(de),e&&r(Yt),e&&r(rt),e&&r(Zt),e&&r(ot),e&&r(er),e&&r(nt),e&&r(tr),z(fe,e),e&&r(rr),e&&r(it),e&&r(or),z(ue,e),e&&r(nr),e&&r(B),z(_e),e&&r(ir),e&&r(Y),e&&r(lr),e&&r(at),e&&r(ar),e&&r(X),z(he),e&&r(sr),e&&r(ee),e&&r(pr),e&&r(me),e&&r(cr),e&&r(st),e&&r(dr),z(ge,e),e&&r(fr),e&&r(pt),e&&r(ur),e&&r(ct),e&&r(_r),z(Ee,e),e&&r(hr),e&&r(te),e&&r(mr),z(be,e)}}}const _l={local:"addestramento-effciente-su-multiple-cpu",sections:[{local:"intel-oneccl-bindings-per-pytorch",sections:[{local:"intel-oneccl-bindings-per-linstallazione-pytorch",title:"Intel\xAE oneCCL Bindings per l'installazione PyTorch:"}],title:"Intel\xAE oneCCL Bindings per PyTorch"},{local:"intel-mpi-library",sections:[{local:"installazione-ipex",title:"Installazione IPEX:"}],title:"Intel\xAE MPI library"},{local:"utilizzo-in-trainer",title:"Utilizzo in Trainer"}],title:"Addestramento effciente su multiple CPU"};function hl(Ot){return cl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class bl extends ll{constructor(u){super();al(this,u,hl,ul,sl,{})}}export{bl as default,_l as metadata};
