import{s as $t,n as dt,o as gt}from"../chunks/scheduler.eb244325.js";import{S as ht,i as wt,e as o,s as a,c as p,h as bt,a as r,d as l,b as i,f as ft,g as m,j as d,k as ut,l as vt,m as n,n as c,t as f,o as u,p as $}from"../chunks/index.3fe63ad3.js";import{C as Tt}from"../chunks/CopyLLMTxtMenu.88bde5f2.js";import{C as lt}from"../chunks/CodeBlock.934d290d.js";import{H as et,E as yt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.341974a5.js";function Ct(nt){let s,G,H,j,g,z,h,F,w,at="LeRobot supports multiple hardware acceleration options for both training and inference.",N,b,it="These options include:",W,v,ot="<li><strong>CPU</strong>: CPU executes all computations, no dedicated accelerator is used</li> <li><strong>CUDA</strong>: acceleration with NVIDIA &amp; AMD GPUs</li> <li><strong>MPS</strong>: acceleration with Apple Silicon GPUs</li> <li><strong>XPU</strong>: acceleration with Intel integrated and discrete GPUs</li>",A,T,D,y,rt="To use particular accelerator, a suitable version of PyTorch should be installed.",E,C,st=`For CPU, CUDA, and MPS backends follow instructions provided on <a href="https://pytorch.org/get-started/locally" rel="nofollow">PyTorch installation page</a>.
For XPU backend, follow instructions from <a href="https://docs.pytorch.org/docs/stable/notes/get_start_xpu.html" rel="nofollow">PyTorch documentation</a>.`,V,x,X,_,pt="After installation, accelerator availability can be verified by running",B,P,Y,J,R,M,mt="To select the desired accelerator, use the <code>--policy.device</code> flag when running <code>lerobot-train</code> or <code>lerobot-eval</code>. For example, to use MPS on Apple Silicon, run:",Z,U,q,I,K,L,ct="However, in most cases, presence of an accelerator is detected automatically and <code>policy.device</code> parameter can be omitted from CLI commands.",O,k,Q,S,tt;return g=new Tt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),h=new et({props:{title:"PyTorch accelerators",local:"pytorch-accelerators",headingTag:"h1"}}),T=new et({props:{title:"Getting Started",local:"getting-started",headingTag:"h2"}}),x=new et({props:{title:"Verifying the installation",local:"verifying-the-installation",headingTag:"h3"}}),P=new lt({props:{code:"aW1wb3J0JTIwdG9yY2glMEFwcmludCh0b3JjaC4lM0NiYWNrZW5kX25hbWUlM0UuaXNfYXZhaWxhYmxlKCkpJTIwJTIwJTIzJTIwJTNDYmFja2VuZF9uYW1lJTNFJTIwaXMlMjBjdWRhJTJDJTIwbXBzJTJDJTIwb3IlMjB4cHU=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-built_in">print</span>(torch.&lt;backend_name&gt;.is_available())  <span class="hljs-comment"># &lt;backend_name&gt; is cuda, mps, or xpu</span>`,wrap:!1}}),J=new et({props:{title:"How to run training or evaluation",local:"how-to-run-training-or-evaluation",headingTag:"h2"}}),U=new lt({props:{code:"bGVyb2JvdC10cmFpbiUwQSUyMCUyMCUyMCUyMC0tcG9saWN5LmRldmljZSUzRG1wcyUyMC4uLg==",highlighted:`lerobot-train
    --policy.device=mps ...`,wrap:!1}}),I=new lt({props:{code:"bGVyb2JvdC1ldmFsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1wb2xpY3kuZGV2aWNlJTNEbXBzJTIwLi4u",highlighted:`lerobot-eval \\
    --policy.device=mps ...`,wrap:!1}}),k=new yt({props:{source:"https://github.com/huggingface/lerobot/blob/main/docs/source/torch_accelerators.mdx"}}),{c(){s=o("meta"),G=a(),H=o("p"),j=a(),p(g.$$.fragment),z=a(),p(h.$$.fragment),F=a(),w=o("p"),w.textContent=at,N=a(),b=o("p"),b.textContent=it,W=a(),v=o("ul"),v.innerHTML=ot,A=a(),p(T.$$.fragment),D=a(),y=o("p"),y.textContent=rt,E=a(),C=o("p"),C.innerHTML=st,V=a(),p(x.$$.fragment),X=a(),_=o("p"),_.textContent=pt,B=a(),p(P.$$.fragment),Y=a(),p(J.$$.fragment),R=a(),M=o("p"),M.innerHTML=mt,Z=a(),p(U.$$.fragment),q=a(),p(I.$$.fragment),K=a(),L=o("p"),L.innerHTML=ct,O=a(),p(k.$$.fragment),Q=a(),S=o("p"),this.h()},l(t){const e=bt("svelte-u9bgzb",document.head);s=r(e,"META",{name:!0,content:!0}),e.forEach(l),G=i(t),H=r(t,"P",{}),ft(H).forEach(l),j=i(t),m(g.$$.fragment,t),z=i(t),m(h.$$.fragment,t),F=i(t),w=r(t,"P",{"data-svelte-h":!0}),d(w)!=="svelte-9br23v"&&(w.textContent=at),N=i(t),b=r(t,"P",{"data-svelte-h":!0}),d(b)!=="svelte-aoy7zn"&&(b.textContent=it),W=i(t),v=r(t,"UL",{"data-svelte-h":!0}),d(v)!=="svelte-1lovx1z"&&(v.innerHTML=ot),A=i(t),m(T.$$.fragment,t),D=i(t),y=r(t,"P",{"data-svelte-h":!0}),d(y)!=="svelte-kzv48s"&&(y.textContent=rt),E=i(t),C=r(t,"P",{"data-svelte-h":!0}),d(C)!=="svelte-1a0l81x"&&(C.innerHTML=st),V=i(t),m(x.$$.fragment,t),X=i(t),_=r(t,"P",{"data-svelte-h":!0}),d(_)!=="svelte-1ektpnp"&&(_.textContent=pt),B=i(t),m(P.$$.fragment,t),Y=i(t),m(J.$$.fragment,t),R=i(t),M=r(t,"P",{"data-svelte-h":!0}),d(M)!=="svelte-rdr9oe"&&(M.innerHTML=mt),Z=i(t),m(U.$$.fragment,t),q=i(t),m(I.$$.fragment,t),K=i(t),L=r(t,"P",{"data-svelte-h":!0}),d(L)!=="svelte-t75td8"&&(L.innerHTML=ct),O=i(t),m(k.$$.fragment,t),Q=i(t),S=r(t,"P",{}),ft(S).forEach(l),this.h()},h(){ut(s,"name","hf:doc:metadata"),ut(s,"content",xt)},m(t,e){vt(document.head,s),n(t,G,e),n(t,H,e),n(t,j,e),c(g,t,e),n(t,z,e),c(h,t,e),n(t,F,e),n(t,w,e),n(t,N,e),n(t,b,e),n(t,W,e),n(t,v,e),n(t,A,e),c(T,t,e),n(t,D,e),n(t,y,e),n(t,E,e),n(t,C,e),n(t,V,e),c(x,t,e),n(t,X,e),n(t,_,e),n(t,B,e),c(P,t,e),n(t,Y,e),c(J,t,e),n(t,R,e),n(t,M,e),n(t,Z,e),c(U,t,e),n(t,q,e),c(I,t,e),n(t,K,e),n(t,L,e),n(t,O,e),c(k,t,e),n(t,Q,e),n(t,S,e),tt=!0},p:dt,i(t){tt||(f(g.$$.fragment,t),f(h.$$.fragment,t),f(T.$$.fragment,t),f(x.$$.fragment,t),f(P.$$.fragment,t),f(J.$$.fragment,t),f(U.$$.fragment,t),f(I.$$.fragment,t),f(k.$$.fragment,t),tt=!0)},o(t){u(g.$$.fragment,t),u(h.$$.fragment,t),u(T.$$.fragment,t),u(x.$$.fragment,t),u(P.$$.fragment,t),u(J.$$.fragment,t),u(U.$$.fragment,t),u(I.$$.fragment,t),u(k.$$.fragment,t),tt=!1},d(t){t&&(l(G),l(H),l(j),l(z),l(F),l(w),l(N),l(b),l(W),l(v),l(A),l(D),l(y),l(E),l(C),l(V),l(X),l(_),l(B),l(Y),l(R),l(M),l(Z),l(q),l(K),l(L),l(O),l(Q),l(S)),l(s),$(g,t),$(h,t),$(T,t),$(x,t),$(P,t),$(J,t),$(U,t),$(I,t),$(k,t)}}}const xt='{"title":"PyTorch accelerators","local":"pytorch-accelerators","sections":[{"title":"Getting Started","local":"getting-started","sections":[{"title":"Verifying the installation","local":"verifying-the-installation","sections":[],"depth":3}],"depth":2},{"title":"How to run training or evaluation","local":"how-to-run-training-or-evaluation","sections":[],"depth":2}],"depth":1}';function _t(nt){return gt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Lt extends ht{constructor(s){super(),wt(this,s,_t,Ct,$t,{})}}export{Lt as component};
