import{s as q,n as O,o as R}from"../chunks/scheduler.d9d004e7.js";import{S as B,i as D,e as p,s as r,c as H,h as F,a as g,d as a,b as s,f as j,g as C,j as L,k as Y,l as I,m as n,n as M,t as E,o as S,p as A}from"../chunks/index.4a2b774c.js";import{C as J,H as K,E as N}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c93fcd94.js";function Q(G){let i,_,d,$,o,T,l,b,m,U="Training on a single device is as simple as in Transformers:",x,u,z='<li>You need to replace the Transformers’ <a href="https://huggingface.co/docs/transformers/main_classes/trainer" rel="nofollow"><code>Trainer</code></a> class with the <a href="https://huggingface.co/docs/optimum/habana/package_reference/trainer" rel="nofollow"><code>GaudiTrainer</code></a> class,</li> <li>You need to replace the Transformers’ <a href="https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments" rel="nofollow"><code>TrainingArguments</code></a> class with the <a href="/docs/optimum.habana/v1.19.0/en/package_reference/trainer#optimum.habana.GaudiTrainingArguments">GaudiTrainingArguments</a> class and add the following arguments:<ul><li><code>use_habana</code> to execute your script on an HPU,</li> <li><code>use_lazy_mode</code> to use lazy mode (recommended) or not (i.e. eager mode),</li> <li><code>gaudi_config_name</code> to give the name of (Hub) or the path to (local) your Gaudi configuration file.</li></ul></li>',v,c,k='To go further, we invite you to read our guides about <a href="../usage_guides/accelerate_training">accelerating training</a> and <a href="../usage_guides/pretraining">pretraining</a>.',w,f,y,h,P;return o=new J({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),l=new K({props:{title:"Single-HPU Training",local:"single-hpu-training",headingTag:"h1"}}),f=new N({props:{source:"https://github.com/huggingface/optimum-habana/blob/main/docs/source/tutorials/single_hpu.mdx"}}),{c(){i=p("meta"),_=r(),d=p("p"),$=r(),H(o.$$.fragment),T=r(),H(l.$$.fragment),b=r(),m=p("p"),m.textContent=U,x=r(),u=p("ul"),u.innerHTML=z,v=r(),c=p("p"),c.innerHTML=k,w=r(),H(f.$$.fragment),y=r(),h=p("p"),this.h()},l(e){const t=F("svelte-u9bgzb",document.head);i=g(t,"META",{name:!0,content:!0}),t.forEach(a),_=s(e),d=g(e,"P",{}),j(d).forEach(a),$=s(e),C(o.$$.fragment,e),T=s(e),C(l.$$.fragment,e),b=s(e),m=g(e,"P",{"data-svelte-h":!0}),L(m)!=="svelte-176fioj"&&(m.textContent=U),x=s(e),u=g(e,"UL",{"data-svelte-h":!0}),L(u)!=="svelte-16462e2"&&(u.innerHTML=z),v=s(e),c=g(e,"P",{"data-svelte-h":!0}),L(c)!=="svelte-1tle27p"&&(c.innerHTML=k),w=s(e),C(f.$$.fragment,e),y=s(e),h=g(e,"P",{}),j(h).forEach(a),this.h()},h(){Y(i,"name","hf:doc:metadata"),Y(i,"content",V)},m(e,t){I(document.head,i),n(e,_,t),n(e,d,t),n(e,$,t),M(o,e,t),n(e,T,t),M(l,e,t),n(e,b,t),n(e,m,t),n(e,x,t),n(e,u,t),n(e,v,t),n(e,c,t),n(e,w,t),M(f,e,t),n(e,y,t),n(e,h,t),P=!0},p:O,i(e){P||(E(o.$$.fragment,e),E(l.$$.fragment,e),E(f.$$.fragment,e),P=!0)},o(e){S(o.$$.fragment,e),S(l.$$.fragment,e),S(f.$$.fragment,e),P=!1},d(e){e&&(a(_),a(d),a($),a(T),a(b),a(m),a(x),a(u),a(v),a(c),a(w),a(y),a(h)),a(i),A(o,e),A(l,e),A(f,e)}}}const V='{"title":"Single-HPU Training","local":"single-hpu-training","sections":[],"depth":1}';function W(G){return R(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class te extends B{constructor(i){super(),D(this,i,W,Q,q,{})}}export{te as component};
