import{S as ii,i as ai,s as si,e as o,k as c,w,t as i,M as ci,c as r,d as l,m as p,a as n,x as g,h as a,b as s,G as t,g as f,y as U,q as C,o as P,B as I,v as pi}from"../chunks/vendor-hf-doc-builder.js";import{T as di}from"../chunks/Tip-hf-doc-builder.js";import{I as ut}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as ht}from"../chunks/CodeBlock-hf-doc-builder.js";function fi(Xt){let u,Z;return{c(){u=o("p"),Z=i(`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(h){u=r(h,"P",{});var b=n(u);Z=a(b,`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`),b.forEach(l)},m(h,b){f(h,u,b),t(u,Z)},d(h){h&&l(u)}}}function ui(Xt){let u,Z,h,b,mt,le,Il,_t,Jl,kt,we,$l,Bt,X,V,vt,oe,zl,Tt,Al,St,R,re,xl,Nl,ne,Rl,jl,ie,Dl,Ll,Gt,j,Xl,Et,kl,Bl,Mt,Sl,Gl,Zt,Q,Zl,ae,Vl,Ql,Vt,k,W,bt,se,Wl,yt,Hl,Qt,ge,Yl,Wt,H,wt,m,Ue,Fl,Ol,Ce,ql,Kl,Pe,eo,to,Ie,lo,oo,Je,ro,no,$e,io,ao,y,_,ze,so,co,gt,po,Ae,fo,uo,xe,ho,mo,Ne,_o,vo,Re,To,Eo,v,je,Mo,bo,Ut,yo,De,wo,go,Le,Uo,Co,Xe,Po,Io,ke,Jo,$o,T,Be,zo,Ao,Ct,xo,Se,No,Ro,Ge,jo,Do,Ze,Lo,Xo,Ve,ko,Bo,E,Qe,So,Go,Pt,Zo,We,Vo,Qo,He,Wo,Ho,Ye,Yo,Fo,Fe,Oo,qo,M,Oe,Ko,er,qe,tr,lr,Ke,or,rr,et,nr,ir,tt,ar,sr,It,Ht,ce,Yt,D,cr,Jt,pr,dr,pe,fr,ur,Ft,Y,Ot,B,F,$t,de,hr,zt,mr,qt,lt,_r,Kt,ot,vr,el,rt,Tr,tl,fe,ll,nt,Er,ol,ue,rl,S,O,At,he,Mr,xt,br,nl,q,yr,it,wr,gr,il,at,Ur,al,G,K,Nt,me,Cr,Rt,Pr,sl,ee,Ir,jt,Dt,Jr,$r,cl,_e,zr,ve,Ar,pl,st,xr,dl,Te,fl,ct,Nr,ul,pt,Rr,hl,Ee,ml,te,jr,Lt,Dr,Lr,_l,Me,vl;return le=new ut({}),oe=new ut({}),se=new ut({}),ce=new ht({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9uZWNjbF9iaW5kX3B0JTNEJTNEJTdCcHl0b3JjaF92ZXJzaW9uJTdEJTIwLWYlMjBodHRwcyUzQSUyRiUyRmRldmVsb3Blci5pbnRlbC5jb20lMkZpcGV4LXdobC1zdGFibGUtY3B1",highlighted:"pip install oneccl_bind_pt=={pytorch_version} -f https://developer.intel.com/ipex-whl-stable-cpu"}}),Y=new di({props:{warning:!0,$$slots:{default:[fi]},$$scope:{ctx:Xt}}}),de=new ut({}),fe=new ht({props:{code:"b25lY2NsX2JpbmRpbmdzX2Zvcl9weXRvcmNoX3BhdGglM0QlMjQocHl0aG9uJTIwLWMlMjAlMjJmcm9tJTIwb25lY2NsX2JpbmRpbmdzX2Zvcl9weXRvcmNoJTIwaW1wb3J0JTIwY3dkJTNCJTIwcHJpbnQoY3dkKSUyMiklMEFzb3VyY2UlMjAlMjRvbmVjY2xfYmluZGluZ3NfZm9yX3B5dG9yY2hfcGF0aCUyRmVudiUyRnNldHZhcnMuc2g=",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 ht({props:{code:"dG9yY2hfY2NsX3BhdGglM0QlMjQocHl0aG9uJTIwLWMlMjAlMjJpbXBvcnQlMjB0b3JjaCUzQiUyMGltcG9ydCUyMHRvcmNoX2NjbCUzQiUyMGltcG9ydCUyMG9zJTNCJTIwJTIwcHJpbnQob3MucGF0aC5hYnNwYXRoKG9zLnBhdGguZGlybmFtZSh0b3JjaF9jY2wuX19maWxlX18pKSklMjIpJTBBc291cmNlJTIwJTI0dG9yY2hfY2NsX3BhdGglMkZlbnYlMkZzZXR2YXJzLnNo",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`}}),he=new ut({}),me=new ut({}),Te=new ht({props:{code:"JTIwZXhwb3J0JTIwQ0NMX1dPUktFUl9DT1VOVCUzRDElMEElMjBleHBvcnQlMjBNQVNURVJfQUREUiUzRDEyNy4wLjAuMSUwQSUyMG1waXJ1biUyMC1uJTIwMiUyMC1nZW52JTIwT01QX05VTV9USFJFQURTJTNEMjMlMjAlNUMlMEElMjBweXRob24zJTIwcnVuX3FhLnB5JTIwJTVDJTBBJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBiZXJ0LWxhcmdlLXVuY2FzZWQlMjAlNUMlMEElMjAtLWRhdGFzZXRfbmFtZSUyMHNxdWFkJTIwJTVDJTBBJTIwLS1kb190cmFpbiUyMCU1QyUwQSUyMC0tZG9fZXZhbCUyMCU1QyUwQSUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIwMTIlMjAlMjAlNUMlMEElMjAtLWxlYXJuaW5nX3JhdGUlMjAzZS01JTIwJTIwJTVDJTBBJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMiUyMCUyMCU1QyUwQSUyMC0tbWF4X3NlcV9sZW5ndGglMjAzODQlMjAlNUMlMEElMjAtLWRvY19zdHJpZGUlMjAxMjglMjAlMjAlNUMlMEElMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkZkZWJ1Z19zcXVhZCUyRiUyMCU1QyUwQSUyMC0tbm9fY3VkYSUyMCU1QyUwQSUyMC0tZGRwX2JhY2tlbmQlMjBjY2wlMjAlNUMlMEElMjAtLXVzZV9pcGV4",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 \\
 --ddp_backend ccl \\
 --use_ipex`}}),Ee=new ht({props:{code:"JTIwY2F0JTIwaG9zdGZpbGUlMEElMjB4eHgueHh4Lnh4eC54eHglMjAlMjNub2RlMCUyMGlwJTBBJTIweHh4Lnh4eC54eHgueHh4JTIwJTIzbm9kZTElMjBpcA==",highlighted:` cat hostfile
 xxx.xxx.xxx.xxx #node0 ip
 xxx.xxx.xxx.xxx #node1 ip`}}),Me=new ht({props:{code:"JTIwZXhwb3J0JTIwQ0NMX1dPUktFUl9DT1VOVCUzRDElMEElMjBleHBvcnQlMjBNQVNURVJfQUREUiUzRHh4eC54eHgueHh4Lnh4eCUyMCUyM25vZGUwJTIwaXAlMEElMjBtcGlydW4lMjAtZiUyMGhvc3RmaWxlJTIwLW4lMjA0JTIwLXBwbiUyMDIlMjAlNUMlMEElMjAtZ2VudiUyME9NUF9OVU1fVEhSRUFEUyUzRDIzJTIwJTVDJTBBJTIwcHl0aG9uMyUyMHJ1bl9xYS5weSUyMCU1QyUwQSUyMC0tbW9kZWxfbmFtZV9vcl9wYXRoJTIwYmVydC1sYXJnZS11bmNhc2VkJTIwJTVDJTBBJTIwLS1kYXRhc2V0X25hbWUlMjBzcXVhZCUyMCU1QyUwQSUyMC0tZG9fdHJhaW4lMjAlNUMlMEElMjAtLWRvX2V2YWwlMjAlNUMlMEElMjAtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUyMDEyJTIwJTIwJTVDJTBBJTIwLS1sZWFybmluZ19yYXRlJTIwM2UtNSUyMCUyMCU1QyUwQSUyMC0tbnVtX3RyYWluX2Vwb2NocyUyMDIlMjAlMjAlNUMlMEElMjAtLW1heF9zZXFfbGVuZ3RoJTIwMzg0JTIwJTVDJTBBJTIwLS1kb2Nfc3RyaWRlJTIwMTI4JTIwJTIwJTVDJTBBJTIwLS1vdXRwdXRfZGlyJTIwJTJGdG1wJTJGZGVidWdfc3F1YWQlMkYlMjAlNUMlMEElMjAtLW5vX2N1ZGElMjAlNUMlMEElMjAtLWRkcF9iYWNrZW5kJTIwY2NsJTIwJTVDJTBBJTIwLS11c2VfaXBleCUyMCU1QyUwQSUyMC0tYmYxNg==",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 \\
 --ddp_backend ccl \\
 --use_ipex \\
 --bf16`}}),{c(){u=o("meta"),Z=c(),h=o("h1"),b=o("a"),mt=o("span"),w(le.$$.fragment),Il=c(),_t=o("span"),Jl=i("Addestramento effciente su multiple CPU"),kt=c(),we=o("p"),$l=i("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."),Bt=c(),X=o("h2"),V=o("a"),vt=o("span"),w(oe.$$.fragment),zl=c(),Tt=o("span"),Al=i("Intel\xAE oneCCL Bindings per PyTorch"),St=c(),R=o("p"),re=o("a"),xl=i("Intel\xAE oneCCL"),Nl=i(" (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 "),ne=o("a"),Rl=i("oneCCL documentation"),jl=i(" e "),ie=o("a"),Dl=i("oneCCL specification"),Ll=i("."),Gt=c(),j=o("p"),Xl=i("Il modulo "),Et=o("code"),kl=i("oneccl_bindings_for_pytorch"),Bl=i(" ("),Mt=o("code"),Sl=i("torch_ccl"),Gl=i(" 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."),Zt=c(),Q=o("p"),Zl=i("Qui trovi informazioni pi\xF9 dettagliate per "),ae=o("a"),Vl=i("oneccl_bind_pt"),Ql=i("."),Vt=c(),k=o("h3"),W=o("a"),bt=o("span"),w(se.$$.fragment),Wl=c(),yt=o("span"),Hl=i("Intel\xAE oneCCL Bindings per l'installazione PyTorch:"),Qt=c(),ge=o("p"),Yl=i("I file wheel sono disponibili per le seguenti versioni di Python:"),Wt=c(),H=o("table"),wt=o("thead"),m=o("tr"),Ue=o("th"),Fl=i("Extension Version"),Ol=c(),Ce=o("th"),ql=i("Python 3.6"),Kl=c(),Pe=o("th"),eo=i("Python 3.7"),to=c(),Ie=o("th"),lo=i("Python 3.8"),oo=c(),Je=o("th"),ro=i("Python 3.9"),no=c(),$e=o("th"),io=i("Python 3.10"),ao=c(),y=o("tbody"),_=o("tr"),ze=o("td"),so=i("1.13.0"),co=c(),gt=o("td"),po=c(),Ae=o("td"),fo=i("\u221A"),uo=c(),xe=o("td"),ho=i("\u221A"),mo=c(),Ne=o("td"),_o=i("\u221A"),vo=c(),Re=o("td"),To=i("\u221A"),Eo=c(),v=o("tr"),je=o("td"),Mo=i("1.12.100"),bo=c(),Ut=o("td"),yo=c(),De=o("td"),wo=i("\u221A"),go=c(),Le=o("td"),Uo=i("\u221A"),Co=c(),Xe=o("td"),Po=i("\u221A"),Io=c(),ke=o("td"),Jo=i("\u221A"),$o=c(),T=o("tr"),Be=o("td"),zo=i("1.12.0"),Ao=c(),Ct=o("td"),xo=c(),Se=o("td"),No=i("\u221A"),Ro=c(),Ge=o("td"),jo=i("\u221A"),Do=c(),Ze=o("td"),Lo=i("\u221A"),Xo=c(),Ve=o("td"),ko=i("\u221A"),Bo=c(),E=o("tr"),Qe=o("td"),So=i("1.11.0"),Go=c(),Pt=o("td"),Zo=c(),We=o("td"),Vo=i("\u221A"),Qo=c(),He=o("td"),Wo=i("\u221A"),Ho=c(),Ye=o("td"),Yo=i("\u221A"),Fo=c(),Fe=o("td"),Oo=i("\u221A"),qo=c(),M=o("tr"),Oe=o("td"),Ko=i("1.10.0"),er=c(),qe=o("td"),tr=i("\u221A"),lr=c(),Ke=o("td"),or=i("\u221A"),rr=c(),et=o("td"),nr=i("\u221A"),ir=c(),tt=o("td"),ar=i("\u221A"),sr=c(),It=o("td"),Ht=c(),w(ce.$$.fragment),Yt=c(),D=o("p"),cr=i("dove "),Jt=o("code"),pr=i("{pytorch_version}"),dr=i(` deve essere la tua versione di PyTorch, per l\u2019stanza 1.13.0.
Verifica altri approcci per `),pe=o("a"),fr=i("oneccl_bind_pt installation"),ur=i(`.
Le versioni di oneCCL e PyTorch devono combaciare.`),Ft=c(),w(Y.$$.fragment),Ot=c(),B=o("h2"),F=o("a"),$t=o("span"),w(de.$$.fragment),hr=c(),zt=o("span"),mr=i("Intel\xAE MPI library"),qt=c(),lt=o("p"),_r=i("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."),Kt=c(),ot=o("p"),vr=i("oneccl_bindings_for_pytorch \xE8 installato insieme al set di strumenti MPI. Necessit\xE0 di reperire l\u2019ambiente prima di utilizzarlo."),el=c(),rt=o("p"),Tr=i("per Intel\xAE oneCCL >= 1.12.0"),tl=c(),w(fe.$$.fragment),ll=c(),nt=o("p"),Er=i("per Intel\xAE oneCCL con versione < 1.12.0"),ol=c(),w(ue.$$.fragment),rl=c(),S=o("h4"),O=o("a"),At=o("span"),w(he.$$.fragment),Mr=c(),xt=o("span"),br=i("Installazione IPEX:"),nl=c(),q=o("p"),yr=i("IPEX fornisce ottimizzazioni delle prestazioni per l\u2019addestramento della CPU sia con Float32 che con BFloat16; puoi fare riferimento a "),it=o("a"),wr=i("single CPU section"),gr=i("."),il=c(),at=o("p"),Ur=i("Il seguente \u201CUtilizzo in Trainer\u201D prende come esempio mpirun nella libreria Intel\xAE MPI."),al=c(),G=o("h2"),K=o("a"),Nt=o("span"),w(me.$$.fragment),Cr=c(),Rt=o("span"),Pr=i("Utilizzo in Trainer"),sl=c(),ee=o("p"),Ir=i("Per abilitare l\u2019addestramento distribuito multi CPU nel Trainer con il ccl backend, gli utenti devono aggiungere "),jt=o("strong"),Dt=o("code"),Jr=i("--ddp_backend ccl"),$r=i(" negli argomenti del comando."),cl=c(),_e=o("p"),zr=i("Vediamo un esempio per il "),ve=o("a"),Ar=i("question-answering example"),pl=c(),st=o("p"),xr=i("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."),dl=c(),w(Te.$$.fragment),fl=c(),ct=o("p"),Nr=i("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."),ul=c(),pt=o("p"),Rr=i("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."),hl=c(),w(Ee.$$.fragment),ml=c(),te=o("p"),jr=i("A questo punto, esegui il seguente comando nel nodo0 e "),Lt=o("strong"),Dr=i("4DDP"),Lr=i(" sar\xE0 abilitato in node0 e node1 con BF16 auto mixed precision:"),_l=c(),w(Me.$$.fragment),this.h()},l(e){const d=ci('[data-svelte="svelte-1phssyn"]',document.head);u=r(d,"META",{name:!0,content:!0}),d.forEach(l),Z=p(e),h=r(e,"H1",{class:!0});var be=n(h);b=r(be,"A",{id:!0,class:!0,href:!0});var kr=n(b);mt=r(kr,"SPAN",{});var Br=n(mt);g(le.$$.fragment,Br),Br.forEach(l),kr.forEach(l),Il=p(be),_t=r(be,"SPAN",{});var Sr=n(_t);Jl=a(Sr,"Addestramento effciente su multiple CPU"),Sr.forEach(l),be.forEach(l),kt=p(e),we=r(e,"P",{});var Gr=n(we);$l=a(Gr,"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."),Gr.forEach(l),Bt=p(e),X=r(e,"H2",{class:!0});var Tl=n(X);V=r(Tl,"A",{id:!0,class:!0,href:!0});var Zr=n(V);vt=r(Zr,"SPAN",{});var Vr=n(vt);g(oe.$$.fragment,Vr),Vr.forEach(l),Zr.forEach(l),zl=p(Tl),Tt=r(Tl,"SPAN",{});var Qr=n(Tt);Al=a(Qr,"Intel\xAE oneCCL Bindings per PyTorch"),Qr.forEach(l),Tl.forEach(l),St=p(e),R=r(e,"P",{});var ye=n(R);re=r(ye,"A",{href:!0,rel:!0});var Wr=n(re);xl=a(Wr,"Intel\xAE oneCCL"),Wr.forEach(l),Nl=a(ye," (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 "),ne=r(ye,"A",{href:!0,rel:!0});var Hr=n(ne);Rl=a(Hr,"oneCCL documentation"),Hr.forEach(l),jl=a(ye," e "),ie=r(ye,"A",{href:!0,rel:!0});var Yr=n(ie);Dl=a(Yr,"oneCCL specification"),Yr.forEach(l),Ll=a(ye,"."),ye.forEach(l),Gt=p(e),j=r(e,"P",{});var dt=n(j);Xl=a(dt,"Il modulo "),Et=r(dt,"CODE",{});var Fr=n(Et);kl=a(Fr,"oneccl_bindings_for_pytorch"),Fr.forEach(l),Bl=a(dt," ("),Mt=r(dt,"CODE",{});var Or=n(Mt);Sl=a(Or,"torch_ccl"),Or.forEach(l),Gl=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(l),Zt=p(e),Q=r(e,"P",{});var El=n(Q);Zl=a(El,"Qui trovi informazioni pi\xF9 dettagliate per "),ae=r(El,"A",{href:!0,rel:!0});var qr=n(ae);Vl=a(qr,"oneccl_bind_pt"),qr.forEach(l),Ql=a(El,"."),El.forEach(l),Vt=p(e),k=r(e,"H3",{class:!0});var Ml=n(k);W=r(Ml,"A",{id:!0,class:!0,href:!0});var Kr=n(W);bt=r(Kr,"SPAN",{});var en=n(bt);g(se.$$.fragment,en),en.forEach(l),Kr.forEach(l),Wl=p(Ml),yt=r(Ml,"SPAN",{});var tn=n(yt);Hl=a(tn,"Intel\xAE oneCCL Bindings per l'installazione PyTorch:"),tn.forEach(l),Ml.forEach(l),Qt=p(e),ge=r(e,"P",{});var ln=n(ge);Yl=a(ln,"I file wheel sono disponibili per le seguenti versioni di Python:"),ln.forEach(l),Wt=p(e),H=r(e,"TABLE",{});var bl=n(H);wt=r(bl,"THEAD",{});var on=n(wt);m=r(on,"TR",{});var J=n(m);Ue=r(J,"TH",{align:!0});var rn=n(Ue);Fl=a(rn,"Extension Version"),rn.forEach(l),Ol=p(J),Ce=r(J,"TH",{align:!0});var nn=n(Ce);ql=a(nn,"Python 3.6"),nn.forEach(l),Kl=p(J),Pe=r(J,"TH",{align:!0});var an=n(Pe);eo=a(an,"Python 3.7"),an.forEach(l),to=p(J),Ie=r(J,"TH",{align:!0});var sn=n(Ie);lo=a(sn,"Python 3.8"),sn.forEach(l),oo=p(J),Je=r(J,"TH",{align:!0});var cn=n(Je);ro=a(cn,"Python 3.9"),cn.forEach(l),no=p(J),$e=r(J,"TH",{align:!0});var pn=n($e);io=a(pn,"Python 3.10"),pn.forEach(l),J.forEach(l),on.forEach(l),ao=p(bl),y=r(bl,"TBODY",{});var L=n(y);_=r(L,"TR",{});var $=n(_);ze=r($,"TD",{align:!0});var dn=n(ze);so=a(dn,"1.13.0"),dn.forEach(l),co=p($),gt=r($,"TD",{align:!0}),n(gt).forEach(l),po=p($),Ae=r($,"TD",{align:!0});var fn=n(Ae);fo=a(fn,"\u221A"),fn.forEach(l),uo=p($),xe=r($,"TD",{align:!0});var un=n(xe);ho=a(un,"\u221A"),un.forEach(l),mo=p($),Ne=r($,"TD",{align:!0});var hn=n(Ne);_o=a(hn,"\u221A"),hn.forEach(l),vo=p($),Re=r($,"TD",{align:!0});var mn=n(Re);To=a(mn,"\u221A"),mn.forEach(l),$.forEach(l),Eo=p(L),v=r(L,"TR",{});var z=n(v);je=r(z,"TD",{align:!0});var _n=n(je);Mo=a(_n,"1.12.100"),_n.forEach(l),bo=p(z),Ut=r(z,"TD",{align:!0}),n(Ut).forEach(l),yo=p(z),De=r(z,"TD",{align:!0});var vn=n(De);wo=a(vn,"\u221A"),vn.forEach(l),go=p(z),Le=r(z,"TD",{align:!0});var Tn=n(Le);Uo=a(Tn,"\u221A"),Tn.forEach(l),Co=p(z),Xe=r(z,"TD",{align:!0});var En=n(Xe);Po=a(En,"\u221A"),En.forEach(l),Io=p(z),ke=r(z,"TD",{align:!0});var Mn=n(ke);Jo=a(Mn,"\u221A"),Mn.forEach(l),z.forEach(l),$o=p(L),T=r(L,"TR",{});var A=n(T);Be=r(A,"TD",{align:!0});var bn=n(Be);zo=a(bn,"1.12.0"),bn.forEach(l),Ao=p(A),Ct=r(A,"TD",{align:!0}),n(Ct).forEach(l),xo=p(A),Se=r(A,"TD",{align:!0});var yn=n(Se);No=a(yn,"\u221A"),yn.forEach(l),Ro=p(A),Ge=r(A,"TD",{align:!0});var wn=n(Ge);jo=a(wn,"\u221A"),wn.forEach(l),Do=p(A),Ze=r(A,"TD",{align:!0});var gn=n(Ze);Lo=a(gn,"\u221A"),gn.forEach(l),Xo=p(A),Ve=r(A,"TD",{align:!0});var Un=n(Ve);ko=a(Un,"\u221A"),Un.forEach(l),A.forEach(l),Bo=p(L),E=r(L,"TR",{});var x=n(E);Qe=r(x,"TD",{align:!0});var Cn=n(Qe);So=a(Cn,"1.11.0"),Cn.forEach(l),Go=p(x),Pt=r(x,"TD",{align:!0}),n(Pt).forEach(l),Zo=p(x),We=r(x,"TD",{align:!0});var Pn=n(We);Vo=a(Pn,"\u221A"),Pn.forEach(l),Qo=p(x),He=r(x,"TD",{align:!0});var In=n(He);Wo=a(In,"\u221A"),In.forEach(l),Ho=p(x),Ye=r(x,"TD",{align:!0});var Jn=n(Ye);Yo=a(Jn,"\u221A"),Jn.forEach(l),Fo=p(x),Fe=r(x,"TD",{align:!0});var $n=n(Fe);Oo=a($n,"\u221A"),$n.forEach(l),x.forEach(l),qo=p(L),M=r(L,"TR",{});var N=n(M);Oe=r(N,"TD",{align:!0});var zn=n(Oe);Ko=a(zn,"1.10.0"),zn.forEach(l),er=p(N),qe=r(N,"TD",{align:!0});var An=n(qe);tr=a(An,"\u221A"),An.forEach(l),lr=p(N),Ke=r(N,"TD",{align:!0});var xn=n(Ke);or=a(xn,"\u221A"),xn.forEach(l),rr=p(N),et=r(N,"TD",{align:!0});var Nn=n(et);nr=a(Nn,"\u221A"),Nn.forEach(l),ir=p(N),tt=r(N,"TD",{align:!0});var Rn=n(tt);ar=a(Rn,"\u221A"),Rn.forEach(l),sr=p(N),It=r(N,"TD",{align:!0}),n(It).forEach(l),N.forEach(l),L.forEach(l),bl.forEach(l),Ht=p(e),g(ce.$$.fragment,e),Yt=p(e),D=r(e,"P",{});var ft=n(D);cr=a(ft,"dove "),Jt=r(ft,"CODE",{});var jn=n(Jt);pr=a(jn,"{pytorch_version}"),jn.forEach(l),dr=a(ft,` deve essere la tua versione di PyTorch, per l\u2019stanza 1.13.0.
Verifica altri approcci per `),pe=r(ft,"A",{href:!0,rel:!0});var Dn=n(pe);fr=a(Dn,"oneccl_bind_pt installation"),Dn.forEach(l),ur=a(ft,`.
Le versioni di oneCCL e PyTorch devono combaciare.`),ft.forEach(l),Ft=p(e),g(Y.$$.fragment,e),Ot=p(e),B=r(e,"H2",{class:!0});var yl=n(B);F=r(yl,"A",{id:!0,class:!0,href:!0});var Ln=n(F);$t=r(Ln,"SPAN",{});var Xn=n($t);g(de.$$.fragment,Xn),Xn.forEach(l),Ln.forEach(l),hr=p(yl),zt=r(yl,"SPAN",{});var kn=n(zt);mr=a(kn,"Intel\xAE MPI library"),kn.forEach(l),yl.forEach(l),qt=p(e),lt=r(e,"P",{});var Bn=n(lt);_r=a(Bn,"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."),Bn.forEach(l),Kt=p(e),ot=r(e,"P",{});var Sn=n(ot);vr=a(Sn,"oneccl_bindings_for_pytorch \xE8 installato insieme al set di strumenti MPI. Necessit\xE0 di reperire l\u2019ambiente prima di utilizzarlo."),Sn.forEach(l),el=p(e),rt=r(e,"P",{});var Gn=n(rt);Tr=a(Gn,"per Intel\xAE oneCCL >= 1.12.0"),Gn.forEach(l),tl=p(e),g(fe.$$.fragment,e),ll=p(e),nt=r(e,"P",{});var Zn=n(nt);Er=a(Zn,"per Intel\xAE oneCCL con versione < 1.12.0"),Zn.forEach(l),ol=p(e),g(ue.$$.fragment,e),rl=p(e),S=r(e,"H4",{class:!0});var wl=n(S);O=r(wl,"A",{id:!0,class:!0,href:!0});var Vn=n(O);At=r(Vn,"SPAN",{});var Qn=n(At);g(he.$$.fragment,Qn),Qn.forEach(l),Vn.forEach(l),Mr=p(wl),xt=r(wl,"SPAN",{});var Wn=n(xt);br=a(Wn,"Installazione IPEX:"),Wn.forEach(l),wl.forEach(l),nl=p(e),q=r(e,"P",{});var gl=n(q);yr=a(gl,"IPEX fornisce ottimizzazioni delle prestazioni per l\u2019addestramento della CPU sia con Float32 che con BFloat16; puoi fare riferimento a "),it=r(gl,"A",{href:!0});var Hn=n(it);wr=a(Hn,"single CPU section"),Hn.forEach(l),gr=a(gl,"."),gl.forEach(l),il=p(e),at=r(e,"P",{});var Yn=n(at);Ur=a(Yn,"Il seguente \u201CUtilizzo in Trainer\u201D prende come esempio mpirun nella libreria Intel\xAE MPI."),Yn.forEach(l),al=p(e),G=r(e,"H2",{class:!0});var Ul=n(G);K=r(Ul,"A",{id:!0,class:!0,href:!0});var Fn=n(K);Nt=r(Fn,"SPAN",{});var On=n(Nt);g(me.$$.fragment,On),On.forEach(l),Fn.forEach(l),Cr=p(Ul),Rt=r(Ul,"SPAN",{});var qn=n(Rt);Pr=a(qn,"Utilizzo in Trainer"),qn.forEach(l),Ul.forEach(l),sl=p(e),ee=r(e,"P",{});var Cl=n(ee);Ir=a(Cl,"Per abilitare l\u2019addestramento distribuito multi CPU nel Trainer con il ccl backend, gli utenti devono aggiungere "),jt=r(Cl,"STRONG",{});var Kn=n(jt);Dt=r(Kn,"CODE",{});var ei=n(Dt);Jr=a(ei,"--ddp_backend ccl"),ei.forEach(l),Kn.forEach(l),$r=a(Cl," negli argomenti del comando."),Cl.forEach(l),cl=p(e),_e=r(e,"P",{});var Xr=n(_e);zr=a(Xr,"Vediamo un esempio per il "),ve=r(Xr,"A",{href:!0,rel:!0});var ti=n(ve);Ar=a(ti,"question-answering example"),ti.forEach(l),Xr.forEach(l),pl=p(e),st=r(e,"P",{});var li=n(st);xr=a(li,"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."),li.forEach(l),dl=p(e),g(Te.$$.fragment,e),fl=p(e),ct=r(e,"P",{});var oi=n(ct);Nr=a(oi,"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."),oi.forEach(l),ul=p(e),pt=r(e,"P",{});var ri=n(pt);Rr=a(ri,"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."),ri.forEach(l),hl=p(e),g(Ee.$$.fragment,e),ml=p(e),te=r(e,"P",{});var Pl=n(te);jr=a(Pl,"A questo punto, esegui il seguente comando nel nodo0 e "),Lt=r(Pl,"STRONG",{});var ni=n(Lt);Dr=a(ni,"4DDP"),ni.forEach(l),Lr=a(Pl," sar\xE0 abilitato in node0 e node1 con BF16 auto mixed precision:"),Pl.forEach(l),_l=p(e),g(Me.$$.fragment,e),this.h()},h(){s(u,"name","hf:doc:metadata"),s(u,"content",JSON.stringify(hi)),s(b,"id","addestramento-effciente-su-multiple-cpu"),s(b,"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(b,"href","#addestramento-effciente-su-multiple-cpu"),s(h,"class","relative group"),s(V,"id","intel-oneccl-bindings-per-pytorch"),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-oneccl-bindings-per-pytorch"),s(X,"class","relative group"),s(re,"href","https://github.com/oneapi-src/oneCCL"),s(re,"rel","nofollow"),s(ne,"href","https://spec.oneapi.com/versions/latest/elements/oneCCL/source/index.html"),s(ne,"rel","nofollow"),s(ie,"href","https://spec.oneapi.com/versions/latest/elements/oneCCL/source/index.html"),s(ie,"rel","nofollow"),s(ae,"href","https://github.com/intel/torch-ccl"),s(ae,"rel","nofollow"),s(W,"id","intel-oneccl-bindings-per-linstallazione-pytorch"),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","#intel-oneccl-bindings-per-linstallazione-pytorch"),s(k,"class","relative group"),s(Ue,"align","center"),s(Ce,"align","center"),s(Pe,"align","center"),s(Ie,"align","center"),s(Je,"align","center"),s($e,"align","center"),s(ze,"align","center"),s(gt,"align","center"),s(Ae,"align","center"),s(xe,"align","center"),s(Ne,"align","center"),s(Re,"align","center"),s(je,"align","center"),s(Ut,"align","center"),s(De,"align","center"),s(Le,"align","center"),s(Xe,"align","center"),s(ke,"align","center"),s(Be,"align","center"),s(Ct,"align","center"),s(Se,"align","center"),s(Ge,"align","center"),s(Ze,"align","center"),s(Ve,"align","center"),s(Qe,"align","center"),s(Pt,"align","center"),s(We,"align","center"),s(He,"align","center"),s(Ye,"align","center"),s(Fe,"align","center"),s(Oe,"align","center"),s(qe,"align","center"),s(Ke,"align","center"),s(et,"align","center"),s(tt,"align","center"),s(It,"align","center"),s(pe,"href","https://github.com/intel/torch-ccl"),s(pe,"rel","nofollow"),s(F,"id","intel-mpi-library"),s(F,"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(F,"href","#intel-mpi-library"),s(B,"class","relative group"),s(O,"id","installazione-ipex"),s(O,"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(O,"href","#installazione-ipex"),s(S,"class","relative group"),s(it,"href","./perf_train_cpu"),s(K,"id","utilizzo-in-trainer"),s(K,"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(K,"href","#utilizzo-in-trainer"),s(G,"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,Z,d),f(e,h,d),t(h,b),t(b,mt),U(le,mt,null),t(h,Il),t(h,_t),t(_t,Jl),f(e,kt,d),f(e,we,d),t(we,$l),f(e,Bt,d),f(e,X,d),t(X,V),t(V,vt),U(oe,vt,null),t(X,zl),t(X,Tt),t(Tt,Al),f(e,St,d),f(e,R,d),t(R,re),t(re,xl),t(R,Nl),t(R,ne),t(ne,Rl),t(R,jl),t(R,ie),t(ie,Dl),t(R,Ll),f(e,Gt,d),f(e,j,d),t(j,Xl),t(j,Et),t(Et,kl),t(j,Bl),t(j,Mt),t(Mt,Sl),t(j,Gl),f(e,Zt,d),f(e,Q,d),t(Q,Zl),t(Q,ae),t(ae,Vl),t(Q,Ql),f(e,Vt,d),f(e,k,d),t(k,W),t(W,bt),U(se,bt,null),t(k,Wl),t(k,yt),t(yt,Hl),f(e,Qt,d),f(e,ge,d),t(ge,Yl),f(e,Wt,d),f(e,H,d),t(H,wt),t(wt,m),t(m,Ue),t(Ue,Fl),t(m,Ol),t(m,Ce),t(Ce,ql),t(m,Kl),t(m,Pe),t(Pe,eo),t(m,to),t(m,Ie),t(Ie,lo),t(m,oo),t(m,Je),t(Je,ro),t(m,no),t(m,$e),t($e,io),t(H,ao),t(H,y),t(y,_),t(_,ze),t(ze,so),t(_,co),t(_,gt),t(_,po),t(_,Ae),t(Ae,fo),t(_,uo),t(_,xe),t(xe,ho),t(_,mo),t(_,Ne),t(Ne,_o),t(_,vo),t(_,Re),t(Re,To),t(y,Eo),t(y,v),t(v,je),t(je,Mo),t(v,bo),t(v,Ut),t(v,yo),t(v,De),t(De,wo),t(v,go),t(v,Le),t(Le,Uo),t(v,Co),t(v,Xe),t(Xe,Po),t(v,Io),t(v,ke),t(ke,Jo),t(y,$o),t(y,T),t(T,Be),t(Be,zo),t(T,Ao),t(T,Ct),t(T,xo),t(T,Se),t(Se,No),t(T,Ro),t(T,Ge),t(Ge,jo),t(T,Do),t(T,Ze),t(Ze,Lo),t(T,Xo),t(T,Ve),t(Ve,ko),t(y,Bo),t(y,E),t(E,Qe),t(Qe,So),t(E,Go),t(E,Pt),t(E,Zo),t(E,We),t(We,Vo),t(E,Qo),t(E,He),t(He,Wo),t(E,Ho),t(E,Ye),t(Ye,Yo),t(E,Fo),t(E,Fe),t(Fe,Oo),t(y,qo),t(y,M),t(M,Oe),t(Oe,Ko),t(M,er),t(M,qe),t(qe,tr),t(M,lr),t(M,Ke),t(Ke,or),t(M,rr),t(M,et),t(et,nr),t(M,ir),t(M,tt),t(tt,ar),t(M,sr),t(M,It),f(e,Ht,d),U(ce,e,d),f(e,Yt,d),f(e,D,d),t(D,cr),t(D,Jt),t(Jt,pr),t(D,dr),t(D,pe),t(pe,fr),t(D,ur),f(e,Ft,d),U(Y,e,d),f(e,Ot,d),f(e,B,d),t(B,F),t(F,$t),U(de,$t,null),t(B,hr),t(B,zt),t(zt,mr),f(e,qt,d),f(e,lt,d),t(lt,_r),f(e,Kt,d),f(e,ot,d),t(ot,vr),f(e,el,d),f(e,rt,d),t(rt,Tr),f(e,tl,d),U(fe,e,d),f(e,ll,d),f(e,nt,d),t(nt,Er),f(e,ol,d),U(ue,e,d),f(e,rl,d),f(e,S,d),t(S,O),t(O,At),U(he,At,null),t(S,Mr),t(S,xt),t(xt,br),f(e,nl,d),f(e,q,d),t(q,yr),t(q,it),t(it,wr),t(q,gr),f(e,il,d),f(e,at,d),t(at,Ur),f(e,al,d),f(e,G,d),t(G,K),t(K,Nt),U(me,Nt,null),t(G,Cr),t(G,Rt),t(Rt,Pr),f(e,sl,d),f(e,ee,d),t(ee,Ir),t(ee,jt),t(jt,Dt),t(Dt,Jr),t(ee,$r),f(e,cl,d),f(e,_e,d),t(_e,zr),t(_e,ve),t(ve,Ar),f(e,pl,d),f(e,st,d),t(st,xr),f(e,dl,d),U(Te,e,d),f(e,fl,d),f(e,ct,d),t(ct,Nr),f(e,ul,d),f(e,pt,d),t(pt,Rr),f(e,hl,d),U(Ee,e,d),f(e,ml,d),f(e,te,d),t(te,jr),t(te,Lt),t(Lt,Dr),t(te,Lr),f(e,_l,d),U(Me,e,d),vl=!0},p(e,[d]){const be={};d&2&&(be.$$scope={dirty:d,ctx:e}),Y.$set(be)},i(e){vl||(C(le.$$.fragment,e),C(oe.$$.fragment,e),C(se.$$.fragment,e),C(ce.$$.fragment,e),C(Y.$$.fragment,e),C(de.$$.fragment,e),C(fe.$$.fragment,e),C(ue.$$.fragment,e),C(he.$$.fragment,e),C(me.$$.fragment,e),C(Te.$$.fragment,e),C(Ee.$$.fragment,e),C(Me.$$.fragment,e),vl=!0)},o(e){P(le.$$.fragment,e),P(oe.$$.fragment,e),P(se.$$.fragment,e),P(ce.$$.fragment,e),P(Y.$$.fragment,e),P(de.$$.fragment,e),P(fe.$$.fragment,e),P(ue.$$.fragment,e),P(he.$$.fragment,e),P(me.$$.fragment,e),P(Te.$$.fragment,e),P(Ee.$$.fragment,e),P(Me.$$.fragment,e),vl=!1},d(e){l(u),e&&l(Z),e&&l(h),I(le),e&&l(kt),e&&l(we),e&&l(Bt),e&&l(X),I(oe),e&&l(St),e&&l(R),e&&l(Gt),e&&l(j),e&&l(Zt),e&&l(Q),e&&l(Vt),e&&l(k),I(se),e&&l(Qt),e&&l(ge),e&&l(Wt),e&&l(H),e&&l(Ht),I(ce,e),e&&l(Yt),e&&l(D),e&&l(Ft),I(Y,e),e&&l(Ot),e&&l(B),I(de),e&&l(qt),e&&l(lt),e&&l(Kt),e&&l(ot),e&&l(el),e&&l(rt),e&&l(tl),I(fe,e),e&&l(ll),e&&l(nt),e&&l(ol),I(ue,e),e&&l(rl),e&&l(S),I(he),e&&l(nl),e&&l(q),e&&l(il),e&&l(at),e&&l(al),e&&l(G),I(me),e&&l(sl),e&&l(ee),e&&l(cl),e&&l(_e),e&&l(pl),e&&l(st),e&&l(dl),I(Te,e),e&&l(fl),e&&l(ct),e&&l(ul),e&&l(pt),e&&l(hl),I(Ee,e),e&&l(ml),e&&l(te),e&&l(_l),I(Me,e)}}}const hi={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 mi(Xt){return pi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Mi extends ii{constructor(u){super();ai(this,u,mi,ui,si,{})}}export{Mi as default,hi as metadata};
