import{s as Ee,o as ze,n as gt}from"../chunks/scheduler.9bc65507.js";import{S as Ae,i as Ie,g as T,s as o,r as d,A as He,h as w,f as l,c as i,j as Fe,u,x as h,k as Qe,y as Le,a as n,v as c,d as M,t as y,w as $}from"../chunks/index.707bf1b6.js";import{T as ce}from"../chunks/Tip.c2ecdbf4.js";import{C as W}from"../chunks/CodeBlock.54a9f38d.js";import{H as X,E as qe}from"../chunks/EditOnGithub.922df6ba.js";import{H as Ve,a as ue}from"../chunks/HfOption.6d864328.js";function xe(U){let s,r;return s=new W({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGFjY2VsZXJhdGUlMjBiaXRzYW5kYnl0ZXMlM0UwLjM3LjA=",highlighted:"pip install transformers accelerate bitsandbytes&gt;0.37.0",wrap:!1}}),{c(){d(s.$$.fragment)},l(a){u(s.$$.fragment,a)},m(a,f){c(s,a,f),r=!0},p:gt,i(a){r||(M(s.$$.fragment,a),r=!0)},o(a){y(s.$$.fragment,a),r=!1},d(a){$(s,a)}}}function Ye(U){let s,r;return s=new W({props:{code:"cGlwJTIwaW5zdGFsbCUyMGJpdHNhbmRieXRlcyUzRSUzRDAuMzkuMCUwQXBpcCUyMGluc3RhbGwlMjAtLXVwZ3JhZGUlMjBhY2NlbGVyYXRlJTIwdHJhbnNmb3JtZXJz",highlighted:`pip install bitsandbytes&gt;=0.39.0
pip install --upgrade accelerate transformers`,wrap:!1}}),{c(){d(s.$$.fragment)},l(a){u(s.$$.fragment,a)},m(a,f){c(s,a,f),r=!0},p:gt,i(a){r||(M(s.$$.fragment,a),r=!0)},o(a){y(s.$$.fragment,a),r=!1},d(a){$(s,a)}}}function Se(U){let s,r,a,f;return s=new ue({props:{id:"bnb",option:"8-bit",$$slots:{default:[xe]},$$scope:{ctx:U}}}),a=new ue({props:{id:"bnb",option:"4-bit",$$slots:{default:[Ye]},$$scope:{ctx:U}}}),{c(){d(s.$$.fragment),r=o(),d(a.$$.fragment)},l(p){u(s.$$.fragment,p),r=i(p),u(a.$$.fragment,p)},m(p,J){c(s,p,J),n(p,r,J),c(a,p,J),f=!0},p(p,J){const Z={};J&2&&(Z.$$scope={dirty:J,ctx:p}),s.$set(Z);const C={};J&2&&(C.$$scope={dirty:J,ctx:p}),a.$set(C)},i(p){f||(M(s.$$.fragment,p),M(a.$$.fragment,p),f=!0)},o(p){y(s.$$.fragment,p),y(a.$$.fragment,p),f=!1},d(p){p&&l(r),$(s,p),$(a,p)}}}function Pe(U){let s,r="모델을 8비트로 양자화하면 메모리 사용량이 절반으로 줄어들며, 대규모 모델의 경우 사용 가능한 GPU를 효율적으로 활용하려면 <code>device_map=&quot;auto&quot;</code>를 설정하세요.",a,f,p,J,Z="기본적으로 <code>torch.nn.LayerNorm</code>과 같은 다른 모듈은 <code>torch.float16</code>으로 변환됩니다. 원한다면 <code>torch_dtype</code> 매개변수로 이들 모듈의 데이터 유형을 변경할 수 있습니다:",C,_,B,j,G="모델이 8비트로 양자화되면 최신 버전의 Transformers와 bitsandbytes를 사용하지 않는 한 양자화된 가중치를 Hub에 푸시할 수 없습니다. 최신 버전을 사용하는 경우, <code>push_to_hub()</code> 메소드를 사용하여 8비트 모델을 Hub에 푸시할 수 있습니다. 양자화 config.json 파일이 먼저 푸시되고, 그 다음 양자화된 모델 가중치가 푸시됩니다.",v,m,g;return f=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTBBJTBBcXVhbnRpemF0aW9uX2NvbmZpZyUyMCUzRCUyMEJpdHNBbmRCeXRlc0NvbmZpZyhsb2FkX2luXzhiaXQlM0RUcnVlKSUwQSUwQW1vZGVsXzhiaXQlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyYmlnc2NpZW5jZSUyRmJsb29tLTFiNyUyMiUyQyUyMCUwQSUyMCUyMCUyMCUyMHF1YW50aXphdGlvbl9jb25maWclM0RxdWFudGl6YXRpb25fY29uZmlnJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(load_in_8bit=<span class="hljs-literal">True</span>)

model_8bit = AutoModelForCausalLM.from_pretrained(
    <span class="hljs-string">&quot;bigscience/bloom-1b7&quot;</span>, 
    quantization_config=quantization_config
)`,wrap:!1}}),_=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0lMkMlMjBCaXRzQW5kQnl0ZXNDb25maWclMEElMEFxdWFudGl6YXRpb25fY29uZmlnJTIwJTNEJTIwQml0c0FuZEJ5dGVzQ29uZmlnKGxvYWRfaW5fOGJpdCUzRFRydWUpJTBBJTBBbW9kZWxfOGJpdCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyJTJDJTIwJTBBJTIwJTIwJTIwJTIwcXVhbnRpemF0aW9uX2NvbmZpZyUzRHF1YW50aXphdGlvbl9jb25maWclMkMlMjAlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MzIlMEEpJTBBbW9kZWxfOGJpdC5tb2RlbC5kZWNvZGVyLmxheWVycyU1Qi0xJTVELmZpbmFsX2xheWVyX25vcm0ud2VpZ2h0LmR0eXBl",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(load_in_8bit=<span class="hljs-literal">True</span>)

model_8bit = AutoModelForCausalLM.from_pretrained(
    <span class="hljs-string">&quot;facebook/opt-350m&quot;</span>, 
    quantization_config=quantization_config, 
    torch_dtype=torch.float32
)
model_8bit.model.decoder.layers[-<span class="hljs-number">1</span>].final_layer_norm.weight.dtype`,wrap:!1}}),m=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUyQyUyMEJpdHNBbmRCeXRlc0NvbmZpZyUwQSUwQXF1YW50aXphdGlvbl9jb25maWclMjAlM0QlMjBCaXRzQW5kQnl0ZXNDb25maWcobG9hZF9pbl84Yml0JTNEVHJ1ZSklMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJiaWdzY2llbmNlJTJGYmxvb20tNTYwbSUyMiUyQyUyMCUwQSUyMCUyMCUyMCUyMHF1YW50aXphdGlvbl9jb25maWclM0RxdWFudGl6YXRpb25fY29uZmlnJTBBKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmJpZ3NjaWVuY2UlMkZibG9vbS01NjBtJTIyKSUwQSUwQW1vZGVsLnB1c2hfdG9faHViKCUyMmJsb29tLTU2MG0tOGJpdCUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(load_in_8bit=<span class="hljs-literal">True</span>)

model = AutoModelForCausalLM.from_pretrained(
    <span class="hljs-string">&quot;bigscience/bloom-560m&quot;</span>, 
    quantization_config=quantization_config
)
tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bigscience/bloom-560m&quot;</span>)

model.push_to_hub(<span class="hljs-string">&quot;bloom-560m-8bit&quot;</span>)`,wrap:!1}}),{c(){s=T("p"),s.innerHTML=r,a=o(),d(f.$$.fragment),p=o(),J=T("p"),J.innerHTML=Z,C=o(),d(_.$$.fragment),B=o(),j=T("p"),j.innerHTML=G,v=o(),d(m.$$.fragment)},l(b){s=w(b,"P",{"data-svelte-h":!0}),h(s)!=="svelte-bdtlp"&&(s.innerHTML=r),a=i(b),u(f.$$.fragment,b),p=i(b),J=w(b,"P",{"data-svelte-h":!0}),h(J)!=="svelte-171qp9u"&&(J.innerHTML=Z),C=i(b),u(_.$$.fragment,b),B=i(b),j=w(b,"P",{"data-svelte-h":!0}),h(j)!=="svelte-87vx31"&&(j.innerHTML=G),v=i(b),u(m.$$.fragment,b)},m(b,R){n(b,s,R),n(b,a,R),c(f,b,R),n(b,p,R),n(b,J,R),n(b,C,R),c(_,b,R),n(b,B,R),n(b,j,R),n(b,v,R),c(m,b,R),g=!0},p:gt,i(b){g||(M(f.$$.fragment,b),M(_.$$.fragment,b),M(m.$$.fragment,b),g=!0)},o(b){y(f.$$.fragment,b),y(_.$$.fragment,b),y(m.$$.fragment,b),g=!1},d(b){b&&(l(s),l(a),l(p),l(J),l(C),l(B),l(j),l(v)),$(f,b),$(_,b),$(m,b)}}}function De(U){let s,r="모델을 4비트로 양자화하면 메모리 사용량이 4배 줄어들며, 대규모 모델의 경우 사용 가능한 GPU를 효율적으로 활용하려면 <code>device_map=&quot;auto&quot;</code>를 설정하세요:",a,f,p,J,Z="기본적으로 <code>torch.nn.LayerNorm</code>과 같은 다른 모듈은 <code>torch.float16</code>으로 변환됩니다. 원한다면 <code>torch_dtype</code> 매개변수로 이들 모듈의 데이터 유형을 변경할 수 있습니다:",C,_,B,j,G="<code>bitsandbytes&gt;=0.41.3</code>을 사용하는 경우 4비트 모델을 직렬화하고 Hugging Face Hub에 푸시할 수 있습니다. 모델을 4비트 정밀도로 가져온 후 <code>model.push_to_hub()</code>를 호출하면 됩니다. 또한 <code>model.save_pretrained()</code> 명령어로 로컬에 직렬화된 4비트 모델을 저장할 수도 있습니다.",v;return f=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTBBJTBBcXVhbnRpemF0aW9uX2NvbmZpZyUyMCUzRCUyMEJpdHNBbmRCeXRlc0NvbmZpZyhsb2FkX2luXzRiaXQlM0RUcnVlKSUwQSUwQW1vZGVsXzRiaXQlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyYmlnc2NpZW5jZSUyRmJsb29tLTFiNyUyMiUyQyUwQSUyMCUyMCUyMCUyMHF1YW50aXphdGlvbl9jb25maWclM0RxdWFudGl6YXRpb25fY29uZmlnJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(load_in_4bit=<span class="hljs-literal">True</span>)

model_4bit = AutoModelForCausalLM.from_pretrained(
    <span class="hljs-string">&quot;bigscience/bloom-1b7&quot;</span>,
    quantization_config=quantization_config
)`,wrap:!1}}),_=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0lMkMlMjBCaXRzQW5kQnl0ZXNDb25maWclMEElMEFxdWFudGl6YXRpb25fY29uZmlnJTIwJTNEJTIwQml0c0FuZEJ5dGVzQ29uZmlnKGxvYWRfaW5fNGJpdCUzRFRydWUpJTBBJTBBbW9kZWxfNGJpdCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJmYWNlYm9vayUyRm9wdC0zNTBtJTIyJTJDJTBBJTIwJTIwJTIwJTIwcXVhbnRpemF0aW9uX2NvbmZpZyUzRHF1YW50aXphdGlvbl9jb25maWclMkMlMjAlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUzRHRvcmNoLmZsb2F0MzIlMEEpJTBBbW9kZWxfNGJpdC5tb2RlbC5kZWNvZGVyLmxheWVycyU1Qi0xJTVELmZpbmFsX2xheWVyX25vcm0ud2VpZ2h0LmR0eXBl",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(load_in_4bit=<span class="hljs-literal">True</span>)

model_4bit = AutoModelForCausalLM.from_pretrained(
    <span class="hljs-string">&quot;facebook/opt-350m&quot;</span>,
    quantization_config=quantization_config, 
    torch_dtype=torch.float32
)
model_4bit.model.decoder.layers[-<span class="hljs-number">1</span>].final_layer_norm.weight.dtype`,wrap:!1}}),{c(){s=T("p"),s.innerHTML=r,a=o(),d(f.$$.fragment),p=o(),J=T("p"),J.innerHTML=Z,C=o(),d(_.$$.fragment),B=o(),j=T("p"),j.innerHTML=G},l(m){s=w(m,"P",{"data-svelte-h":!0}),h(s)!=="svelte-8aquvh"&&(s.innerHTML=r),a=i(m),u(f.$$.fragment,m),p=i(m),J=w(m,"P",{"data-svelte-h":!0}),h(J)!=="svelte-171qp9u"&&(J.innerHTML=Z),C=i(m),u(_.$$.fragment,m),B=i(m),j=w(m,"P",{"data-svelte-h":!0}),h(j)!=="svelte-1e678s0"&&(j.innerHTML=G)},m(m,g){n(m,s,g),n(m,a,g),c(f,m,g),n(m,p,g),n(m,J,g),n(m,C,g),c(_,m,g),n(m,B,g),n(m,j,g),v=!0},p:gt,i(m){v||(M(f.$$.fragment,m),M(_.$$.fragment,m),v=!0)},o(m){y(f.$$.fragment,m),y(_.$$.fragment,m),v=!1},d(m){m&&(l(s),l(a),l(p),l(J),l(C),l(B),l(j)),$(f,m),$(_,m)}}}function Ke(U){let s,r,a,f;return s=new ue({props:{id:"bnb",option:"8-bit",$$slots:{default:[Pe]},$$scope:{ctx:U}}}),a=new ue({props:{id:"bnb",option:"4-bit",$$slots:{default:[De]},$$scope:{ctx:U}}}),{c(){d(s.$$.fragment),r=o(),d(a.$$.fragment)},l(p){u(s.$$.fragment,p),r=i(p),u(a.$$.fragment,p)},m(p,J){c(s,p,J),n(p,r,J),c(a,p,J),f=!0},p(p,J){const Z={};J&2&&(Z.$$scope={dirty:J,ctx:p}),s.$set(Z);const C={};J&2&&(C.$$scope={dirty:J,ctx:p}),a.$set(C)},i(p){f||(M(s.$$.fragment,p),M(a.$$.fragment,p),f=!0)},o(p){y(s.$$.fragment,p),y(a.$$.fragment,p),f=!1},d(p){p&&l(r),$(s,p),$(a,p)}}}function Oe(U){let s,r="8비트 및 4비트 가중치로 훈련하는 것은 <em>추가</em> 매개변수에 대해서만 지원됩니다.";return{c(){s=T("p"),s.innerHTML=r},l(a){s=w(a,"P",{"data-svelte-h":!0}),h(s)!=="svelte-kie4hd"&&(s.innerHTML=r)},m(a,f){n(a,s,f)},p:gt,d(a){a&&l(s)}}}function tl(U){let s,r='8비트 양자화에 대한 자세한 내용을 알고 싶다면 이 <a href="https://huggingface.co/blog/hf-bitsandbytes-integration" rel="nofollow">블로그 포스트</a>를 참조하세요!';return{c(){s=T("p"),s.innerHTML=r},l(a){s=w(a,"P",{"data-svelte-h":!0}),h(s)!=="svelte-wzc4n7"&&(s.innerHTML=r)},m(a,f){n(a,s,f)},p:gt,d(a){a&&l(s)}}}function el(U){let s,r='이 <a href="https://colab.research.google.com/drive/1ge2F1QSK8Q7h0hn3YKuBCOAS0bK8E0wf" rel="nofollow">노트북</a>에서 4비트 양자화를 시도해보고 자세한 내용은 이 <a href="https://huggingface.co/blog/4bit-transformers-bitsandbytes" rel="nofollow">블로그 게시물</a>에서 확인하세요.';return{c(){s=T("p"),s.innerHTML=r},l(a){s=w(a,"P",{"data-svelte-h":!0}),h(s)!=="svelte-1hh56xn"&&(s.innerHTML=r)},m(a,f){n(a,s,f)},p:gt,d(a){a&&l(s)}}}function ll(U){let s,r,a,f,p,J,Z,C='<a href="https://github.com/TimDettmers/bitsandbytes" rel="nofollow">bitsandbytes</a>는 모델을 8비트 및 4비트로 양자화하는 가장 쉬운 방법입니다. 8비트 양자화는 fp16의 이상치와 int8의 비이상치를 곱한 후, 비이상치 값을 fp16으로 다시 변환하고, 이들을 합산하여 fp16으로 가중치를 반환합니다. 이렇게 하면 이상치 값이 모델 성능에 미치는 저하 효과를 줄일 수 있습니다. 4비트 양자화는 모델을 더욱 압축하며, <a href="https://hf.co/papers/2305.14314" rel="nofollow">QLoRA</a>와 함께 사용하여 양자화된 대규모 언어 모델을 미세 조정하는 데 흔히 사용됩니다.',_,B,j="bitsandbytes를 사용하려면 다음 라이브러리가 설치되어 있어야 합니다:",G,v,m,g,b="이제 <code>BitsAndBytesConfig</code>를 <code>from_pretrained()</code> 메소드에 전달하여 모델을 양자화할 수 있습니다. 이는 Accelerate 가져오기를 지원하고 <code>torch.nn.Linear</code> 레이어가 포함된 모든 모델에서 작동합니다.",R,N,_t,k,Zt,V,Me="메모리 사용량을 확인하려면 <code>get_memory_footprint</code>를 사용하세요:",Ct,E,jt,z,ye="양자화된 모델은 <code>from_pretrained()</code> 메소드를 사용하여 <code>load_in_8bit</code> 또는 <code>load_in_4bit</code> 매개변수를 지정하지 않고도 가져올 수 있습니다:",vt,A,Wt,I,Bt,F,Rt,H,$e="이 섹션에서는 오프로딩, 이상치 임곗값, 모듈 변환 건너뛰기 및 미세 조정과 같은 8비트 모델의 특정 기능을 살펴봅니다.",Xt,L,Gt,q,Je='8비트 모델은 CPU와 GPU 간에 가중치를 오프로드하여 매우 큰 모델을 메모리에 장착할 수 있습니다. CPU로 전송된 가중치는 실제로 <strong>float32</strong>로 저장되며 8비트로 변환되지 않습니다. 예를 들어, <a href="https://huggingface.co/bigscience/bloom-1b7" rel="nofollow">bigscience/bloom-1b7</a> 모델의 오프로드를 활성화하려면 <code>BitsAndBytesConfig</code>를 생성하는 것부터 시작하세요:',Nt,x,kt,Y,Te="CPU에 전달할 <code>lm_head</code>를 제외한 모든 것을 GPU에 적재할 수 있도록 사용자 정의 디바이스 맵을 설계합니다:",Ft,S,Qt,P,we="이제 사용자 정의 <code>device_map</code>과 <code>quantization_config</code>을 사용하여 모델을 가져옵니다:",Vt,D,Et,K,zt,O,he="“이상치”는 특정 임곗값을 초과하는 은닉 상태 값을 의미하며, 이러한 값은 fp16으로 계산됩니다. 값은 일반적으로 정규 분포 ([-3.5, 3.5])를 따르지만, 대규모 모델의 경우 이 분포는 매우 다를 수 있습니다 ([-60, 6] 또는 [6, 60]). 8비트 양자화는 ~5 정도의 값에서 잘 작동하지만, 그 이상에서는 상당한 성능 저하가 발생합니다. 좋은 기본 임곗값 값은 6이지만, 더 불안정한 모델 (소형 모델 또는 미세 조정)에는 더 낮은 임곗값이 필요할 수 있습니다.",At,tt,ge="모델에 가장 적합한 임곗값을 찾으려면 <code>BitsAndBytesConfig</code>에서 <code>llm_int8_threshold</code> 매개변수를 실험해보는 것이 좋습니다:",It,et,Ht,lt,Lt,nt,Ue='<a href="model_doc/jukebox">Jukebox</a>와 같은 일부 모델은 모든 모듈을 8비트로 양자화할 필요가 없으며, 이는 실제로 불안정성을 유발할 수 있습니다. Jukebox의 경우, <code>BitsAndBytesConfig</code>의 <code>llm_int8_skip_modules</code> 매개변수를 사용하여 여러 <code>lm_head</code> 모듈을 건너뛰어야 합니다:',qt,st,xt,at,Yt,ot,_e='<a href="https://github.com/huggingface/peft" rel="nofollow">PEFT</a> 라이브러리를 사용하면 <a href="https://huggingface.co/google/flan-t5-large" rel="nofollow">flan-t5-large</a> 및 <a href="https://huggingface.co/facebook/opt-6.7b" rel="nofollow">facebook/opt-6.7b</a>와 같은 대규모 모델을 8비트 양자화로 미세 조정할 수 있습니다. 훈련 시 <code>device_map</code> 매개변수를 전달할 필요가 없으며, 모델을 자동으로 GPU에 가져옵니다. 그러나 원하는 경우 <code>device_map</code> 매개변수로 장치 맵을 사용자 정의할 수 있습니다 (<code>device_map=&quot;auto&quot;</code>는 추론에만 사용해야 합니다).',St,it,Pt,Q,Dt,pt,Ze="이 섹션에서는 계산 데이터 유형 변경, Normal Float 4 (NF4) 데이터 유형 사용, 중첩 양자화 사용과 같은 4비트 모델의 특정 기능 일부를 탐구합니다.",Kt,mt,Ot,ft,Ce="계산 속도를 높이기 위해 <code>BitsAndBytesConfig</code>에서 <code>bnb_4bit_compute_dtype</code> 매개변수를 사용하여 데이터 유형을 float32(기본값)에서 bf16으로 변경할 수 있습니다:",te,rt,ee,bt,le,dt,je='NF4는 <a href="https://hf.co/papers/2305.14314" rel="nofollow">QLoRA</a> 논문에서 소개된 4비트 데이터 유형으로, 정규 분포에서 초기화된 가중치에 적합합니다. 4비트 기반 모델을 훈련할 때 NF4를 사용해야 합니다. 이는 <code>BitsAndBytesConfig</code>에서 <code>bnb_4bit_quant_type</code> 매개변수로 설정할 수 있습니다:',ne,ut,se,ct,ve="추론의 경우, <code>bnb_4bit_quant_type</code>은 성능에 큰 영향을 미치지 않습니다. 그러나 모델 가중치와 일관성을 유지하기 위해 <code>bnb_4bit_compute_dtype</code> 및 <code>torch_dtype</code> 값을 사용해야 합니다.",ae,Mt,oe,yt,We='중첩 양자화는 추가적인 성능 손실 없이 추가적인 메모리를 절약할 수 있는 기술입니다. 이 기능은 이미 양자화된 가중치의 2차 양자화를 수행하여 매개변수당 추가로 0.4비트를 절약합니다. 예를 들어, 중첩 양자화를 통해 16GB NVIDIA T4 GPU에서 시퀀스 길이 1024, 배치 크기 1, 그레이디언트 누적 4단계를 사용하여 <a href="https://huggingface.co/meta-llama/Llama-2-13b" rel="nofollow">Llama-13b</a> 모델을 미세 조정할 수 있습니다.',ie,$t,pe,Jt,me,Tt,Be="양자화된 후에는 모델을 원래의 정밀도로 비양자화할 수 있지만, 이는 모델의 품질이 약간 저하될 수 있습니다. 비양자화된 모델에 맞출 수 있는 충분한 GPU RAM이 있는지 확인하세요.",fe,wt,re,ht,be,Ut,de;return p=new X({props:{title:"bitsandbytes",local:"bitsandbytes",headingTag:"h1"}}),v=new Ve({props:{id:"bnb",options:["8-bit","4-bit"],$$slots:{default:[Se]},$$scope:{ctx:U}}}),N=new Ve({props:{id:"bnb",options:["8-bit","4-bit"],$$slots:{default:[Ke]},$$scope:{ctx:U}}}),k=new ce({props:{warning:!0,$$slots:{default:[Oe]},$$scope:{ctx:U}}}),E=new W({props:{code:"cHJpbnQobW9kZWwuZ2V0X21lbW9yeV9mb290cHJpbnQoKSk=",highlighted:'<span class="hljs-built_in">print</span>(model.get_memory_footprint())',wrap:!1}}),A=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUyMiU3QnlvdXJfdXNlcm5hbWUlN0QlMkZibG9vbS01NjBtLThiaXQlMjIlMkMlMjBkZXZpY2VfbWFwJTNEJTIyYXV0byUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;{your_username}/bloom-560m-8bit&quot;</span>, device_map=<span class="hljs-string">&quot;auto&quot;</span>)`,wrap:!1}}),I=new X({props:{title:"8비트 (LLM.int8() 알고리즘)",local:"8-bit-(llm.int8()-algorithm)",headingTag:"h2"}}),F=new ce({props:{$$slots:{default:[tl]},$$scope:{ctx:U}}}),L=new X({props:{title:"오프로딩",local:"offloading",headingTag:"h3"}}),x=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTBBJTBBcXVhbnRpemF0aW9uX2NvbmZpZyUyMCUzRCUyMEJpdHNBbmRCeXRlc0NvbmZpZyhsbG1faW50OF9lbmFibGVfZnAzMl9jcHVfb2ZmbG9hZCUzRFRydWUp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(llm_int8_enable_fp32_cpu_offload=<span class="hljs-literal">True</span>)`,wrap:!1}}),S=new W({props:{code:"ZGV2aWNlX21hcCUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMnRyYW5zZm9ybWVyLndvcmRfZW1iZWRkaW5ncyUyMiUzQSUyMDAlMkMlMEElMjAlMjAlMjAlMjAlMjJ0cmFuc2Zvcm1lci53b3JkX2VtYmVkZGluZ3NfbGF5ZXJub3JtJTIyJTNBJTIwMCUyQyUwQSUyMCUyMCUyMCUyMCUyMmxtX2hlYWQlMjIlM0ElMjAlMjJjcHUlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJ0cmFuc2Zvcm1lci5oJTIyJTNBJTIwMCUyQyUwQSUyMCUyMCUyMCUyMCUyMnRyYW5zZm9ybWVyLmxuX2YlMjIlM0ElMjAwJTJDJTBBJTdE",highlighted:`device_map = {
    <span class="hljs-string">&quot;transformer.word_embeddings&quot;</span>: <span class="hljs-number">0</span>,
    <span class="hljs-string">&quot;transformer.word_embeddings_layernorm&quot;</span>: <span class="hljs-number">0</span>,
    <span class="hljs-string">&quot;lm_head&quot;</span>: <span class="hljs-string">&quot;cpu&quot;</span>,
    <span class="hljs-string">&quot;transformer.h&quot;</span>: <span class="hljs-number">0</span>,
    <span class="hljs-string">&quot;transformer.ln_f&quot;</span>: <span class="hljs-number">0</span>,
}`,wrap:!1}}),D=new W({props:{code:"bW9kZWxfOGJpdCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJiaWdzY2llbmNlJTJGYmxvb20tMWI3JTIyJTJDJTBBJTIwJTIwJTIwJTIwZGV2aWNlX21hcCUzRGRldmljZV9tYXAlMkMlMEElMjAlMjAlMjAlMjBxdWFudGl6YXRpb25fY29uZmlnJTNEcXVhbnRpemF0aW9uX2NvbmZpZyUyQyUwQSk=",highlighted:`model_8bit = AutoModelForCausalLM.from_pretrained(
    <span class="hljs-string">&quot;bigscience/bloom-1b7&quot;</span>,
    device_map=device_map,
    quantization_config=quantization_config,
)`,wrap:!1}}),K=new X({props:{title:"이상치 임곗값",local:"outlier-threshold",headingTag:"h3"}}),et=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJiaWdzY2llbmNlJTJGYmxvb20tMWI3JTIyJTBBJTBBcXVhbnRpemF0aW9uX2NvbmZpZyUyMCUzRCUyMEJpdHNBbmRCeXRlc0NvbmZpZyglMEElMjAlMjAlMjAlMjBsbG1faW50OF90aHJlc2hvbGQlM0QxMCUyQyUwQSklMEElMEFtb2RlbF84Yml0JTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMG1vZGVsX2lkJTJDJTBBJTIwJTIwJTIwJTIwZGV2aWNlX21hcCUzRGRldmljZV9tYXAlMkMlMEElMjAlMjAlMjAlMjBxdWFudGl6YXRpb25fY29uZmlnJTNEcXVhbnRpemF0aW9uX2NvbmZpZyUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, BitsAndBytesConfig

model_id = <span class="hljs-string">&quot;bigscience/bloom-1b7&quot;</span>

quantization_config = BitsAndBytesConfig(
    llm_int8_threshold=<span class="hljs-number">10</span>,
)

model_8bit = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map=device_map,
    quantization_config=quantization_config,
)`,wrap:!1}}),lt=new X({props:{title:"모듈 변환 건너뛰기",local:"skip-module-conversion",headingTag:"h3"}}),st=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQXV0b1Rva2VuaXplciUyQyUyMEJpdHNBbmRCeXRlc0NvbmZpZyUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyYmlnc2NpZW5jZSUyRmJsb29tLTFiNyUyMiUwQSUwQXF1YW50aXphdGlvbl9jb25maWclMjAlM0QlMjBCaXRzQW5kQnl0ZXNDb25maWcoJTBBJTIwJTIwJTIwJTIwbGxtX2ludDhfc2tpcF9tb2R1bGVzJTNEJTVCJTIybG1faGVhZCUyMiU1RCUyQyUwQSklMEElMEFtb2RlbF84Yml0JTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMG1vZGVsX2lkJTJDJTBBJTIwJTIwJTIwJTIwZGV2aWNlX21hcCUzRCUyMmF1dG8lMjIlMkMlMEElMjAlMjAlMjAlMjBxdWFudGl6YXRpb25fY29uZmlnJTNEcXVhbnRpemF0aW9uX2NvbmZpZyUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig

model_id = <span class="hljs-string">&quot;bigscience/bloom-1b7&quot;</span>

quantization_config = BitsAndBytesConfig(
    llm_int8_skip_modules=[<span class="hljs-string">&quot;lm_head&quot;</span>],
)

model_8bit = AutoModelForCausalLM.from_pretrained(
    model_id,
    device_map=<span class="hljs-string">&quot;auto&quot;</span>,
    quantization_config=quantization_config,
)`,wrap:!1}}),at=new X({props:{title:"미세 조정",local:"finetuning",headingTag:"h3"}}),it=new X({props:{title:"4비트 (QLoRA 알고리즘)",local:"4-bit-(qlora-algorithm)",headingTag:"h2"}}),Q=new ce({props:{$$slots:{default:[el]},$$scope:{ctx:U}}}),mt=new X({props:{title:"데이터 유형 계산",local:"compute-data-type",headingTag:"h3"}}),rt=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQml0c0FuZEJ5dGVzQ29uZmlnJTBBJTBBcXVhbnRpemF0aW9uX2NvbmZpZyUyMCUzRCUyMEJpdHNBbmRCeXRlc0NvbmZpZyhsb2FkX2luXzRiaXQlM0RUcnVlJTJDJTIwYm5iXzRiaXRfY29tcHV0ZV9kdHlwZSUzRHRvcmNoLmJmbG9hdDE2KQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BitsAndBytesConfig

quantization_config = BitsAndBytesConfig(load_in_4bit=<span class="hljs-literal">True</span>, bnb_4bit_compute_dtype=torch.bfloat16)`,wrap:!1}}),bt=new X({props:{title:"Normal Float 4 (NF4)",local:"normal-float-4-(nf4)",headingTag:"h3"}}),ut=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJpdHNBbmRCeXRlc0NvbmZpZyUwQSUwQW5mNF9jb25maWclMjAlM0QlMjBCaXRzQW5kQnl0ZXNDb25maWcoJTBBJTIwJTIwJTIwJTIwbG9hZF9pbl80Yml0JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGJuYl80Yml0X3F1YW50X3R5cGUlM0QlMjJuZjQlMjIlMkMlMEEpJTBBJTBBbW9kZWxfbmY0JTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwcXVhbnRpemF0aW9uX2NvbmZpZyUzRG5mNF9jb25maWcp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BitsAndBytesConfig

nf4_config = BitsAndBytesConfig(
    load_in_4bit=<span class="hljs-literal">True</span>,
    bnb_4bit_quant_type=<span class="hljs-string">&quot;nf4&quot;</span>,
)

model_nf4 = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=nf4_config)`,wrap:!1}}),Mt=new X({props:{title:"중첩 양자화",local:"nested-quantization",headingTag:"h3"}}),$t=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJpdHNBbmRCeXRlc0NvbmZpZyUwQSUwQWRvdWJsZV9xdWFudF9jb25maWclMjAlM0QlMjBCaXRzQW5kQnl0ZXNDb25maWcoJTBBJTIwJTIwJTIwJTIwbG9hZF9pbl80Yml0JTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGJuYl80Yml0X3VzZV9kb3VibGVfcXVhbnQlM0RUcnVlJTJDJTBBKSUwQSUwQW1vZGVsX2RvdWJsZV9xdWFudCUyMCUzRCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNLmZyb21fcHJldHJhaW5lZCglMjJtZXRhLWxsYW1hJTJGTGxhbWEtMi0xM2IlMjIlMkMlMjBxdWFudGl6YXRpb25fY29uZmlnJTNEZG91YmxlX3F1YW50X2NvbmZpZyk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BitsAndBytesConfig

double_quant_config = BitsAndBytesConfig(
    load_in_4bit=<span class="hljs-literal">True</span>,
    bnb_4bit_use_double_quant=<span class="hljs-literal">True</span>,
)

model_double_quant = AutoModelForCausalLM.from_pretrained(<span class="hljs-string">&quot;meta-llama/Llama-2-13b&quot;</span>, quantization_config=double_quant_config)`,wrap:!1}}),Jt=new X({props:{title:"bitsandbytes 모델의 비양자화",local:"dequantizing- bitsandbytes -models",headingTag:"h2"}}),wt=new W({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNhdXNhbExNJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnJTJDJTIwQXV0b1Rva2VuaXplciUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIyZmFjZWJvb2slMkZvcHQtMTI1bSUyMiUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0uZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkJTJDJTIwQml0c0FuZEJ5dGVzQ29uZmlnKGxvYWRfaW5fNGJpdCUzRFRydWUpKSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKG1vZGVsX2lkKSUwQSUwQW1vZGVsLmRlcXVhbnRpemUoKSUwQSUwQXRleHQlMjAlM0QlMjB0b2tlbml6ZXIoJTIySGVsbG8lMjBteSUyMG5hbWUlMjBpcyUyMiUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpLnRvKDApJTBBJTBBb3V0JTIwJTNEJTIwbW9kZWwuZ2VuZXJhdGUoKip0ZXh0KSUwQXByaW50KHRva2VuaXplci5kZWNvZGUob3V0JTVCMCU1RCkp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, BitsAndBytesConfig, AutoTokenizer

model_id = <span class="hljs-string">&quot;facebook/opt-125m&quot;</span>

model = AutoModelForCausalLM.from_pretrained(model_id, BitsAndBytesConfig(load_in_4bit=<span class="hljs-literal">True</span>))
tokenizer = AutoTokenizer.from_pretrained(model_id)

model.dequantize()

text = tokenizer(<span class="hljs-string">&quot;Hello my name is&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>).to(<span class="hljs-number">0</span>)

out = model.generate(**text)
<span class="hljs-built_in">print</span>(tokenizer.decode(out[<span class="hljs-number">0</span>]))`,wrap:!1}}),ht=new qe({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/ko/quantization/bitsandbytes.md"}}),{c(){s=T("meta"),r=o(),a=T("p"),f=o(),d(p.$$.fragment),J=o(),Z=T("p"),Z.innerHTML=C,_=o(),B=T("p"),B.textContent=j,G=o(),d(v.$$.fragment),m=o(),g=T("p"),g.innerHTML=b,R=o(),d(N.$$.fragment),_t=o(),d(k.$$.fragment),Zt=o(),V=T("p"),V.innerHTML=Me,Ct=o(),d(E.$$.fragment),jt=o(),z=T("p"),z.innerHTML=ye,vt=o(),d(A.$$.fragment),Wt=o(),d(I.$$.fragment),Bt=o(),d(F.$$.fragment),Rt=o(),H=T("p"),H.textContent=$e,Xt=o(),d(L.$$.fragment),Gt=o(),q=T("p"),q.innerHTML=Je,Nt=o(),d(x.$$.fragment),kt=o(),Y=T("p"),Y.innerHTML=Te,Ft=o(),d(S.$$.fragment),Qt=o(),P=T("p"),P.innerHTML=we,Vt=o(),d(D.$$.fragment),Et=o(),d(K.$$.fragment),zt=o(),O=T("p"),O.textContent=he,At=o(),tt=T("p"),tt.innerHTML=ge,It=o(),d(et.$$.fragment),Ht=o(),d(lt.$$.fragment),Lt=o(),nt=T("p"),nt.innerHTML=Ue,qt=o(),d(st.$$.fragment),xt=o(),d(at.$$.fragment),Yt=o(),ot=T("p"),ot.innerHTML=_e,St=o(),d(it.$$.fragment),Pt=o(),d(Q.$$.fragment),Dt=o(),pt=T("p"),pt.textContent=Ze,Kt=o(),d(mt.$$.fragment),Ot=o(),ft=T("p"),ft.innerHTML=Ce,te=o(),d(rt.$$.fragment),ee=o(),d(bt.$$.fragment),le=o(),dt=T("p"),dt.innerHTML=je,ne=o(),d(ut.$$.fragment),se=o(),ct=T("p"),ct.innerHTML=ve,ae=o(),d(Mt.$$.fragment),oe=o(),yt=T("p"),yt.innerHTML=We,ie=o(),d($t.$$.fragment),pe=o(),d(Jt.$$.fragment),me=o(),Tt=T("p"),Tt.textContent=Be,fe=o(),d(wt.$$.fragment),re=o(),d(ht.$$.fragment),be=o(),Ut=T("p"),this.h()},l(t){const e=He("svelte-u9bgzb",document.head);s=w(e,"META",{name:!0,content:!0}),e.forEach(l),r=i(t),a=w(t,"P",{}),Fe(a).forEach(l),f=i(t),u(p.$$.fragment,t),J=i(t),Z=w(t,"P",{"data-svelte-h":!0}),h(Z)!=="svelte-2xjbe9"&&(Z.innerHTML=C),_=i(t),B=w(t,"P",{"data-svelte-h":!0}),h(B)!=="svelte-vl7bne"&&(B.textContent=j),G=i(t),u(v.$$.fragment,t),m=i(t),g=w(t,"P",{"data-svelte-h":!0}),h(g)!=="svelte-1r1ip32"&&(g.innerHTML=b),R=i(t),u(N.$$.fragment,t),_t=i(t),u(k.$$.fragment,t),Zt=i(t),V=w(t,"P",{"data-svelte-h":!0}),h(V)!=="svelte-1y7utg9"&&(V.innerHTML=Me),Ct=i(t),u(E.$$.fragment,t),jt=i(t),z=w(t,"P",{"data-svelte-h":!0}),h(z)!=="svelte-1gbqlod"&&(z.innerHTML=ye),vt=i(t),u(A.$$.fragment,t),Wt=i(t),u(I.$$.fragment,t),Bt=i(t),u(F.$$.fragment,t),Rt=i(t),H=w(t,"P",{"data-svelte-h":!0}),h(H)!=="svelte-kgzuf7"&&(H.textContent=$e),Xt=i(t),u(L.$$.fragment,t),Gt=i(t),q=w(t,"P",{"data-svelte-h":!0}),h(q)!=="svelte-12b63"&&(q.innerHTML=Je),Nt=i(t),u(x.$$.fragment,t),kt=i(t),Y=w(t,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-1r5a1v6"&&(Y.innerHTML=Te),Ft=i(t),u(S.$$.fragment,t),Qt=i(t),P=w(t,"P",{"data-svelte-h":!0}),h(P)!=="svelte-1ovfvxr"&&(P.innerHTML=we),Vt=i(t),u(D.$$.fragment,t),Et=i(t),u(K.$$.fragment,t),zt=i(t),O=w(t,"P",{"data-svelte-h":!0}),h(O)!=="svelte-6mtmjt"&&(O.textContent=he),At=i(t),tt=w(t,"P",{"data-svelte-h":!0}),h(tt)!=="svelte-u1bwy6"&&(tt.innerHTML=ge),It=i(t),u(et.$$.fragment,t),Ht=i(t),u(lt.$$.fragment,t),Lt=i(t),nt=w(t,"P",{"data-svelte-h":!0}),h(nt)!=="svelte-xi1eu2"&&(nt.innerHTML=Ue),qt=i(t),u(st.$$.fragment,t),xt=i(t),u(at.$$.fragment,t),Yt=i(t),ot=w(t,"P",{"data-svelte-h":!0}),h(ot)!=="svelte-kqzf4t"&&(ot.innerHTML=_e),St=i(t),u(it.$$.fragment,t),Pt=i(t),u(Q.$$.fragment,t),Dt=i(t),pt=w(t,"P",{"data-svelte-h":!0}),h(pt)!=="svelte-1v64cgw"&&(pt.textContent=Ze),Kt=i(t),u(mt.$$.fragment,t),Ot=i(t),ft=w(t,"P",{"data-svelte-h":!0}),h(ft)!=="svelte-1uj9s9z"&&(ft.innerHTML=Ce),te=i(t),u(rt.$$.fragment,t),ee=i(t),u(bt.$$.fragment,t),le=i(t),dt=w(t,"P",{"data-svelte-h":!0}),h(dt)!=="svelte-1nfw1yi"&&(dt.innerHTML=je),ne=i(t),u(ut.$$.fragment,t),se=i(t),ct=w(t,"P",{"data-svelte-h":!0}),h(ct)!=="svelte-w9lp1j"&&(ct.innerHTML=ve),ae=i(t),u(Mt.$$.fragment,t),oe=i(t),yt=w(t,"P",{"data-svelte-h":!0}),h(yt)!=="svelte-1p3ohva"&&(yt.innerHTML=We),ie=i(t),u($t.$$.fragment,t),pe=i(t),u(Jt.$$.fragment,t),me=i(t),Tt=w(t,"P",{"data-svelte-h":!0}),h(Tt)!=="svelte-1t95noe"&&(Tt.textContent=Be),fe=i(t),u(wt.$$.fragment,t),re=i(t),u(ht.$$.fragment,t),be=i(t),Ut=w(t,"P",{}),Fe(Ut).forEach(l),this.h()},h(){Qe(s,"name","hf:doc:metadata"),Qe(s,"content",nl)},m(t,e){Le(document.head,s),n(t,r,e),n(t,a,e),n(t,f,e),c(p,t,e),n(t,J,e),n(t,Z,e),n(t,_,e),n(t,B,e),n(t,G,e),c(v,t,e),n(t,m,e),n(t,g,e),n(t,R,e),c(N,t,e),n(t,_t,e),c(k,t,e),n(t,Zt,e),n(t,V,e),n(t,Ct,e),c(E,t,e),n(t,jt,e),n(t,z,e),n(t,vt,e),c(A,t,e),n(t,Wt,e),c(I,t,e),n(t,Bt,e),c(F,t,e),n(t,Rt,e),n(t,H,e),n(t,Xt,e),c(L,t,e),n(t,Gt,e),n(t,q,e),n(t,Nt,e),c(x,t,e),n(t,kt,e),n(t,Y,e),n(t,Ft,e),c(S,t,e),n(t,Qt,e),n(t,P,e),n(t,Vt,e),c(D,t,e),n(t,Et,e),c(K,t,e),n(t,zt,e),n(t,O,e),n(t,At,e),n(t,tt,e),n(t,It,e),c(et,t,e),n(t,Ht,e),c(lt,t,e),n(t,Lt,e),n(t,nt,e),n(t,qt,e),c(st,t,e),n(t,xt,e),c(at,t,e),n(t,Yt,e),n(t,ot,e),n(t,St,e),c(it,t,e),n(t,Pt,e),c(Q,t,e),n(t,Dt,e),n(t,pt,e),n(t,Kt,e),c(mt,t,e),n(t,Ot,e),n(t,ft,e),n(t,te,e),c(rt,t,e),n(t,ee,e),c(bt,t,e),n(t,le,e),n(t,dt,e),n(t,ne,e),c(ut,t,e),n(t,se,e),n(t,ct,e),n(t,ae,e),c(Mt,t,e),n(t,oe,e),n(t,yt,e),n(t,ie,e),c($t,t,e),n(t,pe,e),c(Jt,t,e),n(t,me,e),n(t,Tt,e),n(t,fe,e),c(wt,t,e),n(t,re,e),c(ht,t,e),n(t,be,e),n(t,Ut,e),de=!0},p(t,[e]){const Re={};e&2&&(Re.$$scope={dirty:e,ctx:t}),v.$set(Re);const Xe={};e&2&&(Xe.$$scope={dirty:e,ctx:t}),N.$set(Xe);const Ge={};e&2&&(Ge.$$scope={dirty:e,ctx:t}),k.$set(Ge);const Ne={};e&2&&(Ne.$$scope={dirty:e,ctx:t}),F.$set(Ne);const ke={};e&2&&(ke.$$scope={dirty:e,ctx:t}),Q.$set(ke)},i(t){de||(M(p.$$.fragment,t),M(v.$$.fragment,t),M(N.$$.fragment,t),M(k.$$.fragment,t),M(E.$$.fragment,t),M(A.$$.fragment,t),M(I.$$.fragment,t),M(F.$$.fragment,t),M(L.$$.fragment,t),M(x.$$.fragment,t),M(S.$$.fragment,t),M(D.$$.fragment,t),M(K.$$.fragment,t),M(et.$$.fragment,t),M(lt.$$.fragment,t),M(st.$$.fragment,t),M(at.$$.fragment,t),M(it.$$.fragment,t),M(Q.$$.fragment,t),M(mt.$$.fragment,t),M(rt.$$.fragment,t),M(bt.$$.fragment,t),M(ut.$$.fragment,t),M(Mt.$$.fragment,t),M($t.$$.fragment,t),M(Jt.$$.fragment,t),M(wt.$$.fragment,t),M(ht.$$.fragment,t),de=!0)},o(t){y(p.$$.fragment,t),y(v.$$.fragment,t),y(N.$$.fragment,t),y(k.$$.fragment,t),y(E.$$.fragment,t),y(A.$$.fragment,t),y(I.$$.fragment,t),y(F.$$.fragment,t),y(L.$$.fragment,t),y(x.$$.fragment,t),y(S.$$.fragment,t),y(D.$$.fragment,t),y(K.$$.fragment,t),y(et.$$.fragment,t),y(lt.$$.fragment,t),y(st.$$.fragment,t),y(at.$$.fragment,t),y(it.$$.fragment,t),y(Q.$$.fragment,t),y(mt.$$.fragment,t),y(rt.$$.fragment,t),y(bt.$$.fragment,t),y(ut.$$.fragment,t),y(Mt.$$.fragment,t),y($t.$$.fragment,t),y(Jt.$$.fragment,t),y(wt.$$.fragment,t),y(ht.$$.fragment,t),de=!1},d(t){t&&(l(r),l(a),l(f),l(J),l(Z),l(_),l(B),l(G),l(m),l(g),l(R),l(_t),l(Zt),l(V),l(Ct),l(jt),l(z),l(vt),l(Wt),l(Bt),l(Rt),l(H),l(Xt),l(Gt),l(q),l(Nt),l(kt),l(Y),l(Ft),l(Qt),l(P),l(Vt),l(Et),l(zt),l(O),l(At),l(tt),l(It),l(Ht),l(Lt),l(nt),l(qt),l(xt),l(Yt),l(ot),l(St),l(Pt),l(Dt),l(pt),l(Kt),l(Ot),l(ft),l(te),l(ee),l(le),l(dt),l(ne),l(se),l(ct),l(ae),l(oe),l(yt),l(ie),l(pe),l(me),l(Tt),l(fe),l(re),l(be),l(Ut)),l(s),$(p,t),$(v,t),$(N,t),$(k,t),$(E,t),$(A,t),$(I,t),$(F,t),$(L,t),$(x,t),$(S,t),$(D,t),$(K,t),$(et,t),$(lt,t),$(st,t),$(at,t),$(it,t),$(Q,t),$(mt,t),$(rt,t),$(bt,t),$(ut,t),$(Mt,t),$($t,t),$(Jt,t),$(wt,t),$(ht,t)}}}const nl='{"title":"bitsandbytes","local":"bitsandbytes","sections":[{"title":"8비트 (LLM.int8() 알고리즘)","local":"8-bit-(llm.int8()-algorithm)","sections":[{"title":"오프로딩","local":"offloading","sections":[],"depth":3},{"title":"이상치 임곗값","local":"outlier-threshold","sections":[],"depth":3},{"title":"모듈 변환 건너뛰기","local":"skip-module-conversion","sections":[],"depth":3},{"title":"미세 조정","local":"finetuning","sections":[],"depth":3}],"depth":2},{"title":"4비트 (QLoRA 알고리즘)","local":"4-bit-(qlora-algorithm)","sections":[{"title":"데이터 유형 계산","local":"compute-data-type","sections":[],"depth":3},{"title":"Normal Float 4 (NF4)","local":"normal-float-4-(nf4)","sections":[],"depth":3},{"title":"중첩 양자화","local":"nested-quantization","sections":[],"depth":3}],"depth":2},{"title":"bitsandbytes 모델의 비양자화","local":"dequantizing- bitsandbytes -models","sections":[],"depth":2}],"depth":1}';function sl(U){return ze(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class rl extends Ae{constructor(s){super(),Ie(this,s,sl,ll,Ee,{})}}export{rl as component};
