import{s as je,o as we,n as Z}from"../chunks/scheduler.bdbef820.js";import{S as ye,i as fe,g as i,s as r,r as T,A as Ue,h as c,f as a,c as p,j as oe,u as J,x as o,k as Te,y as de,a as e,v as j,d as w,t as y,w as f}from"../chunks/index.33f81d56.js";import{T as sl}from"../chunks/Tip.34194030.js";import{C as g}from"../chunks/CodeBlock.362b34a4.js";import{H as B,E as ue}from"../chunks/EditOnGithub.a9246e21.js";import{H as Je,a as Ps}from"../chunks/HfOption.6b792247.js";function he(h){let t,M='Transformers는 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 클래스 외에도 번역이나 요약과 같은 시퀀스-투-시퀀스 작업을 위한 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Seq2SeqTrainer">Seq2SeqTrainer</a> 클래스도 제공합니다. 또한 <a href="https://hf.co/docs/trl" rel="nofollow">TRL</a> 라이브러리에는 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 클래스를 감싸고 Llama-2 및 Mistral과 같은 언어 모델을 자동 회귀 기법으로 훈련하는 데 최적화된 <code>SFTTrainer</code> 클래스 입니다. <code>SFTTrainer</code>는 시퀀스 패킹, LoRA, 양자화 및 DeepSpeed와 같은 기능을 지원하여 크기 상관없이 모델 효율적으로 확장할 수 있습니다.',n,U,d,u,b='이들 다른 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 유형 클래스에 대해 더 알고 싶다면 <a href="./main_classes/trainer">API 참조</a>를 확인하여 언제 어떤 클래스가 적합할지 얼마든지 확인하세요. 일반적으로 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>는 가장 다재다능한 옵션으로, 다양한 작업에 적합합니다. <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Seq2SeqTrainer">Seq2SeqTrainer</a>는 시퀀스-투-시퀀스 작업을 위해 설계되었고, <code>SFTTrainer</code>는 언어 모델 훈련을 위해 설계되었습니다.';return{c(){t=i("p"),t.innerHTML=M,n=r(),U=i("br"),d=r(),u=i("p"),u.innerHTML=b},l(I){t=c(I,"P",{"data-svelte-h":!0}),o(t)!=="svelte-5iruxw"&&(t.innerHTML=M),n=p(I),U=c(I,"BR",{}),d=p(I),u=c(I,"P",{"data-svelte-h":!0}),o(u)!=="svelte-st2ci8"&&(u.innerHTML=b)},m(I,A){e(I,t,A),e(I,n,A),e(I,U,A),e(I,d,A),e(I,u,A)},p:Z,d(I){I&&(a(t),a(n),a(U),a(d),a(u))}}}function _e(h){let t,M='로깅 API에 대한 자세한 내용은 <a href="./main_classes/logging">로깅</a> API 레퍼런스를 확인하세요.';return{c(){t=i("p"),t.innerHTML=M},l(n){t=c(n,"P",{"data-svelte-h":!0}),o(t)!=="svelte-1djg64a"&&(t.innerHTML=M)},m(n,U){e(n,t,U)},p:Z,d(n){n&&a(t)}}}function be(h){let t,M='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>는 <code>Trainer.__init__()</code> 메소드에서 각 노드에 대해 로그 레벨을 별도로 설정하므로, 다른 Transformers 기능을 사용할 경우 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 객체를 생성하기 전에 이를 미리 설정하는 것이 좋습니다.';return{c(){t=i("p"),t.innerHTML=M},l(n){t=c(n,"P",{"data-svelte-h":!0}),o(t)!=="svelte-t3i6y7"&&(t.innerHTML=M)},m(n,U){e(n,t,U)},p:Z,d(n){n&&a(t)}}}function Ie(h){let t,M;return t=new g({props:{code:"bXlfYXBwLnB5JTIwLi4uJTIwLS1sb2dfbGV2ZWwlMjB3YXJuaW5nJTIwLS1sb2dfbGV2ZWxfcmVwbGljYSUyMGVycm9y",highlighted:"my_app.py ... --log_level warning --log_level_replica error",wrap:!1}}),{c(){T(t.$$.fragment)},l(n){J(t.$$.fragment,n)},m(n,U){j(t,n,U),M=!0},p:Z,i(n){M||(w(t.$$.fragment,n),M=!0)},o(n){y(t.$$.fragment,n),M=!1},d(n){f(t,n)}}}function ge(h){let t,M="멀티 노드 환경에서는 <code>log_on_each_node 0</code> 매개변수를 추가합니다.",n,U,d;return U=new g({props:{code:"bXlfYXBwLnB5JTIwLi4uJTIwLS1sb2dfbGV2ZWwlMjB3YXJuaW5nJTIwLS1sb2dfbGV2ZWxfcmVwbGljYSUyMGVycm9yJTIwLS1sb2dfb25fZWFjaF9ub2RlJTIwMCUwQSUwQSUyMyUyMCVFQyU5OCVBNCVFQiVBNSU5OCVFQiVBNyU4QyUyMCVFQiVCMyVCNCVFQSVCMyVBMCVFRCU5NSU5OCVFQiU4RiU4NCVFQiVBMSU5RCUyMCVFQyU4NCVBNCVFQyVBMCU5NSUwQW15X2FwcC5weSUyMC4uLiUyMC0tbG9nX2xldmVsJTIwZXJyb3IlMjAtLWxvZ19sZXZlbF9yZXBsaWNhJTIwZXJyb3IlMjAtLWxvZ19vbl9lYWNoX25vZGUlMjAw",highlighted:`my_app.py ... --log_level warning --log_level_replica error --log_on_each_node 0

<span class="hljs-comment"># 오류만 보고하도록 설정</span>
my_app.py ... --log_level error --log_level_replica error --log_on_each_node 0`,wrap:!1}}),{c(){t=i("p"),t.innerHTML=M,n=r(),T(U.$$.fragment)},l(u){t=c(u,"P",{"data-svelte-h":!0}),o(t)!=="svelte-1tjciiw"&&(t.innerHTML=M),n=p(u),J(U.$$.fragment,u)},m(u,b){e(u,t,b),e(u,n,b),j(U,u,b),d=!0},p:Z,i(u){d||(w(U.$$.fragment,u),d=!0)},o(u){y(U.$$.fragment,u),d=!1},d(u){u&&(a(t),a(n)),f(U,u)}}}function Ae(h){let t,M,n,U;return t=new Ps({props:{id:"logging",option:"single node",$$slots:{default:[Ie]},$$scope:{ctx:h}}}),n=new Ps({props:{id:"logging",option:"multi-node",$$slots:{default:[ge]},$$scope:{ctx:h}}}),{c(){T(t.$$.fragment),M=r(),T(n.$$.fragment)},l(d){J(t.$$.fragment,d),M=p(d),J(n.$$.fragment,d)},m(d,u){j(t,d,u),e(d,M,u),j(n,d,u),U=!0},p(d,u){const b={};u&2&&(b.$$scope={dirty:u,ctx:d}),t.$set(b);const I={};u&2&&(I.$$scope={dirty:u,ctx:d}),n.$set(I)},i(d){U||(w(t.$$.fragment,d),w(n.$$.fragment,d),U=!0)},o(d){y(t.$$.fragment,d),y(n.$$.fragment,d),U=!1},d(d){d&&a(M),f(t,d),f(n,d)}}}function Ce(h){let t,M="저자에 따르면, <code>grad_norm</code> 없이 <code>AdaLomo</code>를 사용하는 것이 더 나은 성능과 높은 처리량을 제공한다고 합니다.";return{c(){t=i("p"),t.innerHTML=M},l(n){t=c(n,"P",{"data-svelte-h":!0}),o(t)!=="svelte-733wbz"&&(t.innerHTML=M)},m(n,U){e(n,t,U)},p:Z,d(n){n&&a(t)}}}function Ze(h){let t,M='FSDP 샤딩 전략, CPU 오프로드 및 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>와 함께 사용할 수 있는 더 많은 기능을 알아보려면 <a href="fsdp">Fully Sharded Data Parallel</a> 가이드를 확인하세요.';return{c(){t=i("p"),t.innerHTML=M},l(n){t=c(n,"P",{"data-svelte-h":!0}),o(t)!=="svelte-dmycbk"&&(t.innerHTML=M)},m(n,U){e(n,t,U)},p:Z,d(n){n&&a(t)}}}function Ve(h){let t,M;return t=new g({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMj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ZCUzQSUyMHN0YXRpYyUwQXNhbWVfbmV0d29yayUzQSUyMHRydWUlMEF0cHVfZW52JTNBJTIwJTVCJTVEJTBBdHB1X3VzZV9jbHVzdGVyJTNBJTIwZmFsc2UlMEF0cHVfdXNlX3N1ZG8lM0ElMjBmYWxzZSUwQXVzZV9jcHUlM0ElMjBmYWxzZQ==",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>                                                                                             
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">MULTI_GPU</span>                                                                                                    
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">gpu_ids:</span> <span class="hljs-string">all</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span> <span class="hljs-comment"># 노드에 따라 순위를 변경하세요</span>
<span class="hljs-attr">main_process_ip:</span> <span class="hljs-number">192.168</span><span class="hljs-number">.20</span><span class="hljs-number">.1</span>
<span class="hljs-attr">main_process_port:</span> <span class="hljs-number">9898</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">mixed_precision:</span> <span class="hljs-string">fp16</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">2</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">8</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>`,wrap:!1}}),{c(){T(t.$$.fragment)},l(n){J(t.$$.fragment,n)},m(n,U){j(t,n,U),M=!0},p:Z,i(n){M||(w(t.$$.fragment,n),M=!0)},o(n){y(t.$$.fragment,n),M=!1},d(n){f(t,n)}}}function $e(h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V91c2Vfc3VkbyUzQSUyMGZhbHNlJTBBdXNlX2NwdSUzQSUyMGZhbHNl",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">FSDP</span>
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">fsdp_config:</span>
  <span class="hljs-attr">fsdp_auto_wrap_policy:</span> <span class="hljs-string">TRANSFORMER_BASED_WRAP</span>
  <span class="hljs-attr">fsdp_backward_prefetch_policy:</span> <span class="hljs-string">BACKWARD_PRE</span>
  <span class="hljs-attr">fsdp_forward_prefetch:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">fsdp_offload_params:</span> <span class="hljs-literal">false</span>
  <span class="hljs-attr">fsdp_sharding_strategy:</span> <span class="hljs-number">1</span>
  <span class="hljs-attr">fsdp_state_dict_type:</span> <span class="hljs-string">FULL_STATE_DICT</span>
  <span class="hljs-attr">fsdp_sync_module_states:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">fsdp_transformer_layer_cls_to_wrap:</span> <span class="hljs-string">BertLayer</span>
  <span class="hljs-attr">fsdp_use_orig_params:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">mixed_precision:</span> <span class="hljs-string">bf16</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">1</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">2</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>`,wrap:!1}}),{c(){T(t.$$.fragment)},l(n){J(t.$$.fragment,n)},m(n,U){j(t,n,U),M=!0},p:Z,i(n){M||(w(t.$$.fragment,n),M=!0)},o(n){y(t.$$.fragment,n),M=!1},d(n){f(t,n)}}}function Be(h){let t,M;return t=new g({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMEFkZWVwc3BlZWRfY29uZmlnJTNBJTBBJTIwJTIwZGVlcHNwZWVkX2NvbmZpZ19maWxlJTNBJTIwJTJGaG9tZSUyRnVzZXIlMkZjb25maWdzJTJGZHNfemVybzNfY29uZmlnLmpzb24lMEElMjAlMjB6ZXJvM19pbml0X2ZsYWclM0ElMjB0cnVlJTBBZGlzdHJpYnV0ZWRfdHlwZSUzQSUyMERFRVBTUEVFRCUwQWRvd25jYXN0X2JmMTYlM0ElMjAnbm8nJTBBbWFjaGluZV9yYW5rJTNBJTIwMCUwQW1haW5fdHJhaW5pbmdfZnVuY3Rpb24lM0ElMjBtYWluJTBBbnVtX21hY2hpbmVzJTNBJTIwMSUwQW51bV9wcm9jZXNzZXMlM0ElMjA0JTBBcmR6dl9iYWNrZW5kJTNBJTIwc3RhdGljJTBBc2FtZV9uZXR3b3JrJTNBJTIwdHJ1ZSUwQXRwdV9lbnYlM0ElMjAlNUIlNUQlMEF0cHVfdXNlX2NsdXN0ZXIlM0ElMjBmYWxzZSUwQXRwdV91c2Vfc3VkbyUzQSUyMGZhbHNlJTBBdXNlX2NwdSUzQSUyMGZhbHNl",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>
<span class="hljs-attr">deepspeed_config:</span>
  <span class="hljs-attr">deepspeed_config_file:</span> <span class="hljs-string">/home/user/configs/ds_zero3_config.json</span>
  <span class="hljs-attr">zero3_init_flag:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">DEEPSPEED</span>
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">1</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>`,wrap:!1}}),{c(){T(t.$$.fragment)},l(n){J(t.$$.fragment,n)},m(n,U){j(t,n,U),M=!0},p:Z,i(n){M||(w(t.$$.fragment,n),M=!0)},o(n){y(t.$$.fragment,n),M=!1},d(n){f(t,n)}}}function Qe(h){let t,M;return t=new g({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMEFkZWVwc3BlZWRfY29uZmlnJTNBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJT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jAlNUIlNUQlMEF0cHVfdXNlX2NsdXN0ZXIlM0ElMjBmYWxzZSUwQXRwdV91c2Vfc3VkbyUzQSUyMGZhbHNlJTBBdXNlX2NwdSUzQSUyMGZhbHNl",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>                                                                                             
<span class="hljs-attr">deepspeed_config:</span>                                                                                                              
  <span class="hljs-attr">gradient_accumulation_steps:</span> <span class="hljs-number">1</span>
  <span class="hljs-attr">gradient_clipping:</span> <span class="hljs-number">0.7</span>
  <span class="hljs-attr">offload_optimizer_device:</span> <span class="hljs-string">cpu</span>
  <span class="hljs-attr">offload_param_device:</span> <span class="hljs-string">cpu</span>
  <span class="hljs-attr">zero3_init_flag:</span> <span class="hljs-literal">true</span>
  <span class="hljs-attr">zero_stage:</span> <span class="hljs-number">2</span>
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">DEEPSPEED</span>
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">mixed_precision:</span> <span class="hljs-string">bf16</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">1</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>`,wrap:!1}}),{c(){T(t.$$.fragment)},l(n){J(t.$$.fragment,n)},m(n,U){j(t,n,U),M=!0},p:Z,i(n){M||(w(t.$$.fragment,n),M=!0)},o(n){y(t.$$.fragment,n),M=!1},d(n){f(t,n)}}}function Xe(h){let t,M;return t=new g({props:{code:"Y29tcHV0ZV9lbnZpcm9ubWVudCUzQSUyMExPQ0FMX01BQ0hJTkUlMEF0cF9jb25maWclM0ElMEElMjAlMjB0cF9zaXplJTNBJTIwNCUwQWRpc3RyaWJ1dGVkX3R5cGUlM0ElMjBUUCUwQWRvd25jYXN0X2JmMTYlM0ElMjAnbm8nJTBBbWFjaGluZV9yYW5rJTNBJTIwMCUwQW1haW5fdHJhaW5pbmdfZnVuY3Rpb24lM0ElMjBtYWluJTBBbWl4ZWRfcHJlY2lzaW9uJTNBJTIwJ25vJyUwQW51bV9tYWNoaW5lcyUzQSUyMDElMEFudW1fcHJvY2Vzc2VzJTNBJTIwNCUwQXJkenZfYmFja2VuZCUzQSUyMHN0YXRpYyUwQXNhbWVfbmV0d29yayUzQSUyMHRydWUlMEF0cHVfZW52JTNBJTIwJTVCJTVEJTBBdHB1X3VzZV9jbHVzdGVyJTNBJTIwZmFsc2UlMEF0cHVfdXNlX3N1ZG8lM0ElMjBmYWxzZSUwQXVzZV9jcHUlM0ElMjBmYWxzZSUwQQ==",highlighted:`<span class="hljs-attr">compute_environment:</span> <span class="hljs-string">LOCAL_MACHINE</span>
<span class="hljs-attr">tp_config:</span>
  <span class="hljs-attr">tp_size:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">distributed_type:</span> <span class="hljs-string">TP</span>
<span class="hljs-attr">downcast_bf16:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">machine_rank:</span> <span class="hljs-number">0</span>
<span class="hljs-attr">main_training_function:</span> <span class="hljs-string">main</span>
<span class="hljs-attr">mixed_precision:</span> <span class="hljs-string">&#x27;no&#x27;</span>
<span class="hljs-attr">num_machines:</span> <span class="hljs-number">1</span>
<span class="hljs-attr">num_processes:</span> <span class="hljs-number">4</span>
<span class="hljs-attr">rdzv_backend:</span> <span class="hljs-string">static</span>
<span class="hljs-attr">same_network:</span> <span class="hljs-literal">true</span>
<span class="hljs-attr">tpu_env:</span> []
<span class="hljs-attr">tpu_use_cluster:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">tpu_use_sudo:</span> <span class="hljs-literal">false</span>
<span class="hljs-attr">use_cpu:</span> <span class="hljs-literal">false</span>
`,wrap:!1}}),{c(){T(t.$$.fragment)},l(n){J(t.$$.fragment,n)},m(n,U){j(t,n,U),M=!0},p:Z,i(n){M||(w(t.$$.fragment,n),M=!0)},o(n){y(t.$$.fragment,n),M=!1},d(n){f(t,n)}}}function We(h){let t,M,n,U,d,u,b,I,A,C;return t=new Ps({props:{id:"config",option:"DistributedDataParallel",$$slots:{default:[Ve]},$$scope:{ctx:h}}}),n=new Ps({props:{id:"config",option:"FSDP",$$slots:{default:[$e]},$$scope:{ctx:h}}}),d=new Ps({props:{id:"config",option:"DeepSpeed",$$slots:{default:[Be]},$$scope:{ctx:h}}}),b=new Ps({props:{id:"config",option:"DeepSpeed with Accelerate plugin",$$slots:{default:[Qe]},$$scope:{ctx:h}}}),A=new Ps({props:{id:"config",option:"Tensor Parallelism with PyTorch 2",$$slots:{default:[Xe]},$$scope:{ctx:h}}}),{c(){T(t.$$.fragment),M=r(),T(n.$$.fragment),U=r(),T(d.$$.fragment),u=r(),T(b.$$.fragment),I=r(),T(A.$$.fragment)},l(m){J(t.$$.fragment,m),M=p(m),J(n.$$.fragment,m),U=p(m),J(d.$$.fragment,m),u=p(m),J(b.$$.fragment,m),I=p(m),J(A.$$.fragment,m)},m(m,_){j(t,m,_),e(m,M,_),j(n,m,_),e(m,U,_),j(d,m,_),e(m,u,_),j(b,m,_),e(m,I,_),j(A,m,_),C=!0},p(m,_){const Os={};_&2&&(Os.$$scope={dirty:_,ctx:m}),t.$set(Os);const k={};_&2&&(k.$$scope={dirty:_,ctx:m}),n.$set(k);const V={};_&2&&(V.$$scope={dirty:_,ctx:m}),d.$set(V);const N={};_&2&&(N.$$scope={dirty:_,ctx:m}),b.$set(N);const $={};_&2&&($.$$scope={dirty:_,ctx:m}),A.$set($)},i(m){C||(w(t.$$.fragment,m),w(n.$$.fragment,m),w(d.$$.fragment,m),w(b.$$.fragment,m),w(A.$$.fragment,m),C=!0)},o(m){y(t.$$.fragment,m),y(n.$$.fragment,m),y(d.$$.fragment,m),y(b.$$.fragment,m),y(A.$$.fragment,m),C=!1},d(m){m&&(a(M),a(U),a(u),a(I)),f(t,m),f(n,m),f(d,m),f(b,m),f(A,m)}}}function Ee(h){let t,M,n,U,d,u,b,I='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>는 Transformers 라이브러리에 구현된 PyTorch 모델을 반복하여 훈련 및 평가 과정입니다. 훈련에 필요한 요소(모델, 토크나이저, 데이터셋, 평가 함수, 훈련 하이퍼파라미터 등)만 제공하면 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>가 필요한 나머지 작업을 처리합니다. 이를 통해 직접 훈련 루프를 작성하지 않고도 빠르게 훈련을 시작할 수 있습니다. 또한 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>는 강력한 맞춤 설정과 다양한 훈련 옵션을 제공하여 사용자 맞춤 훈련이 가능합니다.',A,C,m,_,Os='시작하기 전에, 분산 환경에서 PyTorch 훈련과 실행을 할 수 있게 <a href="https://hf.co/docs/accelerate" rel="nofollow">Accelerate</a> 라이브러리가 설치되었는지 확인하세요.',k,V,N,$,Ua='이 가이드는 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 클래스에 대한 개요를 제공합니다.',ll,G,al,v,da='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>는 기본적인 훈련 루프에 필요한 모든 코드를 포함하고 있습니다.',el,S,ua="<li>손실을 계산하는 훈련 단계를 수행합니다.</li> <li><code>backward</code> 메소드로 그레이디언트를 계산합니다.</li> <li>그레이디언트를 기반으로 가중치를 업데이트합니다.</li> <li>정해진 에폭 수에 도달할 때까지 이 과정을 반복합니다.</li>",tl,Y,ha='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 클래스는 PyTorch와 훈련 과정에 익숙하지 않거나 막 시작한 경우에도 훈련이 가능하도록 필요한 모든 코드를 추상화하였습니다. 또한 매번 훈련 루프를 손수 작성하지 않아도 되며, 훈련에 필요한 모델과 데이터셋 같은 필수 구성 요소만 제공하면, [Trainer] 클래스가 나머지를 처리합니다.',nl,H,_a='훈련 옵션이나 하이퍼파라미터를 지정하려면, <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a> 클래스에서 확인 할 수 있습니다. 예를 들어, 모델을 저장할 디렉토리를 <code>output_dir</code>에 정의하고, 훈련 후에 Hub로 모델을 푸시하려면 <code>push_to_hub=True</code>로 설정합니다.',rl,z,pl,x,ba='<code>training_args</code>를 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>에 모델, 데이터셋, 데이터셋 전처리 도구(데이터 유형에 따라 토크나이저, 특징 추출기 또는 이미지 프로세서일 수 있음), 데이터 수집기 및 훈련 중 확인할 지표를 계산할 함수를 함께 전달하세요.',Ml,L,Ia='마지막으로, <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.train">train()</a>를 호출하여 훈련을 시작하세요!',il,D,cl,q,ml,P,ga='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 클래스는 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>의 <code>output_dir</code> 매개변수에 지정된 디렉토리에 모델 체크포인트를 저장합니다. 체크포인트는 <code>checkpoint-000</code> 하위 폴더에 저장되며, 여기서 끝의 숫자는 훈련 단계에 해당합니다. 체크포인트를 저장하면 나중에 훈련을 재개할 때 유용합니다.',ol,O,Tl,K,Aa='체크포인트를 Hub에 푸시하려면 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>에서 <code>push_to_hub=True</code>로 설정하여 커밋하고 푸시할 수 있습니다. 체크포인트 저장 방법을 결정하는 다른 옵션은 <a href="https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments.hub_strategy" rel="nofollow"><code>hub_strategy</code></a> 매개변수에서 설정합니다:',Jl,ss,Ca="<li><code>hub_strategy=&quot;checkpoint&quot;</code>는 최신 체크포인트를 “last-checkpoint”라는 하위 폴더에 푸시하여 훈련을 재개할 수 있습니다.</li> <li><code>hub_strategy=&quot;all_checkpoints&quot;</code>는 모든 체크포인트를 <code>output_dir</code>에 정의된 디렉토리에 푸시합니다(모델 리포지토리에서 폴더당 하나의 체크포인트를 볼 수 있습니다).</li>",jl,ls,Za='체크포인트에서 훈련을 재개할 때, <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>는 체크포인트가 저장될 때와 동일한 Python, NumPy 및 PyTorch RNG 상태를 유지하려고 합니다. 하지만 PyTorch는 기본 설정으로 ‘일관된 결과를 보장하지 않음’으로 많이 되어있기 때문에, RNG 상태가 동일할 것이라고 보장할 수 없습니다. 따라서, 일관된 결과가 보장되도록 활성화 하려면, <a href="https://pytorch.org/docs/stable/notes/randomness#controlling-sources-of-randomness" rel="nofollow">랜덤성 제어</a> 가이드를 참고하여 훈련을 완전히 일관된 결과를 보장 받도록 만들기 위해 활성화할 수 있는 항목을 확인하세요. 다만, 특정 설정을 결정적으로 만들면 훈련이 느려질 수 있습니다.',wl,as,yl,es,Va='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 클래스는 접근성과 용이성을 염두에 두고 설계되었지만, 더 다양한 기능을 원하는 사용자들을 위해 다양한 맞춤 설정 옵션을 제공합니다. <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>의 많은 메소드는 서브클래스화 및 오버라이드하여 원하는 기능을 제공할 수 있으며, 이를 통해 전체 훈련 루프를 다시 작성할 필요 없이 원하는 기능을 추가할 수 있습니다. 이러한 메소드에는 다음이 포함됩니다:',fl,ts,$a='<li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.get_train_dataloader">get_train_dataloader()</a>는 훈련 데이터로더를 생성합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.get_eval_dataloader">get_eval_dataloader()</a>는 평가 데이터로더를 생성합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.get_test_dataloader">get_test_dataloader()</a>는 테스트 데이터로더를 생성합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.log">log()</a>는 훈련을 모니터링하는 다양한 객체에 대한 정보를 로그로 남깁니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.create_optimizer_and_scheduler">create_optimizer_and_scheduler()</a>는 <code>__init__</code>에서 전달되지 않은 경우 옵티마이저와 학습률 스케줄러를 생성합니다. 이들은 각각 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.create_optimizer">create_optimizer()</a> 및 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.create_scheduler">create_scheduler()</a>로 별도로 맞춤 설정 할 수 있습니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.compute_loss">compute_loss()</a>는 훈련 입력 배치에 대한 손실을 계산합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.training_step">training_step()</a>는 훈련 단계를 수행합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.prediction_step">prediction_step()</a>는 예측 및 테스트 단계를 수행합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.evaluate">evaluate()</a>는 모델을 평가하고 평가 지표을 반환합니다.</li> <li><a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.predict">predict()</a>는 테스트 세트에 대한 예측(레이블이 있는 경우 지표 포함)을 수행합니다.</li>',Ul,ns,Ba='예를 들어, <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.compute_loss">compute_loss()</a> 메소드를 맞춤 설정하여 가중 손실을 사용하려는 경우:',dl,rs,ul,ps,hl,Ms,Qa='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>를 맞춤 설정하는 또 다른 방법은 <a href="callbacks">콜백</a>을 사용하는 것입니다. 콜백은 훈련 루프에서 <em>변화를 주지 않습니다</em>. 훈련 루프의 상태를 검사한 후 상태에 따라 일부 작업(조기 종료, 결과 로그 등)을 실행합니다. 즉, 콜백은 사용자 정의 손실 함수와 같은 것을 구현하는 데 사용할 수 없으며, 이를 위해서는 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer.compute_loss">compute_loss()</a> 메소드를 서브클래스화하고 오버라이드해야 합니다.',_l,is,Xa="예를 들어, 훈련 루프에 10단계 후 조기 종료 콜백을 추가하려면 다음과 같이 합니다.",bl,cs,Il,ms,Wa='그런 다음, 이를 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>의 <code>callback</code> 매개변수에 전달합니다.',gl,os,Al,Ts,Cl,Q,Zl,Js,Ea='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>는 기본적으로 <code>logging.INFO</code>로 설정되어 있어 오류, 경고 및 기타 기본 정보를 보고합니다. 분산 환경에서는 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 복제본이 <code>logging.WARNING</code>으로 설정되어 오류와 경고만 보고합니다. <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>의 <a href="https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments.log_level" rel="nofollow"><code>log_level</code></a> 및 <a href="https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments.log_level_replica" rel="nofollow"><code>log_level_replica</code></a> 매개변수로 로그 레벨을 변경할 수 있습니다.',Vl,js,Fa='각 노드의 로그 레벨 설정을 구성하려면 <a href="https://huggingface.co/docs/transformers/main/en/main_classes/trainer#transformers.TrainingArguments.log_on_each_node" rel="nofollow"><code>log_on_each_node</code></a> 매개변수를 사용하여 각 노드에서 로그 레벨을 사용할지 아니면 주 노드에서만 사용할지 결정하세요.',$l,X,Bl,ws,Ra="예를 들어, 메인 코드와 모듈을 각 노드에 따라 동일한 로그 레벨을 사용하도록 설정하려면 다음과 같이 합니다.",Ql,ys,Xl,fs,ka="각 노드에서 기록될 내용을 구성하기 위해 <code>log_level</code>과 <code>log_level_replica</code>를 다양한 조합으로 사용해보세요.",Wl,W,El,Us,Fl,ds,Na='<a href="https://hf.co/papers/2310.05914" rel="nofollow">NEFTune</a>은 훈련 중 임베딩 벡터에 노이즈를 추가하여 성능을 향상시킬 수 있는 기술입니다. <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>에서 이를 활성화하려면 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>의 <code>neftune_noise_alpha</code> 매개변수를 설정하여 노이즈의 양을 조절합니다.',Rl,us,kl,hs,Ga="NEFTune은 예상치 못한 동작을 피할 목적으로 처음 임베딩 레이어로 복원하기 위해 훈련 후 비활성화 됩니다.",Nl,_s,Gl,bs,va="Gradient Low-Rank Projection (GaLore)은 전체 매개변수를 학습하면서도 LoRA와 같은 일반적인 저계수 적응 방법보다 더 메모리 효율적인 저계수 학습 전략입니다.",vl,Is,Sa="먼저 GaLore 공식 리포지토리를 설치합니다:",Sl,gs,Yl,As,Ya="그런 다음 <code>optim</code>에 <code>[&quot;galore_adamw&quot;, &quot;galore_adafactor&quot;, &quot;galore_adamw_8bit&quot;]</code> 중 하나와 함께 <code>optim_target_modules</code>를 추가합니다. 이는 적용하려는 대상 모듈 이름에 해당하는 문자열, 정규 표현식 또는 전체 경로의 목록일 수 있습니다. 아래는 end-to-end 예제 스크립트입니다(필요한 경우 <code>pip install trl datasets</code>를 실행):",Hl,Cs,zl,Zs,Ha="GaLore가 지원하는 추가 매개변수를 전달하려면 <code>optim_args</code>를 설정합니다. 예를 들어:",xl,Vs,Ll,$s,za='해당 방법에 대한 자세한 내용은 <a href="https://github.com/jiaweizzhao/GaLore" rel="nofollow">원본 리포지토리</a> 또는 <a href="https://arxiv.org/abs/2403.03507" rel="nofollow">논문</a>을 참고하세요.',Dl,Bs,xa="현재 GaLore 레이어로 간주되는 Linear 레이어만 훈련 할수 있으며, 저계수 분해를 사용하여 훈련되고 나머지 레이어는 기존 방식으로 최적화됩니다.",ql,Qs,La="훈련 시작 전에 시간이 약간 걸릴 수 있습니다(NVIDIA A100에서 2B 모델의 경우 약 3분), 하지만 이후 훈련은 원활하게 진행됩니다.",Pl,Xs,Da="다음과 같이 옵티마이저 이름에 <code>layerwise</code>를 추가하여 레이어별 최적화를 수행할 수도 있습니다:",Ol,Ws,Kl,Es,qa='레이어별 최적화는 다소 실험적이며 DDP(분산 데이터 병렬)를 지원하지 않으므로, 단일 GPU에서만 훈련 스크립트를 실행할 수 있습니다. 자세한 내용은 <a href="https://github.com/jiaweizzhao/GaLore?tab=readme-ov-file#train-7b-model-with-a-single-gpu-with-24gb-memory" rel="nofollow">이 문서를</a>을 참조하세요. gradient clipping, DeepSpeed 등 다른 기능은 기본적으로 지원되지 않을 수 있습니다. 이러한 문제가 발생하면 <a href="https://github.com/huggingface/transformers/issues" rel="nofollow">GitHub에 이슈를 올려주세요</a>.',sa,Fs,la,Rs,Pa=`LOMO 옵티마이저는 <a href="https://hf.co/papers/2306.09782" rel="nofollow">제한된 자원으로 대형 언어 모델의 전체 매개변수 미세 조정</a>과 <a href="https://hf.co/papers/2310.10195" rel="nofollow">적응형 학습률을 통한 저메모리 최적화(AdaLomo)</a>에서 도입되었습니다.
이들은 모두 효율적인 전체 매개변수 미세 조정 방법으로 구성되어 있습니다. 이러한 옵티마이저들은 메모리 사용량을 줄이기 위해 그레이디언트 계산과 매개변수 업데이트를 하나의 단계로 융합합니다. LOMO에서 지원되는 옵티마이저는 <code>&quot;lomo&quot;</code>와 <code>&quot;adalomo&quot;</code>입니다. 먼저 pypi에서 <code>pip install lomo-optim</code>를 통해 <code>lomo</code>를 설치하거나, GitHub 소스에서 <code>pip install git+https://github.com/OpenLMLab/LOMO.git</code>로 설치하세요.`,aa,E,ea,ks,Oa='다음은 IMDB 데이터셋에서 <a href="https://huggingface.co/google/gemma-2b" rel="nofollow">google/gemma-2b</a>를 최대 정밀도로 미세 조정하는 간단한 스크립트입니다:',ta,Ns,na,Gs,ra,vs,Ka='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a> 클래스는 <a href="https://hf.co/docs/accelerate" rel="nofollow">Accelerate</a>로 구동되며, 이는 <a href="https://pytorch.org/blog/introducing-pytorch-fully-sharded-data-parallel-api/" rel="nofollow">FullyShardedDataParallel (FSDP)</a> 및 <a href="https://www.deepspeed.ai/" rel="nofollow">DeepSpeed</a>와 같은 통합을 지원하는 분산 환경에서 PyTorch 모델을 쉽게 훈련할 수 있는 라이브러리입니다.',pa,F,Ma,Ss,se='<a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>와 Accelerate를 사용하려면 <a href="https://huggingface.co/docs/accelerate/package_reference/cli#accelerate-config" rel="nofollow"><code>accelerate.config</code></a> 명령을 실행하여 훈련 환경을 설정하세요. 이 명령은 훈련 스크립트를 실행할 때 사용할 <code>config_file.yaml</code>을 생성합니다. 예를 들어, 다음 예시는 설정할 수 있는 일부 구성 예입니다.',ia,R,ca,Ys,le='<a href="https://huggingface.co/docs/accelerate/package_reference/cli#accelerate-launch" rel="nofollow"><code>accelerate_launch</code></a> 명령은 Accelerate와 <a href="/docs/transformers/main/ko/main_classes/trainer#transformers.Trainer">Trainer</a>를 사용하여 분산 시스템에서 훈련 스크립트를 실행하는 권장 방법이며, <code>config_file.yaml</code>에 지정된 매개변수를 사용합니다. 이 파일은 Accelerate 캐시 폴더에 저장되며 <code>accelerate_launch</code>를 실행할 때 자동으로 로드됩니다.',ma,Hs,ae='예를 들어, FSDP 구성을 사용하여 <a href="https://github.com/huggingface/transformers/blob/f4db565b695582891e43a5e042e5d318e28f20b8/examples/pytorch/text-classification/run_glue.py#L4" rel="nofollow">run_glue.py</a> 훈련 스크립트를 실행하려면 다음과 같이 합니다:',oa,zs,Ta,xs,ee="<code>config_file.yaml</code> 파일의 매개변수를 직접 지정할 수도 있습니다:",Ja,Ls,ja,Ds,te='<code>accelerate_launch</code>와 사용자 정의 구성에 대해 더 알아보려면 <a href="https://huggingface.co/docs/accelerate/basic_tutorials/launch" rel="nofollow">Accelerate 스크립트 실행</a> 튜토리얼을 확인하세요.',wa,qs,ya,Ks,fa;return d=new B({props:{title:"Trainer",local:"trainer",headingTag:"h1"}}),C=new sl({props:{$$slots:{default:[he]},$$scope:{ctx:h}}}),V=new g({props:{code:"cGlwJTIwaW5zdGFsbCUyMGFjY2VsZXJhdGUlMEElMEElMjMlMjAlRUMlOTclODUlRUElQjclQjglRUIlQTAlODglRUMlOUQlQjQlRUIlOTMlOUMlMEFwaXAlMjBpbnN0YWxsJTIwYWNjZWxlcmF0ZSUyMC0tdXBncmFkZQ==",highlighted:`pip install accelerate

<span class="hljs-comment"># 업그레이드</span>
pip install accelerate --upgrade`,wrap:!1}}),G=new B({props:{title:"기본 사용법",local:"basic-usage",headingTag:"h2"}}),z=new g({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBdHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJ5b3VyLW1vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0QxNiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNEMiUyQyUwQSUyMCUyMCUyMCUyMHdlaWdodF9kZWNheSUzRDAuMDElMkMlMEElMjAlMjAlMjAlMjBldmFsX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHB1c2hfdG9faHViJTNEVHJ1ZSUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

training_args = TrainingArguments(
    output_dir=<span class="hljs-string">&quot;your-model&quot;</span>,
    learning_rate=<span class="hljs-number">2e-5</span>,
    per_device_train_batch_size=<span class="hljs-number">16</span>,
    per_device_eval_batch_size=<span class="hljs-number">16</span>,
    num_train_epochs=<span class="hljs-number">2</span>,
    weight_decay=<span class="hljs-number">0.01</span>,
    eval_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
    save_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
    load_best_model_at_end=<span class="hljs-literal">True</span>,
    push_to_hub=<span class="hljs-literal">True</span>,
)`,wrap:!1}}),D=new g({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluZXIlMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEZGF0YXNldCU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBkYXRhX2NvbGxhdG9yJTNEZGF0YV9jb2xsYXRvciUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSklMEElMEF0cmFpbmVyLnRyYWluKCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Trainer

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset[<span class="hljs-string">&quot;train&quot;</span>],
    eval_dataset=dataset[<span class="hljs-string">&quot;test&quot;</span>],
    tokenizer=tokenizer,
    data_collator=data_collator,
    compute_metrics=compute_metrics,
)

trainer.train()`,wrap:!1}}),q=new B({props:{title:"체크포인트",local:"checkpoints",headingTag:"h3"}}),O=new g({props:{code:"JTIzJTIwJUVDJUI1JTlDJUVDJThCJUEwJTIwJUVDJUIyJUI0JUVEJTgxJUFDJUVEJThGJUFDJUVDJTlEJUI4JUVEJThBJUI4JUVDJTk3JTkwJUVDJTg0JTlDJTIwJUVDJTlFJUFDJUVBJUIwJTlDJTBBdHJhaW5lci50cmFpbihyZXN1bWVfZnJvbV9jaGVja3BvaW50JTNEVHJ1ZSklMEElMEElMjMlMjAlRUMlQjYlOUMlRUIlQTAlQTUlMjAlRUIlOTQlOTQlRUIlQTAlODklRUQlODYlQTAlRUIlQTYlQUMlRUMlOTclOTAlMjAlRUMlQTAlODAlRUMlOUUlQTUlRUIlOTAlOUMlMjAlRUQlOEElQjklRUMlQTAlOTUlMjAlRUMlQjIlQjQlRUQlODElQUMlRUQlOEYlQUMlRUMlOUQlQjglRUQlOEElQjglRUMlOTclOTAlRUMlODQlOUMlMjAlRUMlOUUlQUMlRUElQjAlOUMlMEF0cmFpbmVyLnRyYWluKHJlc3VtZV9mcm9tX2NoZWNrcG9pbnQlM0QlMjJ5b3VyLW1vZGVsJTJGY2hlY2twb2ludC0xMDAwJTIyKQ==",highlighted:`<span class="hljs-comment"># 최신 체크포인트에서 재개</span>
trainer.train(resume_from_checkpoint=<span class="hljs-literal">True</span>)

<span class="hljs-comment"># 출력 디렉토리에 저장된 특정 체크포인트에서 재개</span>
trainer.train(resume_from_checkpoint=<span class="hljs-string">&quot;your-model/checkpoint-1000&quot;</span>)`,wrap:!1}}),as=new B({props:{title:"Trainer 맞춤 설정",local:"customize-the-trainer",headingTag:"h2"}}),rs=new g({props:{code:"ZnJvbSUyMHRvcmNoJTIwaW1wb3J0JTIwbm4lMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwVHJhaW5lciUwQSUwQWNsYXNzJTIwQ3VzdG9tVHJhaW5lcihUcmFpbmVyKSUzQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGNvbXB1dGVfbG9zcyhzZWxmJTJDJTBBJTBBJTIwbW9kZWwlMkMlMjBpbnB1dHMlMkMlMjByZXR1cm5fb3V0cHV0cyUzREZhbHNlKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxhYmVscyUyMCUzRCUyMGlucHV0cy5wb3AoJTIybGFiZWxzJTIyKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMyUyMCVFQyU4OCU5QyVFQiVCMCVBOSVFRCU5NiVBNSUyMCVFQyVBMCU4NCVFRCU4QyU4QyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmdldCglMjJsb2dpdHMlMjIpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwJUVDJTg0JTlDJUVCJUExJTlDJTIwJUVCJThCJUE0JUVCJUE1JUI4JTIwJUVBJUIwJTgwJUVDJUE0JTkxJUVDJUI5JTk4JUVCJUExJTlDJTIwMyVFQSVCMCU5QyVFQyU5RCU5OCUyMCVFQiVBMCU4OCVFQyU5RCVCNCVFQiVCOCU5NCVFQyU5NyU5MCUyMCVFQiU4QyU4MCVFRCU5NSU5QyUyMCVFQyU4MiVBQyVFQyU5QSVBOSVFQyU5RSU5MCUyMCVFQyVBMCU5NSVFQyU5RCU5OCUyMCVFQyU4NiU5MCVFQyU4QiVBNCVFQyU5RCU4NCUyMCVFQSVCMyU4NCVFQyU4MiVCMCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxvc3NfZmN0JTIwJTNEJTIwbm4uQ3Jvc3NFbnRyb3B5TG9zcyh3ZWlnaHQlM0R0b3JjaC50ZW5zb3IoJTVCMS4wJTJDJTIwMi4wJTJDJTIwMy4wJTVEJTJDJTIwZGV2aWNlJTNEbW9kZWwuZGV2aWNlKSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb3NzJTIwJTNEJTIwbG9zc19mY3QobG9naXRzLnZpZXcoLTElMkMlMjBzZWxmLm1vZGVsLmNvbmZpZy5udW1fbGFiZWxzKSUyQyUyMGxhYmVscy52aWV3KC0xKSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjAobG9zcyUyQyUyMG91dHB1dHMpJTIwaWYlMjByZXR1cm5fb3V0cHV0cyUyMGVsc2UlMjBsb3Nz",highlighted:`<span class="hljs-keyword">from</span> torch <span class="hljs-keyword">import</span> nn
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Trainer

<span class="hljs-keyword">class</span> <span class="hljs-title class_">CustomTrainer</span>(<span class="hljs-title class_ inherited__">Trainer</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_loss</span>(<span class="hljs-params">self,

 model, inputs, return_outputs=<span class="hljs-literal">False</span></span>):
        labels = inputs.pop(<span class="hljs-string">&quot;labels&quot;</span>)
        <span class="hljs-comment"># 순방향 전파</span>
        outputs = model(**inputs)
        logits = outputs.get(<span class="hljs-string">&quot;logits&quot;</span>)
        <span class="hljs-comment"># 서로 다른 가중치로 3개의 레이블에 대한 사용자 정의 손실을 계산</span>
        loss_fct = nn.CrossEntropyLoss(weight=torch.tensor([<span class="hljs-number">1.0</span>, <span class="hljs-number">2.0</span>, <span class="hljs-number">3.0</span>], device=model.device))
        loss = loss_fct(logits.view(-<span class="hljs-number">1</span>, self.model.config.num_labels), labels.view(-<span class="hljs-number">1</span>))
        <span class="hljs-keyword">return</span> (loss, outputs) <span class="hljs-keyword">if</span> return_outputs <span class="hljs-keyword">else</span> loss`,wrap:!1}}),ps=new B({props:{title:"콜백",local:"callbacks",headingTag:"h3"}}),cs=new g({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluZXJDYWxsYmFjayUwQSUwQWNsYXNzJTIwRWFybHlTdG9wcGluZ0NhbGxiYWNrKFRyYWluZXJDYWxsYmFjayklM0ElMEElMjAlMjAlMjAlMjBkZWYlMjBfX2luaXRfXyhzZWxmJTJDJTIwbnVtX3N0ZXBzJTNEMTApJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5udW1fc3RlcHMlMjAlM0QlMjBudW1fc3RlcHMlMEElMjAlMjAlMjAlMjAlMEElMjAlMjAlMjAlMjBkZWYlMjBvbl9zdGVwX2VuZChzZWxmJTJDJTIwYXJncyUyQyUyMHN0YXRlJTJDJTIwY29udHJvbCUyQyUyMCoqa3dhcmdzKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGlmJTIwc3RhdGUuZ2xvYmFsX3N0ZXAlMjAlM0UlM0QlMjBzZWxmLm51bV9zdGVwcyUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCU3QiUyMnNob3VsZF90cmFpbmluZ19zdG9wJTIyJTNBJTIwVHJ1ZSU3RCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGVsc2UlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlN0Q=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainerCallback

<span class="hljs-keyword">class</span> <span class="hljs-title class_">EarlyStoppingCallback</span>(<span class="hljs-title class_ inherited__">TrainerCallback</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, num_steps=<span class="hljs-number">10</span></span>):
        self.num_steps = num_steps
    
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">on_step_end</span>(<span class="hljs-params">self, args, state, control, **kwargs</span>):
        <span class="hljs-keyword">if</span> state.global_step &gt;= self.num_steps:
            <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;should_training_stop&quot;</span>: <span class="hljs-literal">True</span>}
        <span class="hljs-keyword">else</span>:
            <span class="hljs-keyword">return</span> {}`,wrap:!1}}),os=new g({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluZXIlMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEZGF0YXNldCU1QiUyMnRyYWluJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9kYXRhc2V0JTNEZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEElMjAlMjAlMjAlMjBkYXRhX2NvbGxhdG9yJTNEZGF0YV9jb2xsYXRvciUyQyUwQSUyMCUyMCUyMCUyMGNvbXB1dGVfbWV0cmljcyUzRGNvbXB1dGVfbWV0cmljcyUyQyUwQSUyMCUyMCUyMCUyMGNhbGxiYWNrcyUzRCU1QkVhcmx5U3RvcHBpbmdDYWxsYmFjaygpJTVEJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> Trainer

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset[<span class="hljs-string">&quot;train&quot;</span>],
    eval_dataset=dataset[<span class="hljs-string">&quot;test&quot;</span>],
    tokenizer=tokenizer,
    data_collator=data_collator,
    compute_metrics=compute_metrics,
    callbacks=[EarlyStoppingCallback()],
)`,wrap:!1}}),Ts=new B({props:{title:"로깅",local:"logging",headingTag:"h2"}}),Q=new sl({props:{$$slots:{default:[_e]},$$scope:{ctx:h}}}),X=new sl({props:{$$slots:{default:[be]},$$scope:{ctx:h}}}),ys=new g({props:{code:"bG9nZ2VyJTIwJTNEJTIwbG9nZ2luZy5nZXRMb2dnZXIoX19uYW1lX18pJTBBJTBBbG9nZ2luZy5iYXNpY0NvbmZpZyglMEElMjAlMjAlMjAlMjBmb3JtYXQlM0QlMjIlMjUoYXNjdGltZSlzJTIwLSUyMCUyNShsZXZlbG5hbWUpcyUyMC0lMjAlMjUobmFtZSlzJTIwLSUyMCUyNShtZXNzYWdlKXMlMjIlMkMlMEElMjAlMjAlMjAlMjBkYXRlZm10JTNEJTIyJTI1bSUyRiUyNWQlMkYlMjVZJTIwJTI1SCUzQSUyNU0lM0ElMjVTJTIyJTJDJTBBJTIwJTIwJTIwJTIwaGFuZGxlcnMlM0QlNUJsb2dnaW5nLlN0cmVhbUhhbmRsZXIoc3lzLnN0ZG91dCklNUQlMkMlMEEpJTBBJTBBbG9nX2xldmVsJTIwJTNEJTIwdHJhaW5pbmdfYXJncy5nZXRfcHJvY2Vzc19sb2dfbGV2ZWwoKSUwQWxvZ2dlci5zZXRMZXZlbChsb2dfbGV2ZWwpJTBBZGF0YXNldHMudXRpbHMubG9nZ2luZy5zZXRfdmVyYm9zaXR5KGxvZ19sZXZlbCklMEF0cmFuc2Zvcm1lcnMudXRpbHMubG9nZ2luZy5zZXRfdmVyYm9zaXR5KGxvZ19sZXZlbCklMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciguLi4p",highlighted:`logger = logging.getLogger(__name__)

logging.basicConfig(
    <span class="hljs-built_in">format</span>=<span class="hljs-string">&quot;%(asctime)s - %(levelname)s - %(name)s - %(message)s&quot;</span>,
    datefmt=<span class="hljs-string">&quot;%m/%d/%Y %H:%M:%S&quot;</span>,
    handlers=[logging.StreamHandler(sys.stdout)],
)

log_level = training_args.get_process_log_level()
logger.setLevel(log_level)
datasets.utils.logging.set_verbosity(log_level)
transformers.utils.logging.set_verbosity(log_level)

trainer = Trainer(...)`,wrap:!1}}),W=new Je({props:{id:"logging",options:["single node","multi-node"],$$slots:{default:[Ae]},$$scope:{ctx:h}}}),Us=new B({props:{title:"NEFTune",local:"neftune",headingTag:"h2"}}),us=new g({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTJDJTIwVHJhaW5lciUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBUcmFpbmluZ0FyZ3VtZW50cyguLi4lMkMlMjBuZWZ0dW5lX25vaXNlX2FscGhhJTNEMC4xKSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKC4uLiUyQyUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments, Trainer

training_args = TrainingArguments(..., neftune_noise_alpha=<span class="hljs-number">0.1</span>)
trainer = Trainer(..., args=training_args)`,wrap:!1}}),_s=new B({props:{title:"GaLore",local:"galore",headingTag:"h2"}}),gs=new g({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdhbG9yZS10b3JjaA==",highlighted:"pip install galore-torch",wrap:!1}}),Cs=new g({props:{code:"aW1wb3J0JTIwdG9yY2glMEFp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UyMG1vZGVsJTNEbW9kZWwlMkMlMjAlMEElMjAlMjAlMjAlMjBhcmdzJTNEYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0R0cmFpbl9kYXRhc2V0JTJDJTBBJTIwJTIwJTIwJTIwZGF0YXNldF90ZXh0X2ZpZWxkJTNEJ3RleHQnJTJDJTBBJTIwJTIwJTIwJTIwbWF4X3NlcV9sZW5ndGglM0Q1MTIlMkMlMEEpJTBBJTBBdHJhaW5lci50cmFpbigp",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> datasets
<span class="hljs-keyword">import</span> trl

<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments, AutoConfig, AutoTokenizer, AutoModelForCausalLM

train_dataset = datasets.load_dataset(<span class="hljs-string">&#x27;imdb&#x27;</span>, split=<span class="hljs-string">&#x27;train&#x27;</span>)

args = TrainingArguments(
    output_dir=<span class="hljs-string">&quot;./test-galore&quot;</span>,
    max_steps=<span class="hljs-number">100</span>,
    per_device_train_batch_size=<span class="hljs-number">2</span>,
    optim=<span class="hljs-string">&quot;galore_adamw&quot;</span>,
    optim_target_modules=[<span class="hljs-string">&quot;attn&quot;</span>, <span class="hljs-string">&quot;mlp&quot;</span>]
)

model_id = <span class="hljs-string">&quot;google/gemma-2b&quot;</span>

config = AutoConfig.from_pretrained(model_id)

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_config(config).to(<span class="hljs-number">0</span>)

trainer = trl.SFTTrainer(
    model=model, 
    args=args,
    train_dataset=train_dataset,
    dataset_text_field=<span class="hljs-string">&#x27;text&#x27;</span>,
    max_seq_length=<span class="hljs-number">512</span>,
)

trainer.train()`,wrap:!1}}),Vs=new g({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjBkYXRhc2V0cyUwQWltcG9ydCUyMHRybCUwQSUwQWZyb20lMjB0cmFuc2Zvcm1lcnMlMjBpbXBv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lM0QlMjB0cmwuU0ZUVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTIwJTBBJTIwJTIwJTIwJTIwYXJncyUzRGFyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEdHJhaW5fZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFzZXRfdGV4dF9maWVsZCUzRCd0ZXh0JyUyQyUwQSUyMCUyMCUyMCUyMG1heF9zZXFfbGVuZ3RoJTNENTEyJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> datasets
<span class="hljs-keyword">import</span> trl

<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments, AutoConfig, AutoTokenizer, AutoModelForCausalLM

train_dataset = datasets.load_dataset(<span class="hljs-string">&#x27;imdb&#x27;</span>, split=<span class="hljs-string">&#x27;train&#x27;</span>)

args = TrainingArguments(
    output_dir=<span class="hljs-string">&quot;./test-galore&quot;</span>,
    max_steps=<span class="hljs-number">100</span>,
    per_device_train_batch_size=<span class="hljs-number">2</span>,
    optim=<span class="hljs-string">&quot;galore_adamw&quot;</span>,
    optim_target_modules=[<span class="hljs-string">&quot;attn&quot;</span>, <span class="hljs-string">&quot;mlp&quot;</span>],
    optim_args=<span class="hljs-string">&quot;rank=64, update_proj_gap=100, scale=0.10&quot;</span>,
)

model_id = <span class="hljs-string">&quot;google/gemma-2b&quot;</span>

config = AutoConfig.from_pretrained(model_id)

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_config(config).to(<span class="hljs-number">0</span>)

trainer = trl.SFTTrainer(
    model=model, 
    args=args,
    train_dataset=train_dataset,
    dataset_text_field=<span class="hljs-string">&#x27;text&#x27;</span>,
    max_seq_length=<span class="hljs-number">512</span>,
)

trainer.train()`,wrap:!1}}),Ws=new g({props:{code:"aW1wb3J0J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0ZUVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTIwJTBBJTIwJTIwJTIwJTIwYXJncyUzRGFyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEdHJhaW5fZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFzZXRfdGV4dF9maWVsZCUzRCd0ZXh0JyUyQyUwQSUyMCUyMCUyMCUyMG1heF9zZXFfbGVuZ3RoJTNENTEyJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> datasets
<span class="hljs-keyword">import</span> trl

<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments, AutoConfig, AutoTokenizer, AutoModelForCausalLM

train_dataset = datasets.load_dataset(<span class="hljs-string">&#x27;imdb&#x27;</span>, split=<span class="hljs-string">&#x27;train&#x27;</span>)

args = TrainingArguments(
    output_dir=<span class="hljs-string">&quot;./test-galore&quot;</span>,
    max_steps=<span class="hljs-number">100</span>,
    per_device_train_batch_size=<span class="hljs-number">2</span>,
    optim=<span class="hljs-string">&quot;galore_adamw_layerwise&quot;</span>,
    optim_target_modules=[<span class="hljs-string">&quot;attn&quot;</span>, <span class="hljs-string">&quot;mlp&quot;</span>]
)

model_id = <span class="hljs-string">&quot;google/gemma-2b&quot;</span>

config = AutoConfig.from_pretrained(model_id)

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_config(config).to(<span class="hljs-number">0</span>)

trainer = trl.SFTTrainer(
    model=model, 
    args=args,
    train_dataset=train_dataset,
    dataset_text_field=<span class="hljs-string">&#x27;text&#x27;</span>,
    max_seq_length=<span class="hljs-number">512</span>,
)

trainer.train()`,wrap:!1}}),Fs=new B({props:{title:"LOMO 옵티마이저",local:"lomo-optimizer",headingTag:"h2"}}),E=new sl({props:{$$slots:{default:[Ce]},$$scope:{ctx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ml6ZXIuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwbG93X2NwdV9tZW1fdXNhZ2UlM0RUcnVlKS50bygwKSUwQSUwQXRyYWluZXIlMjAlM0QlMjB0cmwuU0ZUVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTIwJTBBJTIwJTIwJTIwJTIwYXJncyUzRGFyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEdHJhaW5fZGF0YXNldCUyQyUwQSUyMCUyMCUyMCUyMGRhdGFzZXRfdGV4dF9maWVsZCUzRCd0ZXh0JyUyQyUwQSUyMCUyMCUyMCUyMG1heF9zZXFfbGVuZ3RoJTNEMTAyNCUyQyUwQSklMEElMEF0cmFpbmVyLnRyYWluKCk=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> datasets
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments, AutoTokenizer, AutoModelForCausalLM
<span class="hljs-keyword">import</span> trl

train_dataset = datasets.load_dataset(<span class="hljs-string">&#x27;imdb&#x27;</span>, split=<span class="hljs-string">&#x27;train&#x27;</span>)

args = TrainingArguments(
    output_dir=<span class="hljs-string">&quot;./test-lomo&quot;</span>,
    max_steps=<span class="hljs-number">1000</span>,
    per_device_train_batch_size=<span class="hljs-number">4</span>,
    optim=<span class="hljs-string">&quot;adalomo&quot;</span>,
    gradient_checkpointing=<span class="hljs-literal">True</span>,
    logging_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
    logging_steps=<span class="hljs-number">1</span>,
    learning_rate=<span class="hljs-number">2e-6</span>,
    save_strategy=<span class="hljs-string">&quot;no&quot;</span>,
    run_name=<span class="hljs-string">&quot;lomo-imdb&quot;</span>,
)

model_id = <span class="hljs-string">&quot;google/gemma-2b&quot;</span>

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, low_cpu_mem_usage=<span class="hljs-literal">True</span>).to(<span class="hljs-number">0</span>)

trainer = trl.SFTTrainer(
    model=model, 
    args=args,
    train_dataset=train_dataset,
    dataset_text_field=<span class="hljs-string">&#x27;text&#x27;</span>,
    max_seq_length=<span class="hljs-number">1024</span>,
)

trainer.train()`,wrap:!1}}),Gs=new B({props:{title:"Accelerate와 Trainer",local:"accelerate-and-trainer",headingTag:"h2"}}),F=new sl({props:{$$slots:{default:[Ze]},$$scope:{ctx:h}}}),R=new Je({props:{id:"config",options:["DistributedDataParallel","FSDP","DeepSpeed","DeepSpeed with Accelerate plugin","Tensor Parallelism with PyTorch 2"],$$slots:{default:[We]},$$scope:{ctx:h}}}),zs=new g({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMCU1QyUwQSUyMCUyMCUyMCUyMC4lMkZleGFtcGxlcyUyRnB5dG9yY2glMkZ0ZXh0LWNsYXNzaWZpY2F0aW9uJTJGcnVuX2dsdWUucHklMjAlNUMlMEElMjAlMjAlMjAlMjAtLW1vZGVsX25hbWVfb3JfcGF0aCUyMGdvb2dsZS1iZXJ0JTJGYmVydC1iYXNlLWNhc2VkJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS10YXNrX25hbWUlMjAlMjRUQVNLX05BTUUlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWRvX3RyYWluJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kb19ldmFsJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tYXhfc2VxX2xlbmd0aCUyMDEyOCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTIwMTYlMjAlNUMlMEElMjAlMjAlMjAlMjAtLWxlYXJuaW5nX3JhdGUlMjA1ZS01JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1udW1fdHJhaW5fZXBvY2hzJTIwMyUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3V0cHV0X2RpciUyMCUyRnRtcCUyRiUyNFRBU0tfTkFNRSUyRiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tb3ZlcndyaXRlX291dHB1dF9kaXI=",highlighted:`accelerate launch \\
    ./examples/pytorch/text-classification/run_glue.py \\
    --model_name_or_path google-bert/bert-base-cased \\
    --task_name <span class="hljs-variable">$TASK_NAME</span> \\
    --do_train \\
    --do_eval \\
    --max_seq_length 128 \\
    --per_device_train_batch_size 16 \\
    --learning_rate 5e-5 \\
    --num_train_epochs 3 \\
    --output_dir /tmp/<span class="hljs-variable">$TASK_NAME</span>/ \\
    --overwrite_output_dir`,wrap:!1}}),Ls=new g({props:{code:"YWNjZWxlcmF0ZSUyMGxhdW5jaCUyMC0tbnVtX3Byb2Nlc3NlcyUzRDIlMjAlNUMlMEElMjAlMjAlMjAlMjAtLXVzZV9mc2RwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1taXhlZF9wcmVjaXNpb24lM0RiZjE2JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1mc2RwX2F1dG9fd3JhcF9wb2xpY3klM0RUUkFOU0ZPUk1FUl9CQVNFRF9XUkFQJTIwJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1mc2RwX3RyYW5zZm9ybWVyX2xheWVyX2Nsc190b193cmFwJTNEJTIyQmVydExheWVyJTIyJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1mc2RwX3NoYXJkaW5nX3N0cmF0ZWd5JTNEMSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZnNkcF9zdGF0ZV9kaWN0X3R5cGUlM0RGVUxMX1NUQVRFX0RJQ1QlMjAlNUMlMEElMjAlMjAlMjAlMjAuJTJGZXhhbXBsZXMlMkZweXRvcmNoJTJGdGV4dC1jbGFzc2lmaWNhdGlvbiUyRnJ1bl9nbHVlLnB5JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1tb2RlbF9uYW1lX29yX3BhdGglMjBnb29nbGUtYmVydCUyRmJlcnQtYmFzZS1jYXNlZCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tdGFza19uYW1lJTIwJTI0VEFTS19OQU1FJTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1kb190cmFpbiUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tZG9fZXZhbCUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbWF4X3NlcV9sZW5ndGglMjAxMjglMjAlNUMlMEElMjAlMjAlMjAlMjAtLXBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUyMDE2JTIwJTVDJTBBJTIwJTIwJTIwJTIwLS1sZWFybmluZ19yYXRlJTIwNWUtNSUyMCU1QyUwQSUyMCUyMCUyMCUyMC0tbnVtX3RyYWluX2Vwb2NocyUyMDMlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW91dHB1dF9kaXIlMjAlMkZ0bXAlMkYlMjRUQVNLX05BTUUlMkYlMjAlNUMlMEElMjAlMjAlMjAlMjAtLW92ZXJ3cml0ZV9vdXRwdXRfZGly",highlighted:`accelerate launch --num_processes=2 \\
    --use_fsdp \\
    --mixed_precision=bf16 \\
    --fsdp_auto_wrap_policy=TRANSFORMER_BASED_WRAP  \\
    --fsdp_transformer_layer_cls_to_wrap=<span class="hljs-string">&quot;BertLayer&quot;</span> \\
    --fsdp_sharding_strategy=1 \\
    --fsdp_state_dict_type=FULL_STATE_DICT \\
    ./examples/pytorch/text-classification/run_glue.py \\
    --model_name_or_path google-bert/bert-base-cased \\
    --task_name <span class="hljs-variable">$TASK_NAME</span> \\
    --do_train \\
    --do_eval \\
    --max_seq_length 128 \\
    --per_device_train_batch_size 16 \\
    --learning_rate 5e-5 \\
    --num_train_epochs 3 \\
    --output_dir /tmp/<span class="hljs-variable">$TASK_NAME</span>/ \\
    --overwrite_output_dir`,wrap:!1}}),qs=new ue({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/trainer.md"}}),{c(){t=i("meta"),M=r(),n=i("p"),U=r(),T(d.$$.fragment),u=r(),b=i("p"),b.innerHTML=I,A=r(),T(C.$$.fragment),m=r(),_=i("p"),_.innerHTML=Os,k=r(),T(V.$$.fragment),N=r(),$=i("p"),$.innerHTML=Ua,ll=r(),T(G.$$.fragment),al=r(),v=i("p"),v.innerHTML=da,el=r(),S=i("ol"),S.innerHTML=ua,tl=r(),Y=i("p"),Y.innerHTML=ha,nl=r(),H=i("p"),H.innerHTML=_a,rl=r(),T(z.$$.fragment),pl=r(),x=i("p"),x.innerHTML=ba,Ml=r(),L=i("p"),L.innerHTML=Ia,il=r(),T(D.$$.fragment),cl=r(),T(q.$$.fragment),ml=r(),P=i("p"),P.innerHTML=ga,ol=r(),T(O.$$.fragment),Tl=r(),K=i("p"),K.innerHTML=Aa,Jl=r(),ss=i("ul"),ss.innerHTML=Ca,jl=r(),ls=i("p"),ls.innerHTML=Za,wl=r(),T(as.$$.fragment),yl=r(),es=i("p"),es.innerHTML=Va,fl=r(),ts=i("ul"),ts.innerHTML=$a,Ul=r(),ns=i("p"),ns.innerHTML=Ba,dl=r(),T(rs.$$.fragment),ul=r(),T(ps.$$.fragment),hl=r(),Ms=i("p"),Ms.innerHTML=Qa,_l=r(),is=i("p"),is.textContent=Xa,bl=r(),T(cs.$$.fragment),Il=r(),ms=i("p"),ms.innerHTML=Wa,gl=r(),T(os.$$.fragment),Al=r(),T(Ts.$$.fragment),Cl=r(),T(Q.$$.fragment),Zl=r(),Js=i("p"),Js.innerHTML=Ea,Vl=r(),js=i("p"),js.innerHTML=Fa,$l=r(),T(X.$$.fragment),Bl=r(),ws=i("p"),ws.textContent=Ra,Ql=r(),T(ys.$$.fragment),Xl=r(),fs=i("p"),fs.innerHTML=ka,Wl=r(),T(W.$$.fragment),El=r(),T(Us.$$.fragment),Fl=r(),ds=i("p"),ds.innerHTML=Na,Rl=r(),T(us.$$.fragment),kl=r(),hs=i("p"),hs.textContent=Ga,Nl=r(),T(_s.$$.fragment),Gl=r(),bs=i("p"),bs.textContent=va,vl=r(),Is=i("p"),Is.textContent=Sa,Sl=r(),T(gs.$$.fragment),Yl=r(),As=i("p"),As.innerHTML=Ya,Hl=r(),T(Cs.$$.fragment),zl=r(),Zs=i("p"),Zs.innerHTML=Ha,xl=r(),T(Vs.$$.fragment),Ll=r(),$s=i("p"),$s.innerHTML=za,Dl=r(),Bs=i("p"),Bs.textContent=xa,ql=r(),Qs=i("p"),Qs.textContent=La,Pl=r(),Xs=i("p"),Xs.innerHTML=Da,Ol=r(),T(Ws.$$.fragment),Kl=r(),Es=i("p"),Es.innerHTML=qa,sa=r(),T(Fs.$$.fragment),la=r(),Rs=i("p"),Rs.innerHTML=Pa,aa=r(),T(E.$$.fragment),ea=r(),ks=i("p"),ks.innerHTML=Oa,ta=r(),T(Ns.$$.fragment),na=r(),T(Gs.$$.fragment),ra=r(),vs=i("p"),vs.innerHTML=Ka,pa=r(),T(F.$$.fragment),Ma=r(),Ss=i("p"),Ss.innerHTML=se,ia=r(),T(R.$$.fragment),ca=r(),Ys=i("p"),Ys.innerHTML=le,ma=r(),Hs=i("p"),Hs.innerHTML=ae,oa=r(),T(zs.$$.fragment),Ta=r(),xs=i("p"),xs.innerHTML=ee,Ja=r(),T(Ls.$$.fragment),ja=r(),Ds=i("p"),Ds.innerHTML=te,wa=r(),T(qs.$$.fragment),ya=r(),Ks=i("p"),this.h()},l(s){const l=Ue("svelte-u9bgzb",document.head);t=c(l,"META",{name:!0,content:!0}),l.forEach(a),M=p(s),n=c(s,"P",{}),oe(n).forEach(a),U=p(s),J(d.$$.fragment,s),u=p(s),b=c(s,"P",{"data-svelte-h":!0}),o(b)!=="svelte-oelftd"&&(b.innerHTML=I),A=p(s),J(C.$$.fragment,s),m=p(s),_=c(s,"P",{"data-svelte-h":!0}),o(_)!=="svelte-1cp0146"&&(_.innerHTML=Os),k=p(s),J(V.$$.fragment,s),N=p(s),$=c(s,"P",{"data-svelte-h":!0}),o($)!=="svelte-1leqz8r"&&($.innerHTML=Ua),ll=p(s),J(G.$$.fragment,s),al=p(s),v=c(s,"P",{"data-svelte-h":!0}),o(v)!=="svelte-1ooomgl"&&(v.innerHTML=da),el=p(s),S=c(s,"OL",{"data-svelte-h":!0}),o(S)!=="svelte-1paahjl"&&(S.innerHTML=ua),tl=p(s),Y=c(s,"P",{"data-svelte-h":!0}),o(Y)!=="svelte-1szp2r2"&&(Y.innerHTML=ha),nl=p(s),H=c(s,"P",{"data-svelte-h":!0}),o(H)!=="svelte-1r982cz"&&(H.innerHTML=_a),rl=p(s),J(z.$$.fragment,s),pl=p(s),x=c(s,"P",{"data-svelte-h":!0}),o(x)!=="svelte-11ys974"&&(x.innerHTML=ba),Ml=p(s),L=c(s,"P",{"data-svelte-h":!0}),o(L)!=="svelte-i7ivlo"&&(L.innerHTML=Ia),il=p(s),J(D.$$.fragment,s),cl=p(s),J(q.$$.fragment,s),ml=p(s),P=c(s,"P",{"data-svelte-h":!0}),o(P)!=="svelte-d1pqo5"&&(P.innerHTML=ga),ol=p(s),J(O.$$.fragment,s),Tl=p(s),K=c(s,"P",{"data-svelte-h":!0}),o(K)!=="svelte-qcuifm"&&(K.innerHTML=Aa),Jl=p(s),ss=c(s,"UL",{"data-svelte-h":!0}),o(ss)!=="svelte-1biqkkg"&&(ss.innerHTML=Ca),jl=p(s),ls=c(s,"P",{"data-svelte-h":!0}),o(ls)!=="svelte-193weoc"&&(ls.innerHTML=Za),wl=p(s),J(as.$$.fragment,s),yl=p(s),es=c(s,"P",{"data-svelte-h":!0}),o(es)!=="svelte-1nlfreb"&&(es.innerHTML=Va),fl=p(s),ts=c(s,"UL",{"data-svelte-h":!0}),o(ts)!=="svelte-n92e91"&&(ts.innerHTML=$a),Ul=p(s),ns=c(s,"P",{"data-svelte-h":!0}),o(ns)!=="svelte-jxuu6d"&&(ns.innerHTML=Ba),dl=p(s),J(rs.$$.fragment,s),ul=p(s),J(ps.$$.fragment,s),hl=p(s),Ms=c(s,"P",{"data-svelte-h":!0}),o(Ms)!=="svelte-1rk7y00"&&(Ms.innerHTML=Qa),_l=p(s),is=c(s,"P",{"data-svelte-h":!0}),o(is)!=="svelte-1sr1d63"&&(is.textContent=Xa),bl=p(s),J(cs.$$.fragment,s),Il=p(s),ms=c(s,"P",{"data-svelte-h":!0}),o(ms)!=="svelte-lfkhw6"&&(ms.innerHTML=Wa),gl=p(s),J(os.$$.fragment,s),Al=p(s),J(Ts.$$.fragment,s),Cl=p(s),J(Q.$$.fragment,s),Zl=p(s),Js=c(s,"P",{"data-svelte-h":!0}),o(Js)!=="svelte-ew6ybd"&&(Js.innerHTML=Ea),Vl=p(s),js=c(s,"P",{"data-svelte-h":!0}),o(js)!=="svelte-1xaqk62"&&(js.innerHTML=Fa),$l=p(s),J(X.$$.fragment,s),Bl=p(s),ws=c(s,"P",{"data-svelte-h":!0}),o(ws)!=="svelte-1dt04b5"&&(ws.textContent=Ra),Ql=p(s),J(ys.$$.fragment,s),Xl=p(s),fs=c(s,"P",{"data-svelte-h":!0}),o(fs)!=="svelte-1dk6uay"&&(fs.innerHTML=ka),Wl=p(s),J(W.$$.fragment,s),El=p(s),J(Us.$$.fragment,s),Fl=p(s),ds=c(s,"P",{"data-svelte-h":!0}),o(ds)!=="svelte-1vk8u6p"&&(ds.innerHTML=Na),Rl=p(s),J(us.$$.fragment,s),kl=p(s),hs=c(s,"P",{"data-svelte-h":!0}),o(hs)!=="svelte-1ft34jp"&&(hs.textContent=Ga),Nl=p(s),J(_s.$$.fragment,s),Gl=p(s),bs=c(s,"P",{"data-svelte-h":!0}),o(bs)!=="svelte-zig1fw"&&(bs.textContent=va),vl=p(s),Is=c(s,"P",{"data-svelte-h":!0}),o(Is)!=="svelte-15aiu37"&&(Is.textContent=Sa),Sl=p(s),J(gs.$$.fragment,s),Yl=p(s),As=c(s,"P",{"data-svelte-h":!0}),o(As)!=="svelte-13s90m9"&&(As.innerHTML=Ya),Hl=p(s),J(Cs.$$.fragment,s),zl=p(s),Zs=c(s,"P",{"data-svelte-h":!0}),o(Zs)!=="svelte-q0mtk0"&&(Zs.innerHTML=Ha),xl=p(s),J(Vs.$$.fragment,s),Ll=p(s),$s=c(s,"P",{"data-svelte-h":!0}),o($s)!=="svelte-9wx27h"&&($s.innerHTML=za),Dl=p(s),Bs=c(s,"P",{"data-svelte-h":!0}),o(Bs)!=="svelte-3m2n0g"&&(Bs.textContent=xa),ql=p(s),Qs=c(s,"P",{"data-svelte-h":!0}),o(Qs)!=="svelte-o488v2"&&(Qs.textContent=La),Pl=p(s),Xs=c(s,"P",{"data-svelte-h":!0}),o(Xs)!=="svelte-6sty29"&&(Xs.innerHTML=Da),Ol=p(s),J(Ws.$$.fragment,s),Kl=p(s),Es=c(s,"P",{"data-svelte-h":!0}),o(Es)!=="svelte-1h6bbfe"&&(Es.innerHTML=qa),sa=p(s),J(Fs.$$.fragment,s),la=p(s),Rs=c(s,"P",{"data-svelte-h":!0}),o(Rs)!=="svelte-19j518g"&&(Rs.innerHTML=Pa),aa=p(s),J(E.$$.fragment,s),ea=p(s),ks=c(s,"P",{"data-svelte-h":!0}),o(ks)!=="svelte-16ffc3o"&&(ks.innerHTML=Oa),ta=p(s),J(Ns.$$.fragment,s),na=p(s),J(Gs.$$.fragment,s),ra=p(s),vs=c(s,"P",{"data-svelte-h":!0}),o(vs)!=="svelte-cebzf0"&&(vs.innerHTML=Ka),pa=p(s),J(F.$$.fragment,s),Ma=p(s),Ss=c(s,"P",{"data-svelte-h":!0}),o(Ss)!=="svelte-59vw8r"&&(Ss.innerHTML=se),ia=p(s),J(R.$$.fragment,s),ca=p(s),Ys=c(s,"P",{"data-svelte-h":!0}),o(Ys)!=="svelte-nnlmaz"&&(Ys.innerHTML=le),ma=p(s),Hs=c(s,"P",{"data-svelte-h":!0}),o(Hs)!=="svelte-uvyyka"&&(Hs.innerHTML=ae),oa=p(s),J(zs.$$.fragment,s),Ta=p(s),xs=c(s,"P",{"data-svelte-h":!0}),o(xs)!=="svelte-1nohodh"&&(xs.innerHTML=ee),Ja=p(s),J(Ls.$$.fragment,s),ja=p(s),Ds=c(s,"P",{"data-svelte-h":!0}),o(Ds)!=="svelte-1xu5fm6"&&(Ds.innerHTML=te),wa=p(s),J(qs.$$.fragment,s),ya=p(s),Ks=c(s,"P",{}),oe(Ks).forEach(a),this.h()},h(){Te(t,"name","hf:doc:metadata"),Te(t,"content",Fe)},m(s,l){de(document.head,t),e(s,M,l),e(s,n,l),e(s,U,l),j(d,s,l),e(s,u,l),e(s,b,l),e(s,A,l),j(C,s,l),e(s,m,l),e(s,_,l),e(s,k,l),j(V,s,l),e(s,N,l),e(s,$,l),e(s,ll,l),j(G,s,l),e(s,al,l),e(s,v,l),e(s,el,l),e(s,S,l),e(s,tl,l),e(s,Y,l),e(s,nl,l),e(s,H,l),e(s,rl,l),j(z,s,l),e(s,pl,l),e(s,x,l),e(s,Ml,l),e(s,L,l),e(s,il,l),j(D,s,l),e(s,cl,l),j(q,s,l),e(s,ml,l),e(s,P,l),e(s,ol,l),j(O,s,l),e(s,Tl,l),e(s,K,l),e(s,Jl,l),e(s,ss,l),e(s,jl,l),e(s,ls,l),e(s,wl,l),j(as,s,l),e(s,yl,l),e(s,es,l),e(s,fl,l),e(s,ts,l),e(s,Ul,l),e(s,ns,l),e(s,dl,l),j(rs,s,l),e(s,ul,l),j(ps,s,l),e(s,hl,l),e(s,Ms,l),e(s,_l,l),e(s,is,l),e(s,bl,l),j(cs,s,l),e(s,Il,l),e(s,ms,l),e(s,gl,l),j(os,s,l),e(s,Al,l),j(Ts,s,l),e(s,Cl,l),j(Q,s,l),e(s,Zl,l),e(s,Js,l),e(s,Vl,l),e(s,js,l),e(s,$l,l),j(X,s,l),e(s,Bl,l),e(s,ws,l),e(s,Ql,l),j(ys,s,l),e(s,Xl,l),e(s,fs,l),e(s,Wl,l),j(W,s,l),e(s,El,l),j(Us,s,l),e(s,Fl,l),e(s,ds,l),e(s,Rl,l),j(us,s,l),e(s,kl,l),e(s,hs,l),e(s,Nl,l),j(_s,s,l),e(s,Gl,l),e(s,bs,l),e(s,vl,l),e(s,Is,l),e(s,Sl,l),j(gs,s,l),e(s,Yl,l),e(s,As,l),e(s,Hl,l),j(Cs,s,l),e(s,zl,l),e(s,Zs,l),e(s,xl,l),j(Vs,s,l),e(s,Ll,l),e(s,$s,l),e(s,Dl,l),e(s,Bs,l),e(s,ql,l),e(s,Qs,l),e(s,Pl,l),e(s,Xs,l),e(s,Ol,l),j(Ws,s,l),e(s,Kl,l),e(s,Es,l),e(s,sa,l),j(Fs,s,l),e(s,la,l),e(s,Rs,l),e(s,aa,l),j(E,s,l),e(s,ea,l),e(s,ks,l),e(s,ta,l),j(Ns,s,l),e(s,na,l),j(Gs,s,l),e(s,ra,l),e(s,vs,l),e(s,pa,l),j(F,s,l),e(s,Ma,l),e(s,Ss,l),e(s,ia,l),j(R,s,l),e(s,ca,l),e(s,Ys,l),e(s,ma,l),e(s,Hs,l),e(s,oa,l),j(zs,s,l),e(s,Ta,l),e(s,xs,l),e(s,Ja,l),j(Ls,s,l),e(s,ja,l),e(s,Ds,l),e(s,wa,l),j(qs,s,l),e(s,ya,l),e(s,Ks,l),fa=!0},p(s,[l]){const ne={};l&2&&(ne.$$scope={dirty:l,ctx:s}),C.$set(ne);const re={};l&2&&(re.$$scope={dirty:l,ctx:s}),Q.$set(re);const pe={};l&2&&(pe.$$scope={dirty:l,ctx:s}),X.$set(pe);const Me={};l&2&&(Me.$$scope={dirty:l,ctx:s}),W.$set(Me);const ie={};l&2&&(ie.$$scope={dirty:l,ctx:s}),E.$set(ie);const ce={};l&2&&(ce.$$scope={dirty:l,ctx:s}),F.$set(ce);const me={};l&2&&(me.$$scope={dirty:l,ctx:s}),R.$set(me)},i(s){fa||(w(d.$$.fragment,s),w(C.$$.fragment,s),w(V.$$.fragment,s),w(G.$$.fragment,s),w(z.$$.fragment,s),w(D.$$.fragment,s),w(q.$$.fragment,s),w(O.$$.fragment,s),w(as.$$.fragment,s),w(rs.$$.fragment,s),w(ps.$$.fragment,s),w(cs.$$.fragment,s),w(os.$$.fragment,s),w(Ts.$$.fragment,s),w(Q.$$.fragment,s),w(X.$$.fragment,s),w(ys.$$.fragment,s),w(W.$$.fragment,s),w(Us.$$.fragment,s),w(us.$$.fragment,s),w(_s.$$.fragment,s),w(gs.$$.fragment,s),w(Cs.$$.fragment,s),w(Vs.$$.fragment,s),w(Ws.$$.fragment,s),w(Fs.$$.fragment,s),w(E.$$.fragment,s),w(Ns.$$.fragment,s),w(Gs.$$.fragment,s),w(F.$$.fragment,s),w(R.$$.fragment,s),w(zs.$$.fragment,s),w(Ls.$$.fragment,s),w(qs.$$.fragment,s),fa=!0)},o(s){y(d.$$.fragment,s),y(C.$$.fragment,s),y(V.$$.fragment,s),y(G.$$.fragment,s),y(z.$$.fragment,s),y(D.$$.fragment,s),y(q.$$.fragment,s),y(O.$$.fragment,s),y(as.$$.fragment,s),y(rs.$$.fragment,s),y(ps.$$.fragment,s),y(cs.$$.fragment,s),y(os.$$.fragment,s),y(Ts.$$.fragment,s),y(Q.$$.fragment,s),y(X.$$.fragment,s),y(ys.$$.fragment,s),y(W.$$.fragment,s),y(Us.$$.fragment,s),y(us.$$.fragment,s),y(_s.$$.fragment,s),y(gs.$$.fragment,s),y(Cs.$$.fragment,s),y(Vs.$$.fragment,s),y(Ws.$$.fragment,s),y(Fs.$$.fragment,s),y(E.$$.fragment,s),y(Ns.$$.fragment,s),y(Gs.$$.fragment,s),y(F.$$.fragment,s),y(R.$$.fragment,s),y(zs.$$.fragment,s),y(Ls.$$.fragment,s),y(qs.$$.fragment,s),fa=!1},d(s){s&&(a(M),a(n),a(U),a(u),a(b),a(A),a(m),a(_),a(k),a(N),a($),a(ll),a(al),a(v),a(el),a(S),a(tl),a(Y),a(nl),a(H),a(rl),a(pl),a(x),a(Ml),a(L),a(il),a(cl),a(ml),a(P),a(ol),a(Tl),a(K),a(Jl),a(ss),a(jl),a(ls),a(wl),a(yl),a(es),a(fl),a(ts),a(Ul),a(ns),a(dl),a(ul),a(hl),a(Ms),a(_l),a(is),a(bl),a(Il),a(ms),a(gl),a(Al),a(Cl),a(Zl),a(Js),a(Vl),a(js),a($l),a(Bl),a(ws),a(Ql),a(Xl),a(fs),a(Wl),a(El),a(Fl),a(ds),a(Rl),a(kl),a(hs),a(Nl),a(Gl),a(bs),a(vl),a(Is),a(Sl),a(Yl),a(As),a(Hl),a(zl),a(Zs),a(xl),a(Ll),a($s),a(Dl),a(Bs),a(ql),a(Qs),a(Pl),a(Xs),a(Ol),a(Kl),a(Es),a(sa),a(la),a(Rs),a(aa),a(ea),a(ks),a(ta),a(na),a(ra),a(vs),a(pa),a(Ma),a(Ss),a(ia),a(ca),a(Ys),a(ma),a(Hs),a(oa),a(Ta),a(xs),a(Ja),a(ja),a(Ds),a(wa),a(ya),a(Ks)),a(t),f(d,s),f(C,s),f(V,s),f(G,s),f(z,s),f(D,s),f(q,s),f(O,s),f(as,s),f(rs,s),f(ps,s),f(cs,s),f(os,s),f(Ts,s),f(Q,s),f(X,s),f(ys,s),f(W,s),f(Us,s),f(us,s),f(_s,s),f(gs,s),f(Cs,s),f(Vs,s),f(Ws,s),f(Fs,s),f(E,s),f(Ns,s),f(Gs,s),f(F,s),f(R,s),f(zs,s),f(Ls,s),f(qs,s)}}}const Fe='{"title":"Trainer","local":"trainer","sections":[{"title":"기본 사용법","local":"basic-usage","sections":[{"title":"체크포인트","local":"checkpoints","sections":[],"depth":3}],"depth":2},{"title":"Trainer 맞춤 설정","local":"customize-the-trainer","sections":[{"title":"콜백","local":"callbacks","sections":[],"depth":3}],"depth":2},{"title":"로깅","local":"logging","sections":[],"depth":2},{"title":"NEFTune","local":"neftune","sections":[],"depth":2},{"title":"GaLore","local":"galore","sections":[],"depth":2},{"title":"LOMO 옵티마이저","local":"lomo-optimizer","sections":[],"depth":2},{"title":"Accelerate와 Trainer","local":"accelerate-and-trainer","sections":[],"depth":2}],"depth":1}';function Re(h){return we(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class He extends ye{constructor(t){super(),fe(this,t,Re,Ee,je,{})}}export{He as component};
