import{s as Ht,n as Ft,o as zt}from"../chunks/scheduler.889ebb13.js";import{S as Pt,i as Kt,g as s,s as r,u as M,A as Lt,h as n,f as t,c as o,j as c,v as w,y as h,k as i,o as p,a,w as y,d,t as m,x as u}from"../chunks/index.8980e686.js";import{I as re}from"../chunks/IconCopyLink.357761cd.js";import{C as k}from"../chunks/CodeBlock.25fc3430.js";function qt(Mt){let J,Ue,ye,be,f,$,de,x,nt,oe,wt="🤗 Accelerate를 활용한 분산 학습",Ce,W,yt='모델이 커지면서 병렬 처리는 제한된 하드웨어에서 더 큰 모델을 훈련하고 훈련 속도를 몇 배로 가속화하기 위한 전략으로 등장했습니다. Hugging Face에서는 사용자가 하나의 머신에 여러 개의 GPU를 사용하든 여러 머신에 여러 개의 GPU를 사용하든 모든 유형의 분산 설정에서 🤗 Transformers 모델을 쉽게 훈련할 수 있도록 돕기 위해 <a href="https://huggingface.co/docs/accelerate" rel="nofollow">🤗 Accelerate</a> 라이브러리를 만들었습니다. 이 튜토리얼에서는 분산 환경에서 훈련할 수 있도록 기본 PyTorch 훈련 루프를 커스터마이즈하는 방법을 알아봅시다.',$e,j,I,me,X,rt,ie,dt="설정",Ie,G,mt="🤗 Accelerate 설치 시작하기:",Ae,Y,ge,N,ut="그 다음, <code>Accelerator</code> 객체를 불러오고 생성합니다. <code>Accelerator</code>는 자동으로 분산 설정 유형을 감지하고 훈련에 필요한 모든 구성 요소를 초기화합니다. 장치에 모델을 명시적으로 배치할 필요는 없습니다.",Be,E,Ze,v,A,ue,S,ot,pe,Jt="가속화를 위한 준비",_e,V,ft="다음 단계는 관련된 모든 훈련 객체를 <code>prepare</code> 메소드에 전달하는 것입니다. 여기에는 훈련 및 평가 데이터로더, 모델 및 옵티마이저가 포함됩니다:",ke,R,xe,T,g,Je,Q,it,ce,jt="백워드(Backward)",We,H,vt="마지막으로 훈련 루프의 일반적인 <code>loss.backward()</code>를 🤗 Accelerate의 <code>backward</code> 메소드로 대체하기만 하면 됩니다:",Xe,F,Ge,z,Tt="다음 코드에서 볼 수 있듯이, 훈련 루프에 코드 네 줄만 추가하면 분산 학습을 활성화할 수 있습니다!",Ye,P,Ne,U,B,fe,K,pt,he,Ut="학습",Ee,L,bt="관련 코드를 추가한 후에는 스크립트나 Colaboratory와 같은 노트북에서 훈련을 시작하세요.",Se,b,Z,je,q,ct,Me,Ct="스크립트로 학습하기",Ve,D,$t="스크립트에서 훈련을 실행하는 경우, 다음 명령을 실행하여 구성 파일을 생성하고 저장합니다:",Re,O,Qe,ee,It="Then launch your training with:",He,te,Fe,C,_,ve,le,ht,we,At="노트북으로 학습하기",ze,ae,gt="Collaboratory의 TPU를 사용하려는 경우, 노트북에서도 🤗 Accelerate를 실행할 수 있습니다. 훈련을 담당하는 모든 코드를 함수로 감싸서 <code>notebook_launcher</code>에 전달하세요:",Pe,se,Ke,ne,Bt='🤗 Accelerate 및 다양한 기능에 대한 자세한 내용은 <a href="https://huggingface.co/docs/accelerate" rel="nofollow">documentation</a>를 참조하세요.',Le,Te,qe;return x=new re({}),X=new re({}),Y=new k({props:{code:"cGlwJTIwaW5zdGFsbCUyMGFjY2VsZXJhdGU=",highlighted:"pip install accelerate"}}),E=new k({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQSUwQWFjY2VsZXJhdG9yJTIwJTNEJTIwQWNjZWxlcmF0b3IoKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> Accelerator

<span class="hljs-meta">&gt;&gt;&gt; </span>accelerator = Accelerator()`}}),S=new re({}),R=new k({props:{code:"dHJhaW5fZGF0YWxvYWRlciUyQyUyMGV2YWxfZGF0YWxvYWRlciUyQyUyMG1vZGVsJTJDJTIwb3B0aW1pemVyJTIwJTNEJTIwYWNjZWxlcmF0b3IucHJlcGFyZSglMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhbG9hZGVyJTJDJTIwZXZhbF9kYXRhbG9hZGVyJTJDJTIwbW9kZWwlMkMlMjBvcHRpbWl6ZXIlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>train_dataloader, eval_dataloader, model, optimizer = accelerator.prepare(
<span class="hljs-meta">... </span>    train_dataloader, eval_dataloader, model, optimizer
<span class="hljs-meta">... </span>)`}}),Q=new re({}),F=new k({props:{code:"Zm9yJTIwZXBvY2glMjBpbiUyMHJhbmdlKG51bV9lcG9jaHMpJTNBJTBBJTIwJTIwJTIwJTIwZm9yJTIwYmF0Y2glMjBpbiUyMHRyYWluX2RhdGFsb2FkZXIlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKipiYXRjaCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYWNjZWxlcmF0b3IuYmFja3dhcmQobG9zcyklMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvcHRpbWl6ZXIuc3RlcCgpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbHJfc2NoZWR1bGVyLnN0ZXAoKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG9wdGltaXplci56ZXJvX2dyYWQoKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByb2dyZXNzX2Jhci51cGRhdGUoMSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> epoch <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_epochs):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dataloader:
<span class="hljs-meta">... </span>        outputs = model(**batch)
<span class="hljs-meta">... </span>        loss = outputs.loss
<span class="hljs-meta">... </span>        accelerator.backward(loss)

<span class="hljs-meta">... </span>        optimizer.step()
<span class="hljs-meta">... </span>        lr_scheduler.step()
<span class="hljs-meta">... </span>        optimizer.zero_grad()
<span class="hljs-meta">... </span>        progress_bar.update(<span class="hljs-number">1</span>)`}}),P=new k({props:{code:"JTJCJTIwZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBBY2NlbGVyYXRvciUwQSUyMCUyMGZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBvcnQlMjBBZGFtVyUyQyUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMkMlMjBnZXRfc2NoZWR1bGVyJTBBJTBBJTJCJTIwYWNjZWxlcmF0b3IlMjAlM0QlMjBBY2NlbGVyYXRvcigpJTBBJTBBJTIwJTIwbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50JTJDJTIwbnVtX2xhYmVscyUzRDIpJTBBJTIwJTIwb3B0aW1pemVyJTIwJTNEJTIwQWRhbVcobW9kZWwucGFyYW1ldGVycygpJTJDJTIwbHIlM0QzZS01KSUwQSUwQS0lMjBkZXZpY2UlMjAlM0QlMjB0b3JjaC5kZXZpY2UoJTIyY3VkYSUyMiklMjBpZiUyMHRvcmNoLmN1ZGEuaXNfYXZhaWxhYmxlKCklMjBlbHNlJTIwdG9yY2guZGV2aWNlKCUyMmNwdSUyMiklMEEtJTIwbW9kZWwudG8oZGV2aWNlKSUwQSUwQSUyQiUyMHRyYWluX2RhdGFsb2FkZXIlMkMlMjBldmFsX2RhdGFsb2FkZXIlMkMlMjBtb2RlbCUyQyUyMG9wdGltaXplciUyMCUzRCUyMGFjY2VsZXJhdG9yLnByZXBhcmUoJTBBJTJCJTIwJTIwJTIwJTIwJTIwdHJhaW5fZGF0YWxvYWRlciUyQyUyMGV2YWxfZGF0YWxvYWRlciUyQyUyMG1vZGVsJTJDJTIwb3B0aW1pemVyJTBBJTJCJTIwKSUwQSUwQSUyMCUyMG51bV9lcG9jaHMlMjAlM0QlMjAzJTBBJTIwJTIwbnVtX3RyYWluaW5nX3N0ZXBzJTIwJTNEJTIwbnVtX2Vwb2NocyUyMColMjBsZW4odHJhaW5fZGF0YWxvYWRlciklMEElMjAlMjBscl9zY2hlZHVsZXIlMjAlM0QlMjBnZXRfc2NoZWR1bGVyKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMmxpbmVhciUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMG9wdGltaXplciUzRG9wdGltaXplciUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMG51bV93YXJtdXBfc3RlcHMlM0QwJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwbnVtX3RyYWluaW5nX3N0ZXBzJTNEbnVtX3RyYWluaW5nX3N0ZXBzJTBBJTIwJTIwKSUwQSUwQSUyMCUyMHByb2dyZXNzX2JhciUyMCUzRCUyMHRxZG0ocmFuZ2UobnVtX3RyYWluaW5nX3N0ZXBzKSklMEElMEElMjAlMjBtb2RlbC50cmFpbigpJTBBJTIwJTIwZm9yJTIwZXBvY2glMjBpbiUyMHJhbmdlKG51bV9lcG9jaHMpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwZm9yJTIwYmF0Y2glMjBpbiUyMHRyYWluX2RhdGFsb2FkZXIlM0ElMEEtJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYmF0Y2glMjAlM0QlMjAlN0JrJTNBJTIwdi50byhkZXZpY2UpJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGJhdGNoLml0ZW1zKCklN0QlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKipiYXRjaCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBLSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvc3MuYmFja3dhcmQoKSUwQSUyQiUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGFjY2VsZXJhdG9yLmJhY2t3YXJkKGxvc3MpJTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwb3B0aW1pemVyLnN0ZXAoKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxyX3NjaGVkdWxlci5zdGVwKCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvcHRpbWl6ZXIuemVyb19ncmFkKCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcm9ncmVzc19iYXIudXBkYXRlKDEp",highlighted:`<span class="hljs-addition">+ from accelerate import Accelerator</span>
  from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler

<span class="hljs-addition">+ accelerator = Accelerator()</span>

  model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)
  optimizer = AdamW(model.parameters(), lr=3e-5)

<span class="hljs-deletion">- device = torch.device(&quot;cuda&quot;) if torch.cuda.is_available() else torch.device(&quot;cpu&quot;)</span>
<span class="hljs-deletion">- model.to(device)</span>

<span class="hljs-addition">+ train_dataloader, eval_dataloader, model, optimizer = accelerator.prepare(</span>
<span class="hljs-addition">+     train_dataloader, eval_dataloader, model, optimizer</span>
<span class="hljs-addition">+ )</span>

  num_epochs = 3
  num_training_steps = num_epochs * len(train_dataloader)
  lr_scheduler = get_scheduler(
      &quot;linear&quot;,
      optimizer=optimizer,
      num_warmup_steps=0,
      num_training_steps=num_training_steps
  )

  progress_bar = tqdm(range(num_training_steps))

  model.train()
  for epoch in range(num_epochs):
      for batch in train_dataloader:
<span class="hljs-deletion">-         batch = {k: v.to(device) for k, v in batch.items()}</span>
          outputs = model(**batch)
          loss = outputs.loss
<span class="hljs-deletion">-         loss.backward()</span>
<span class="hljs-addition">+         accelerator.backward(loss)</span>

          optimizer.step()
          lr_scheduler.step()
          optimizer.zero_grad()
          progress_bar.update(1)`}}),K=new re({}),q=new re({}),O=new k({props:{code:"YWNjZWxlcmF0ZSUyMGNvbmZpZw==",highlighted:"accelerate config"}}),te=new k({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMHRyYWluLnB5",highlighted:"accelerate launch train.py"}}),le=new re({}),se=new k({props:{code:"ZnJvbSUyMGFjY2VsZXJhdGUlMjBpbXBvcnQlMjBub3RlYm9va19sYXVuY2hlciUwQSUwQW5vdGVib29rX2xhdW5jaGVyKHRyYWluaW5nX2Z1bmN0aW9uKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> accelerate <span class="hljs-keyword">import</span> notebook_launcher

<span class="hljs-meta">&gt;&gt;&gt; </span>notebook_launcher(training_function)`}}),{c(){J=s("meta"),Ue=r(),ye=s("p"),be=r(),f=s("h1"),$=s("a"),de=s("span"),M(x.$$.fragment),nt=r(),oe=s("span"),oe.textContent=wt,Ce=r(),W=s("p"),W.innerHTML=yt,$e=r(),j=s("h2"),I=s("a"),me=s("span"),M(X.$$.fragment),rt=r(),ie=s("span"),ie.textContent=dt,Ie=r(),G=s("p"),G.textContent=mt,Ae=r(),M(Y.$$.fragment),ge=r(),N=s("p"),N.innerHTML=ut,Be=r(),M(E.$$.fragment),Ze=r(),v=s("h2"),A=s("a"),ue=s("span"),M(S.$$.fragment),ot=r(),pe=s("span"),pe.textContent=Jt,_e=r(),V=s("p"),V.innerHTML=ft,ke=r(),M(R.$$.fragment),xe=r(),T=s("h2"),g=s("a"),Je=s("span"),M(Q.$$.fragment),it=r(),ce=s("span"),ce.textContent=jt,We=r(),H=s("p"),H.innerHTML=vt,Xe=r(),M(F.$$.fragment),Ge=r(),z=s("p"),z.textContent=Tt,Ye=r(),M(P.$$.fragment),Ne=r(),U=s("h2"),B=s("a"),fe=s("span"),M(K.$$.fragment),pt=r(),he=s("span"),he.textContent=Ut,Ee=r(),L=s("p"),L.textContent=bt,Se=r(),b=s("h3"),Z=s("a"),je=s("span"),M(q.$$.fragment),ct=r(),Me=s("span"),Me.textContent=Ct,Ve=r(),D=s("p"),D.textContent=$t,Re=r(),M(O.$$.fragment),Qe=r(),ee=s("p"),ee.textContent=It,He=r(),M(te.$$.fragment),Fe=r(),C=s("h3"),_=s("a"),ve=s("span"),M(le.$$.fragment),ht=r(),we=s("span"),we.textContent=At,ze=r(),ae=s("p"),ae.innerHTML=gt,Pe=r(),M(se.$$.fragment),Ke=r(),ne=s("p"),ne.innerHTML=Bt,Le=r(),Te=s("p"),this.h()},l(e){const l=Lt("svelte-1phssyn",document.head);J=n(l,"META",{name:!0,content:!0}),l.forEach(t),Ue=o(e),ye=n(e,"P",{}),c(ye).forEach(t),be=o(e),f=n(e,"H1",{class:!0});var De=c(f);$=n(De,"A",{id:!0,class:!0,href:!0});var Zt=c($);de=n(Zt,"SPAN",{});var _t=c(de);w(x.$$.fragment,_t),_t.forEach(t),Zt.forEach(t),nt=o(De),oe=n(De,"SPAN",{"data-svelte-h":!0}),h(oe)!=="svelte-1pqw5b4"&&(oe.textContent=wt),De.forEach(t),Ce=o(e),W=n(e,"P",{"data-svelte-h":!0}),h(W)!=="svelte-1l3vzsc"&&(W.innerHTML=yt),$e=o(e),j=n(e,"H2",{class:!0});var Oe=c(j);I=n(Oe,"A",{id:!0,class:!0,href:!0});var kt=c(I);me=n(kt,"SPAN",{});var xt=c(me);w(X.$$.fragment,xt),xt.forEach(t),kt.forEach(t),rt=o(Oe),ie=n(Oe,"SPAN",{"data-svelte-h":!0}),h(ie)!=="svelte-13l6gjo"&&(ie.textContent=dt),Oe.forEach(t),Ie=o(e),G=n(e,"P",{"data-svelte-h":!0}),h(G)!=="svelte-1vp3931"&&(G.textContent=mt),Ae=o(e),w(Y.$$.fragment,e),ge=o(e),N=n(e,"P",{"data-svelte-h":!0}),h(N)!=="svelte-14p69wx"&&(N.innerHTML=ut),Be=o(e),w(E.$$.fragment,e),Ze=o(e),v=n(e,"H2",{class:!0});var et=c(v);A=n(et,"A",{id:!0,class:!0,href:!0});var Wt=c(A);ue=n(Wt,"SPAN",{});var Xt=c(ue);w(S.$$.fragment,Xt),Xt.forEach(t),Wt.forEach(t),ot=o(et),pe=n(et,"SPAN",{"data-svelte-h":!0}),h(pe)!=="svelte-16vbgpo"&&(pe.textContent=Jt),et.forEach(t),_e=o(e),V=n(e,"P",{"data-svelte-h":!0}),h(V)!=="svelte-ca2x7w"&&(V.innerHTML=ft),ke=o(e),w(R.$$.fragment,e),xe=o(e),T=n(e,"H2",{class:!0});var tt=c(T);g=n(tt,"A",{id:!0,class:!0,href:!0});var Gt=c(g);Je=n(Gt,"SPAN",{});var Yt=c(Je);w(Q.$$.fragment,Yt),Yt.forEach(t),Gt.forEach(t),it=o(tt),ce=n(tt,"SPAN",{"data-svelte-h":!0}),h(ce)!=="svelte-1pvz3rc"&&(ce.textContent=jt),tt.forEach(t),We=o(e),H=n(e,"P",{"data-svelte-h":!0}),h(H)!=="svelte-1cm2xwv"&&(H.innerHTML=vt),Xe=o(e),w(F.$$.fragment,e),Ge=o(e),z=n(e,"P",{"data-svelte-h":!0}),h(z)!=="svelte-4baxra"&&(z.textContent=Tt),Ye=o(e),w(P.$$.fragment,e),Ne=o(e),U=n(e,"H2",{class:!0});var lt=c(U);B=n(lt,"A",{id:!0,class:!0,href:!0});var Nt=c(B);fe=n(Nt,"SPAN",{});var Et=c(fe);w(K.$$.fragment,Et),Et.forEach(t),Nt.forEach(t),pt=o(lt),he=n(lt,"SPAN",{"data-svelte-h":!0}),h(he)!=="svelte-glxe6j"&&(he.textContent=Ut),lt.forEach(t),Ee=o(e),L=n(e,"P",{"data-svelte-h":!0}),h(L)!=="svelte-1l6nwy7"&&(L.textContent=bt),Se=o(e),b=n(e,"H3",{class:!0});var at=c(b);Z=n(at,"A",{id:!0,class:!0,href:!0});var St=c(Z);je=n(St,"SPAN",{});var Vt=c(je);w(q.$$.fragment,Vt),Vt.forEach(t),St.forEach(t),ct=o(at),Me=n(at,"SPAN",{"data-svelte-h":!0}),h(Me)!=="svelte-139iv3s"&&(Me.textContent=Ct),at.forEach(t),Ve=o(e),D=n(e,"P",{"data-svelte-h":!0}),h(D)!=="svelte-7jp99x"&&(D.textContent=$t),Re=o(e),w(O.$$.fragment,e),Qe=o(e),ee=n(e,"P",{"data-svelte-h":!0}),h(ee)!=="svelte-xc3fgn"&&(ee.textContent=It),He=o(e),w(te.$$.fragment,e),Fe=o(e),C=n(e,"H3",{class:!0});var st=c(C);_=n(st,"A",{id:!0,class:!0,href:!0});var Rt=c(_);ve=n(Rt,"SPAN",{});var Qt=c(ve);w(le.$$.fragment,Qt),Qt.forEach(t),Rt.forEach(t),ht=o(st),we=n(st,"SPAN",{"data-svelte-h":!0}),h(we)!=="svelte-3myqrs"&&(we.textContent=At),st.forEach(t),ze=o(e),ae=n(e,"P",{"data-svelte-h":!0}),h(ae)!=="svelte-11gpxs1"&&(ae.innerHTML=gt),Pe=o(e),w(se.$$.fragment,e),Ke=o(e),ne=n(e,"P",{"data-svelte-h":!0}),h(ne)!=="svelte-1ufkf96"&&(ne.innerHTML=Bt),Le=o(e),Te=n(e,"P",{}),c(Te).forEach(t),this.h()},h(){i(J,"name","hf:doc:metadata"),i(J,"content",JSON.stringify(Dt)),i($,"id","distributed-training-with-accelerate"),i($,"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"),i($,"href","#distributed-training-with-accelerate"),i(f,"class","relative group"),i(I,"id","setup"),i(I,"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"),i(I,"href","#setup"),i(j,"class","relative group"),i(A,"id","prepare-to-accelerate"),i(A,"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"),i(A,"href","#prepare-to-accelerate"),i(v,"class","relative group"),i(g,"id","backward"),i(g,"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"),i(g,"href","#backward"),i(T,"class","relative group"),i(B,"id","train"),i(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"),i(B,"href","#train"),i(U,"class","relative group"),i(Z,"id","train-with-a-script"),i(Z,"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"),i(Z,"href","#train-with-a-script"),i(b,"class","relative group"),i(_,"id","train-with-a-notebook"),i(_,"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"),i(_,"href","#train-with-a-notebook"),i(C,"class","relative group")},m(e,l){p(document.head,J),a(e,Ue,l),a(e,ye,l),a(e,be,l),a(e,f,l),p(f,$),p($,de),y(x,de,null),p(f,nt),p(f,oe),a(e,Ce,l),a(e,W,l),a(e,$e,l),a(e,j,l),p(j,I),p(I,me),y(X,me,null),p(j,rt),p(j,ie),a(e,Ie,l),a(e,G,l),a(e,Ae,l),y(Y,e,l),a(e,ge,l),a(e,N,l),a(e,Be,l),y(E,e,l),a(e,Ze,l),a(e,v,l),p(v,A),p(A,ue),y(S,ue,null),p(v,ot),p(v,pe),a(e,_e,l),a(e,V,l),a(e,ke,l),y(R,e,l),a(e,xe,l),a(e,T,l),p(T,g),p(g,Je),y(Q,Je,null),p(T,it),p(T,ce),a(e,We,l),a(e,H,l),a(e,Xe,l),y(F,e,l),a(e,Ge,l),a(e,z,l),a(e,Ye,l),y(P,e,l),a(e,Ne,l),a(e,U,l),p(U,B),p(B,fe),y(K,fe,null),p(U,pt),p(U,he),a(e,Ee,l),a(e,L,l),a(e,Se,l),a(e,b,l),p(b,Z),p(Z,je),y(q,je,null),p(b,ct),p(b,Me),a(e,Ve,l),a(e,D,l),a(e,Re,l),y(O,e,l),a(e,Qe,l),a(e,ee,l),a(e,He,l),y(te,e,l),a(e,Fe,l),a(e,C,l),p(C,_),p(_,ve),y(le,ve,null),p(C,ht),p(C,we),a(e,ze,l),a(e,ae,l),a(e,Pe,l),y(se,e,l),a(e,Ke,l),a(e,ne,l),a(e,Le,l),a(e,Te,l),qe=!0},p:Ft,i(e){qe||(d(x.$$.fragment,e),d(X.$$.fragment,e),d(Y.$$.fragment,e),d(E.$$.fragment,e),d(S.$$.fragment,e),d(R.$$.fragment,e),d(Q.$$.fragment,e),d(F.$$.fragment,e),d(P.$$.fragment,e),d(K.$$.fragment,e),d(q.$$.fragment,e),d(O.$$.fragment,e),d(te.$$.fragment,e),d(le.$$.fragment,e),d(se.$$.fragment,e),qe=!0)},o(e){m(x.$$.fragment,e),m(X.$$.fragment,e),m(Y.$$.fragment,e),m(E.$$.fragment,e),m(S.$$.fragment,e),m(R.$$.fragment,e),m(Q.$$.fragment,e),m(F.$$.fragment,e),m(P.$$.fragment,e),m(K.$$.fragment,e),m(q.$$.fragment,e),m(O.$$.fragment,e),m(te.$$.fragment,e),m(le.$$.fragment,e),m(se.$$.fragment,e),qe=!1},d(e){e&&(t(Ue),t(ye),t(be),t(f),t(Ce),t(W),t($e),t(j),t(Ie),t(G),t(Ae),t(ge),t(N),t(Be),t(Ze),t(v),t(_e),t(V),t(ke),t(xe),t(T),t(We),t(H),t(Xe),t(Ge),t(z),t(Ye),t(Ne),t(U),t(Ee),t(L),t(Se),t(b),t(Ve),t(D),t(Re),t(Qe),t(ee),t(He),t(Fe),t(C),t(ze),t(ae),t(Pe),t(Ke),t(ne),t(Le),t(Te)),t(J),u(x),u(X),u(Y,e),u(E,e),u(S),u(R,e),u(Q),u(F,e),u(P,e),u(K),u(q),u(O,e),u(te,e),u(le),u(se,e)}}}const Dt={local:"distributed-training-with-accelerate",sections:[{local:"setup",title:"설정"},{local:"prepare-to-accelerate",title:"가속화를 위한 준비"},{local:"backward",title:"백워드(Backward)"},{local:"train",sections:[{local:"train-with-a-script",title:"스크립트로 학습하기"},{local:"train-with-a-notebook",title:"노트북으로 학습하기"}],title:"학습"}],title:"🤗 Accelerate를 활용한 분산 학습"};function Ot(Mt){return zt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sl extends Pt{constructor(J){super(),Kt(this,J,Ot,qt,Ht,{})}}export{sl as component};
