import{s as q,n as O,o as R}from"../chunks/scheduler.d9d004e7.js";import{S as B,i as D,e as g,s as r,c as H,h as F,a as p,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.02c268bd.js";function Q(G){let i,_,d,$,o,T,l,x,m,U="Training on a single device is as simple as in Transformers:",b,u,k=`<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,z='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=g("meta"),_=r(),d=g("p"),$=r(),H(o.$$.fragment),T=r(),H(l.$$.fragment),x=r(),m=g("p"),m.textContent=U,b=r(),u=g("ul"),u.innerHTML=k,v=r(),c=g("p"),c.innerHTML=z,w=r(),H(f.$$.fragment),y=r(),h=g("p"),this.h()},l(e){const t=F("svelte-u9bgzb",document.head);i=p(t,"META",{name:!0,content:!0}),t.forEach(a),_=s(e),d=p(e,"P",{}),j(d).forEach(a),$=s(e),C(o.$$.fragment,e),T=s(e),C(l.$$.fragment,e),x=s(e),m=p(e,"P",{"data-svelte-h":!0}),L(m)!=="svelte-176fioj"&&(m.textContent=U),b=s(e),u=p(e,"UL",{"data-svelte-h":!0}),L(u)!=="svelte-lvk8xg"&&(u.innerHTML=k),v=s(e),c=p(e,"P",{"data-svelte-h":!0}),L(c)!=="svelte-1tle27p"&&(c.innerHTML=z),w=s(e),C(f.$$.fragment,e),y=s(e),h=p(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,x,t),n(e,m,t),n(e,b,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(x),a(m),a(b),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};
