import{s as Tt,n as kt,o as qt}from"../chunks/scheduler.d9d004e7.js";import{S as Ft,i as Ht,e as s,s as r,c as m,h as jt,a as o,d as a,b as i,f,g as p,j as R,k as h,l as e,m as _,n as l,t as b,o as c,p as g}from"../chunks/index.4a2b774c.js";import{C as zt,H as Nt,E as Ut}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c93fcd94.js";import{D as P}from"../chunks/Docstring.783c4744.js";function At(wt){let $,W,K,X,E,Y,S,Z,n,I,mt,z,Lt="Set up training/inference hardware configurations and run distributed commands.",pt,v,V,lt,N,Rt="Multi-node configuration setup for DeepSpeed.",bt,x,M,ct,U,Pt="Single-card setup.",gt,y,T,ft,A,Et="Single-node multi-card configuration setup.",ht,D,k,$t,G,St="Single-node multi-card configuration setup for DeepSpeed.",_t,C,q,vt,O,It="Single-node multi-card configuration setup for mpirun.",xt,w,F,yt,B,Vt=`Returns the master address to use for multi-node runs with DeepSpeed.
Directly inspired from <a href="https://github.com/microsoft/DeepSpeed/blob/316c4a43e0802a979951ee17f735daf77ea9780f/deepspeed/autotuning/utils.py#L145" rel="nofollow">https://github.com/microsoft/DeepSpeed/blob/316c4a43e0802a979951ee17f735daf77ea9780f/deepspeed/autotuning/utils.py#L145</a>.`,Dt,L,H,Ct,J,Mt="Runs the desired command with configuration specified by the user.",tt,j,et,Q,nt;return E=new zt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),S=new Nt({props:{title:"DistributedRunner",local:"optimum.habana.distributed.DistributedRunner",headingTag:"h1"}}),I=new P({props:{name:"class optimum.habana.distributed.DistributedRunner",anchor:"optimum.habana.distributed.DistributedRunner",parameters:[{name:"command_list",val:": typing.List = []"},{name:"world_size",val:": int = 1"},{name:"hostfile",val:": typing.Union[str, pathlib.Path] = None"},{name:"use_mpi",val:": bool = False"},{name:"use_deepspeed",val:": bool = False"},{name:"master_port",val:": int = 29500"},{name:"use_env",val:": bool = False"},{name:"map_by",val:": bool = 'socket'"},{name:"multi_hls",val:" = None"}],source:"https://github.com/huggingface/optimum-habana/blob/v1.19.0/optimum/habana/distributed/distributed_runner.py#L32"}}),V=new P({props:{name:"create_multi_node_setup",anchor:"optimum.habana.distributed.DistributedRunner.create_multi_node_setup",parameters:[],source:"https://github.com/huggingface/optimum-habana/blob/v1.19.0/optimum/habana/distributed/distributed_runner.py#L188"}}),M=new P({props:{name:"create_single_card_setup",anchor:"optimum.habana.distributed.DistributedRunner.create_single_card_setup",parameters:[{name:"use_deepspeed",val:" = False"}],source:"https://github.com/huggingface/optimum-habana/blob/v1.19.0/optimum/habana/distributed/distributed_runner.py#L147"}}),T=new P({props:{name:"create_single_node_setup",anchor:"optimum.habana.distributed.DistributedRunner.create_single_node_setup",parameters:[],source:"https://github.com/huggingface/optimum-habana/blob/v1.19.0/optimum/habana/distributed/distributed_runner.py#L177"}}),k=new P({props:{name:"create_single_node_setup_deepspeed",anchor:"optimum.habana.distributed.DistributedRunner.create_single_node_setup_deepspeed",parameters:[],source:"https://github.com/huggingface/optimum-habana/blob/v1.19.0/optimum/habana/distributed/distributed_runner.py#L168"}}),q=new P({props:{name:"create_single_node_setup_mpirun",anchor:"optimum.habana.distributed.DistributedRunner.create_single_node_setup_mpirun",parameters:[],source:"https://github.com/huggingface/optimum-habana/blob/v1.19.0/optimum/habana/distributed/distributed_runner.py#L157"}}),F=new P({props:{name:"process_hostfile",anchor:"optimum.habana.distributed.DistributedRunner.process_hostfile",parameters:[],source:"https://github.com/huggingface/optimum-habana/blob/v1.19.0/optimum/habana/distributed/distributed_runner.py#L230",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>address of the master node.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>str</p>
`}}),H=new P({props:{name:"run",anchor:"optimum.habana.distributed.DistributedRunner.run",parameters:[],source:"https://github.com/huggingface/optimum-habana/blob/v1.19.0/optimum/habana/distributed/distributed_runner.py#L196"}}),j=new Ut({props:{source:"https://github.com/huggingface/optimum-habana/blob/main/docs/source/package_reference/distributed_runner.mdx"}}),{c(){$=s("meta"),W=r(),K=s("p"),X=r(),m(E.$$.fragment),Y=r(),m(S.$$.fragment),Z=r(),n=s("div"),m(I.$$.fragment),mt=r(),z=s("p"),z.textContent=Lt,pt=r(),v=s("div"),m(V.$$.fragment),lt=r(),N=s("p"),N.textContent=Rt,bt=r(),x=s("div"),m(M.$$.fragment),ct=r(),U=s("p"),U.textContent=Pt,gt=r(),y=s("div"),m(T.$$.fragment),ft=r(),A=s("p"),A.textContent=Et,ht=r(),D=s("div"),m(k.$$.fragment),$t=r(),G=s("p"),G.textContent=St,_t=r(),C=s("div"),m(q.$$.fragment),vt=r(),O=s("p"),O.textContent=It,xt=r(),w=s("div"),m(F.$$.fragment),yt=r(),B=s("p"),B.innerHTML=Vt,Dt=r(),L=s("div"),m(H.$$.fragment),Ct=r(),J=s("p"),J.textContent=Mt,tt=r(),m(j.$$.fragment),et=r(),Q=s("p"),this.h()},l(t){const u=jt("svelte-u9bgzb",document.head);$=o(u,"META",{name:!0,content:!0}),u.forEach(a),W=i(t),K=o(t,"P",{}),f(K).forEach(a),X=i(t),p(E.$$.fragment,t),Y=i(t),p(S.$$.fragment,t),Z=i(t),n=o(t,"DIV",{class:!0});var d=f(n);p(I.$$.fragment,d),mt=i(d),z=o(d,"P",{"data-svelte-h":!0}),R(z)!=="svelte-ceghej"&&(z.textContent=Lt),pt=i(d),v=o(d,"DIV",{class:!0});var rt=f(v);p(V.$$.fragment,rt),lt=i(rt),N=o(rt,"P",{"data-svelte-h":!0}),R(N)!=="svelte-3sx07p"&&(N.textContent=Rt),rt.forEach(a),bt=i(d),x=o(d,"DIV",{class:!0});var at=f(x);p(M.$$.fragment,at),ct=i(at),U=o(at,"P",{"data-svelte-h":!0}),R(U)!=="svelte-1t3oqg2"&&(U.textContent=Pt),at.forEach(a),gt=i(d),y=o(d,"DIV",{class:!0});var it=f(y);p(T.$$.fragment,it),ft=i(it),A=o(it,"P",{"data-svelte-h":!0}),R(A)!=="svelte-141ladm"&&(A.textContent=Et),it.forEach(a),ht=i(d),D=o(d,"DIV",{class:!0});var st=f(D);p(k.$$.fragment,st),$t=i(st),G=o(st,"P",{"data-svelte-h":!0}),R(G)!=="svelte-5usqs4"&&(G.textContent=St),st.forEach(a),_t=i(d),C=o(d,"DIV",{class:!0});var ot=f(C);p(q.$$.fragment,ot),vt=i(ot),O=o(ot,"P",{"data-svelte-h":!0}),R(O)!=="svelte-15ufkk2"&&(O.textContent=It),ot.forEach(a),xt=i(d),w=o(d,"DIV",{class:!0});var dt=f(w);p(F.$$.fragment,dt),yt=i(dt),B=o(dt,"P",{"data-svelte-h":!0}),R(B)!=="svelte-11ec4hf"&&(B.innerHTML=Vt),dt.forEach(a),Dt=i(d),L=o(d,"DIV",{class:!0});var ut=f(L);p(H.$$.fragment,ut),Ct=i(ut),J=o(ut,"P",{"data-svelte-h":!0}),R(J)!=="svelte-1qjnsdl"&&(J.textContent=Mt),ut.forEach(a),d.forEach(a),tt=i(t),p(j.$$.fragment,t),et=i(t),Q=o(t,"P",{}),f(Q).forEach(a),this.h()},h(){h($,"name","hf:doc:metadata"),h($,"content",Gt),h(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(n,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,$),_(t,W,u),_(t,K,u),_(t,X,u),l(E,t,u),_(t,Y,u),l(S,t,u),_(t,Z,u),_(t,n,u),l(I,n,null),e(n,mt),e(n,z),e(n,pt),e(n,v),l(V,v,null),e(v,lt),e(v,N),e(n,bt),e(n,x),l(M,x,null),e(x,ct),e(x,U),e(n,gt),e(n,y),l(T,y,null),e(y,ft),e(y,A),e(n,ht),e(n,D),l(k,D,null),e(D,$t),e(D,G),e(n,_t),e(n,C),l(q,C,null),e(C,vt),e(C,O),e(n,xt),e(n,w),l(F,w,null),e(w,yt),e(w,B),e(n,Dt),e(n,L),l(H,L,null),e(L,Ct),e(L,J),_(t,tt,u),l(j,t,u),_(t,et,u),_(t,Q,u),nt=!0},p:kt,i(t){nt||(b(E.$$.fragment,t),b(S.$$.fragment,t),b(I.$$.fragment,t),b(V.$$.fragment,t),b(M.$$.fragment,t),b(T.$$.fragment,t),b(k.$$.fragment,t),b(q.$$.fragment,t),b(F.$$.fragment,t),b(H.$$.fragment,t),b(j.$$.fragment,t),nt=!0)},o(t){c(E.$$.fragment,t),c(S.$$.fragment,t),c(I.$$.fragment,t),c(V.$$.fragment,t),c(M.$$.fragment,t),c(T.$$.fragment,t),c(k.$$.fragment,t),c(q.$$.fragment,t),c(F.$$.fragment,t),c(H.$$.fragment,t),c(j.$$.fragment,t),nt=!1},d(t){t&&(a(W),a(K),a(X),a(Y),a(Z),a(n),a(tt),a(et),a(Q)),a($),g(E,t),g(S,t),g(I),g(V),g(M),g(T),g(k),g(q),g(F),g(H),g(j,t)}}}const Gt='{"title":"DistributedRunner","local":"optimum.habana.distributed.DistributedRunner","sections":[],"depth":1}';function Ot(wt){return qt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wt extends Ft{constructor($){super(),Ht(this,$,Ot,At,Tt,{})}}export{Wt as component};
