import{s as mo,o as co,n as uo}from"../chunks/scheduler.9bc65507.js";import{S as po,i as fo,g as r,s as n,r as l,A as go,h as a,f as s,c as o,j as _,u as m,x as g,k as b,y as t,a as v,v as c,d as u,t as p,w as f}from"../chunks/index.707bf1b6.js";import{T as ho}from"../chunks/Tip.c2ecdbf4.js";import{D as q}from"../chunks/Docstring.17db21ae.js";import{H as rt}from"../chunks/Heading.342b1fa6.js";function _o(st){let y,J='Learn how to quantize models in the <a href="../quantization">Quantization</a> guide.';return{c(){y=r("p"),y.innerHTML=J},l(w){y=a(w,"P",{"data-svelte-h":!0}),g(y)!=="svelte-1pv1tva"&&(y.innerHTML=J)},m(w,Pe){v(w,y,Pe)},p:uo,d(w){w&&s(y)}}}function bo(st){let y,J,w,Pe,K,it,X,Hn="Quantization techniques reduces memory and computational costs by representing weights and activations with lower-precision data types like 8-bit integers (int8). This enables loading larger models you normally wouldn’t be able to fit into memory, and speeding up inference. Transformers supports the AWQ and GPTQ quantization algorithms and it supports 8-bit and 4-bit quantization with bitsandbytes.",dt,Z,Dn="Quantization techniques that aren’t supported in Transformers can be added with the <code>HfQuantizer</code> class.",lt,A,mt,ee,ct,T,te,Vt,Ae,Bn="This is a wrapper class about <code>aqlm</code> parameters.",Ft,L,ne,jt,Le,Gn="Safety checker that arguments are correct - also replaces some NoneType arguments with their default values.",ut,oe,pt,C,re,Ot,Qe,En=`This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using <code>auto-awq</code> library awq quantization relying on auto_awq backend.`,Wt,Q,ae,St,Me,In="Safety checker that arguments are correct",ft,se,gt,x,ie,Ut,He,Nn=`This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using <code>optimum</code> api for gptq quantization relying on auto_gptq backend.`,Rt,M,de,Yt,De,Vn="Get compatible class with optimum gptq config dict",Jt,H,le,Kt,Be,Fn="Safety checker that arguments are correct",Xt,D,me,Zt,Ge,jn="Get compatible dict for optimum gptq config",ht,ce,_t,$,ue,en,Ee,On=`This is a wrapper class about all possible attributes and features that you can play with a model that has been
loaded using <code>bitsandbytes</code>.`,tn,Ie,Wn="This replaces <code>load_in_8bit</code> or <code>load_in_4bit</code>therefore both options are mutually exclusive.",nn,Ne,Sn=`Currently only supports <code>LLM.int8()</code>, <code>FP4</code>, and <code>NF4</code> quantization. If more methods are added to <code>bitsandbytes</code>,
then more arguments will be added to this class.`,on,B,pe,rn,Ve,Un="Returns <code>True</code> if the model is quantizable, <code>False</code> otherwise.",an,G,fe,sn,Fe,Rn="Safety checker that arguments are correct - also replaces some NoneType arguments with their default values.",dn,E,ge,ln,je,Yn=`This method returns the quantization method used for the model. If the model is not quantizable, it returns
<code>None</code>.`,mn,I,he,cn,Oe,Jn=`Removes all attributes from config which correspond to the default config attributes for better readability and
serializes to a Python dictionary.`,bt,_e,vt,d,be,un,We,Kn=`Abstract class of the HuggingFace quantizer. Supports for now quantizing HF transformers models for inference and/or quantization.
This class is used only for transformers.PreTrainedModel.from_pretrained and cannot be easily used outside the scope of that method
yet.`,pn,Se,Xn=`Attributes
quantization_config (<code>transformers.utils.quantization_config.QuantizationConfigMixin</code>):
The quantization config that defines the quantization parameters of your model that you want to quantize.
modules_to_not_convert (<code>List[str]</code>, <em>optional</em>):
The list of module names to not convert when quantizing the model.
required_packages (<code>List[str]</code>, <em>optional</em>):
The list of required pip packages to install prior to using the quantizer
requires_calibration (<code>bool</code>):
Whether the quantization method requires to calibrate the model before using it.
requires_parameters_quantization (<code>bool</code>):
Whether the quantization method requires to create a new Parameter. For example, for bitsandbytes, it is
required to create a new xxxParameter in order to properly quantize the model.`,fn,N,ve,gn,Ue,Zn="adjust max_memory argument for infer_auto_device_map() if extra memory is needed for quantization",hn,V,qe,_n,Re,eo=`Override this method if you want to adjust the <code>target_dtype</code> variable used in <code>from_pretrained</code>
to compute the device_map in case the device_map is a <code>str</code>. E.g. for bitsandbytes we force-set <code>target_dtype</code>
to <code>torch.int8</code> and for 4-bit we pass a custom enum <code>accelerate.CustomDtype.int4</code>.`,bn,F,$e,vn,Ye,to=`checks if a loaded state_dict component is part of quantized param + some validation; only defined if
requires_parameters_quantization == True for quantization methods that require to create a new parameters
for quantization.`,qn,j,ye,$n,Je,no=`takes needed components from state_dict and creates quantized param; only applicable if
requires_parameters_quantization == True`,yn,O,ze,zn,Ke,oo=`returns dtypes for modules that are not quantized - used for the computation of the device_map in case
one passes a str as a device_map. The method will use the <code>modules_to_not_convert</code> that is modified
in <code>_process_model_before_weight_loading</code>.`,xn,W,xe,wn,Xe,ro=`Post-process the model post weights loading.
Make sure to override the abstract method <code>_process_model_after_weight_loading</code>.`,Tn,S,we,Cn,Ze,ao=`Setting model attributes and/or converting model before weights loading. At this point
the model should be initialized on the meta device so you can freely manipulate the skeleton
of the model in order to replace modules in-place. Make sure to override the abstract method <code>_process_model_before_weight_loading</code>.`,kn,U,Te,Pn,et,so=`Override this method if you want to pass a override the existing device map with a new
one. E.g. for bitsandbytes, since <code>accelerate</code> is a hard requirement, if no device_map is
passed, the device_map is set to \`“auto”“`,An,R,Ce,Ln,tt,io=`Some quantization methods require to explicitly set the dtype of the model to a
target dtype. You need to override this method in case you want to make sure that behavior is
preserved`,Qn,Y,ke,Mn,nt,lo=`This method is used to potentially check for potential conflicts with arguments that are
passed in <code>from_pretrained</code>. You need to define it for all future quantizers that are integrated with transformers.
If no explicit check are needed, simply return nothing.`,qt,at,$t;return K=new rt({props:{title:"Quantization",local:"quantization",headingTag:"h1"}}),A=new ho({props:{$$slots:{default:[_o]},$$scope:{ctx:st}}}),ee=new rt({props:{title:"AqlmConfig",local:"transformers.AqlmConfig",headingTag:"h2"}}),te=new q({props:{name:"class transformers.AqlmConfig",anchor:"transformers.AqlmConfig",parameters:[{name:"in_group_size",val:": int = 8"},{name:"out_group_size",val:": int = 1"},{name:"num_codebooks",val:": int = 1"},{name:"nbits_per_codebook",val:": int = 16"},{name:"linear_weights_not_to_quantize",val:": Optional = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AqlmConfig.in_group_size",description:`<strong>in_group_size</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The group size along the input dimension.`,name:"in_group_size"},{anchor:"transformers.AqlmConfig.out_group_size",description:`<strong>out_group_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The group size along the output dimension. It&#x2019;s recommended to always use 1.`,name:"out_group_size"},{anchor:"transformers.AqlmConfig.num_codebooks",description:`<strong>num_codebooks</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
Number of codebooks for the Additive Quantization procedure.`,name:"num_codebooks"},{anchor:"transformers.AqlmConfig.nbits_per_codebook",description:`<strong>nbits_per_codebook</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of bits encoding a single codebook vector. Codebooks size is 2**nbits_per_codebook.`,name:"nbits_per_codebook"},{anchor:"transformers.AqlmConfig.linear_weights_not_to_quantize",description:`<strong>linear_weights_not_to_quantize</strong> (<code>Optional[List[str]]</code>, <em>optional</em>) &#x2014;
List of full paths of <code>nn.Linear</code> weight parameters that shall not be quantized.`,name:"linear_weights_not_to_quantize"},{anchor:"transformers.AqlmConfig.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional parameters from which to initialize the configuration object.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L768"}}),ne=new q({props:{name:"post_init",anchor:"transformers.AqlmConfig.post_init",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L806"}}),oe=new rt({props:{title:"AwqConfig",local:"transformers.AwqConfig",headingTag:"h2"}}),re=new q({props:{name:"class transformers.AwqConfig",anchor:"transformers.AwqConfig",parameters:[{name:"bits",val:": int = 4"},{name:"group_size",val:": int = 128"},{name:"zero_point",val:": bool = True"},{name:"version",val:": AWQLinearVersion = <AWQLinearVersion.GEMM: 'gemm'>"},{name:"backend",val:": AwqBackendPackingMethod = <AwqBackendPackingMethod.AUTOAWQ: 'autoawq'>"},{name:"do_fuse",val:": Optional = None"},{name:"fuse_max_seq_len",val:": Optional = None"},{name:"modules_to_fuse",val:": Optional = None"},{name:"modules_to_not_convert",val:": Optional = None"},{name:"exllama_config",val:": Optional = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.AwqConfig.bits",description:`<strong>bits</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The number of bits to quantize to.`,name:"bits"},{anchor:"transformers.AwqConfig.group_size",description:`<strong>group_size</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
The group size to use for quantization. Recommended value is 128 and -1 uses per-column quantization.`,name:"group_size"},{anchor:"transformers.AwqConfig.zero_point",description:`<strong>zero_point</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use zero point quantization.`,name:"zero_point"},{anchor:"transformers.AwqConfig.version",description:`<strong>version</strong> (<code>AWQLinearVersion</code>, <em>optional</em>, defaults to <code>AWQLinearVersion.GEMM</code>) &#x2014;
The version of the quantization algorithm to use. GEMM is better for big batch_size (e.g. &gt;= 8) otherwise,
GEMV is better (e.g. &lt; 8 ). GEMM models are compatible with Exllama kernels.`,name:"version"},{anchor:"transformers.AwqConfig.backend",description:`<strong>backend</strong> (<code>AwqBackendPackingMethod</code>, <em>optional</em>, defaults to <code>AwqBackendPackingMethod.AUTOAWQ</code>) &#x2014;
The quantization backend. Some models might be quantized using <code>llm-awq</code> backend. This is useful for users
that quantize their own models using <code>llm-awq</code> library.`,name:"backend"},{anchor:"transformers.AwqConfig.do_fuse",description:`<strong>do_fuse</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to fuse attention and mlp layers together for faster inference`,name:"do_fuse"},{anchor:"transformers.AwqConfig.fuse_max_seq_len",description:`<strong>fuse_max_seq_len</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The Maximum sequence length to generate when using fusing.`,name:"fuse_max_seq_len"},{anchor:"transformers.AwqConfig.modules_to_fuse",description:`<strong>modules_to_fuse</strong> (<code>dict</code>, <em>optional</em>, default to <code>None</code>) &#x2014;
Overwrite the natively supported fusing scheme with the one specified by the users.`,name:"modules_to_fuse"},{anchor:"transformers.AwqConfig.modules_to_not_convert",description:`<strong>modules_to_not_convert</strong> (<code>list</code>, <em>optional</em>, default to <code>None</code>) &#x2014;
The list of modules to not quantize, useful for quantizing models that explicitly require to have
some modules left in their original precision (e.g. Whisper encoder, Llava encoder, Mixtral gate layers).
Note you cannot quantize directly with transformers, please refer to <code>AutoAWQ</code> documentation for quantizing HF models.`,name:"modules_to_not_convert"},{anchor:"transformers.AwqConfig.exllama_config",description:`<strong>exllama_config</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
You can specify the version of the exllama kernel through the <code>version</code> key, the maximum sequence
length through the <code>max_input_len</code> key, and the maximum batch size through the <code>max_batch_size</code> key.
Defaults to <code>{&quot;version&quot;: 2, &quot;max_input_len&quot;: 2048, &quot;max_batch_size&quot;: 8}</code> if unset.`,name:"exllama_config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L597"}}),ae=new q({props:{name:"post_init",anchor:"transformers.AwqConfig.post_init",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L666"}}),se=new rt({props:{title:"GPTQConfig",local:"transformers.GPTQConfig",headingTag:"h2"}}),ie=new q({props:{name:"class transformers.GPTQConfig",anchor:"transformers.GPTQConfig",parameters:[{name:"bits",val:": int"},{name:"tokenizer",val:": Any = None"},{name:"dataset",val:": Union = None"},{name:"group_size",val:": int = 128"},{name:"damp_percent",val:": float = 0.1"},{name:"desc_act",val:": bool = False"},{name:"sym",val:": bool = True"},{name:"true_sequential",val:": bool = True"},{name:"use_cuda_fp16",val:": bool = False"},{name:"model_seqlen",val:": Optional = None"},{name:"block_name_to_quantize",val:": Optional = None"},{name:"module_name_preceding_first_block",val:": Optional = None"},{name:"batch_size",val:": int = 1"},{name:"pad_token_id",val:": Optional = None"},{name:"use_exllama",val:": Optional = None"},{name:"max_input_length",val:": Optional = None"},{name:"exllama_config",val:": Optional = None"},{name:"cache_block_outputs",val:": bool = True"},{name:"modules_in_block_to_quantize",val:": Optional = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.GPTQConfig.bits",description:`<strong>bits</strong> (<code>int</code>) &#x2014;
The number of bits to quantize to, supported numbers are (2, 3, 4, 8).`,name:"bits"},{anchor:"transformers.GPTQConfig.tokenizer",description:`<strong>tokenizer</strong> (<code>str</code> or <code>PreTrainedTokenizerBase</code>, <em>optional</em>) &#x2014;
The tokenizer used to process the dataset. You can pass either:<ul>
<li>A custom tokenizer object.</li>
<li>A string, the <em>model id</em> of a predefined tokenizer hosted inside a model repo on huggingface.co.</li>
<li>A path to a <em>directory</em> containing vocabulary files required by the tokenizer, for instance saved
using the <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.save_pretrained">save_pretrained()</a> method, e.g., <code>./my_model_directory/</code>.</li>
</ul>`,name:"tokenizer"},{anchor:"transformers.GPTQConfig.dataset",description:`<strong>dataset</strong> (<code>Union[List[str]]</code>, <em>optional</em>) &#x2014;
The dataset used for quantization. You can provide your own dataset in a list of string or just use the
original datasets used in GPTQ paper [&#x2018;wikitext2&#x2019;,&#x2018;c4&#x2019;,&#x2018;c4-new&#x2019;,&#x2018;ptb&#x2019;,&#x2018;ptb-new&#x2019;]`,name:"dataset"},{anchor:"transformers.GPTQConfig.group_size",description:`<strong>group_size</strong> (<code>int</code>, <em>optional</em>, defaults to 128) &#x2014;
The group size to use for quantization. Recommended value is 128 and -1 uses per-column quantization.`,name:"group_size"},{anchor:"transformers.GPTQConfig.damp_percent",description:`<strong>damp_percent</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The percent of the average Hessian diagonal to use for dampening. Recommended value is 0.1.`,name:"damp_percent"},{anchor:"transformers.GPTQConfig.desc_act",description:`<strong>desc_act</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to quantize columns in order of decreasing activation size. Setting it to False can significantly
speed up inference but the perplexity may become slightly worse. Also known as act-order.`,name:"desc_act"},{anchor:"transformers.GPTQConfig.sym",description:`<strong>sym</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use symetric quantization.`,name:"sym"},{anchor:"transformers.GPTQConfig.true_sequential",description:`<strong>true_sequential</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to perform sequential quantization even within a single Transformer block. Instead of quantizing
the entire block at once, we perform layer-wise quantization. As a result, each layer undergoes
quantization using inputs that have passed through the previously quantized layers.`,name:"true_sequential"},{anchor:"transformers.GPTQConfig.use_cuda_fp16",description:`<strong>use_cuda_fp16</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use optimized cuda kernel for fp16 model. Need to have model in fp16.`,name:"use_cuda_fp16"},{anchor:"transformers.GPTQConfig.model_seqlen",description:`<strong>model_seqlen</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum sequence length that the model can take.`,name:"model_seqlen"},{anchor:"transformers.GPTQConfig.block_name_to_quantize",description:`<strong>block_name_to_quantize</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The transformers block name to quantize. If None, we will infer the block name using common patterns (e.g. model.layers)`,name:"block_name_to_quantize"},{anchor:"transformers.GPTQConfig.module_name_preceding_first_block",description:`<strong>module_name_preceding_first_block</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
The layers that are preceding the first Transformer block.`,name:"module_name_preceding_first_block"},{anchor:"transformers.GPTQConfig.batch_size",description:`<strong>batch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The batch size used when processing the dataset`,name:"batch_size"},{anchor:"transformers.GPTQConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The pad token id. Needed to prepare the dataset when <code>batch_size</code> &gt; 1.`,name:"pad_token_id"},{anchor:"transformers.GPTQConfig.use_exllama",description:`<strong>use_exllama</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to use exllama backend. Defaults to <code>True</code> if unset. Only works with <code>bits</code> = 4.`,name:"use_exllama"},{anchor:"transformers.GPTQConfig.max_input_length",description:`<strong>max_input_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum input length. This is needed to initialize a buffer that depends on the maximum expected input
length. It is specific to the exllama backend with act-order.`,name:"max_input_length"},{anchor:"transformers.GPTQConfig.exllama_config",description:`<strong>exllama_config</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
The exllama config. You can specify the version of the exllama kernel through the <code>version</code> key. Defaults
to <code>{&quot;version&quot;: 1}</code> if unset.`,name:"exllama_config"},{anchor:"transformers.GPTQConfig.cache_block_outputs",description:`<strong>cache_block_outputs</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to cache block outputs to reuse as inputs for the succeeding block.`,name:"cache_block_outputs"},{anchor:"transformers.GPTQConfig.modules_in_block_to_quantize",description:`<strong>modules_in_block_to_quantize</strong> (<code>List[List[str]]</code>, <em>optional</em>) &#x2014;
List of list of module names to quantize in the specified block. This argument is useful to exclude certain linear modules from being quantized.
The block to quantize can be specified by setting <code>block_name_to_quantize</code>. We will quantize each list sequentially. If not set, we will quantize all linear layers.
Example: <code>modules_in_block_to_quantize =[[&quot;self_attn.k_proj&quot;, &quot;self_attn.v_proj&quot;, &quot;self_attn.q_proj&quot;], [&quot;self_attn.o_proj&quot;]]</code>.
In this example, we will first quantize the q,k,v layers simultaneously since they are independent.
Then, we will quantize <code>self_attn.o_proj</code> layer with the q,k,v layers quantized. This way, we will get
better results since it reflects the real input <code>self_attn.o_proj</code> will get when the model is quantized.`,name:"modules_in_block_to_quantize"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L385"}}),de=new q({props:{name:"from_dict_optimum",anchor:"transformers.GPTQConfig.from_dict_optimum",parameters:[{name:"config_dict",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L582"}}),le=new q({props:{name:"post_init",anchor:"transformers.GPTQConfig.post_init",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L499"}}),me=new q({props:{name:"to_dict_optimum",anchor:"transformers.GPTQConfig.to_dict_optimum",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L573"}}),ce=new rt({props:{title:"BitsAndBytesConfig",local:"transformers.BitsAndBytesConfig",headingTag:"h2"}}),ue=new q({props:{name:"class transformers.BitsAndBytesConfig",anchor:"transformers.BitsAndBytesConfig",parameters:[{name:"load_in_8bit",val:" = False"},{name:"load_in_4bit",val:" = False"},{name:"llm_int8_threshold",val:" = 6.0"},{name:"llm_int8_skip_modules",val:" = None"},{name:"llm_int8_enable_fp32_cpu_offload",val:" = False"},{name:"llm_int8_has_fp16_weight",val:" = False"},{name:"bnb_4bit_compute_dtype",val:" = None"},{name:"bnb_4bit_quant_type",val:" = 'fp4'"},{name:"bnb_4bit_use_double_quant",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BitsAndBytesConfig.load_in_8bit",description:`<strong>load_in_8bit</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
This flag is used to enable 8-bit quantization with LLM.int8().`,name:"load_in_8bit"},{anchor:"transformers.BitsAndBytesConfig.load_in_4bit",description:`<strong>load_in_4bit</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
This flag is used to enable 4-bit quantization by replacing the Linear layers with FP4/NF4 layers from
<code>bitsandbytes</code>.`,name:"load_in_4bit"},{anchor:"transformers.BitsAndBytesConfig.llm_int8_threshold",description:`<strong>llm_int8_threshold</strong> (<code>float</code>, <em>optional</em>, defaults to 6.0) &#x2014;
This corresponds to the outlier threshold for outlier detection as described in <code>LLM.int8() : 8-bit Matrix Multiplication for Transformers at Scale</code> paper: <a href="https://arxiv.org/abs/2208.07339" rel="nofollow">https://arxiv.org/abs/2208.07339</a> Any hidden states value
that is above this threshold will be considered an outlier and the operation on those values will be done
in fp16. Values are usually normally distributed, that is, most values are in the range [-3.5, 3.5], but
there are some exceptional systematic outliers that are very differently distributed for large models.
These outliers are often in the interval [-60, -6] or [6, 60]. Int8 quantization works well for values of
magnitude ~5, but beyond that, there is a significant performance penalty. A good default threshold is 6,
but a lower threshold might be needed for more unstable models (small models, fine-tuning).`,name:"llm_int8_threshold"},{anchor:"transformers.BitsAndBytesConfig.llm_int8_skip_modules",description:`<strong>llm_int8_skip_modules</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
An explicit list of the modules that we do not want to convert in 8-bit. This is useful for models such as
Jukebox that has several heads in different places and not necessarily at the last position. For example
for <code>CausalLM</code> models, the last <code>lm_head</code> is kept in its original <code>dtype</code>.`,name:"llm_int8_skip_modules"},{anchor:"transformers.BitsAndBytesConfig.llm_int8_enable_fp32_cpu_offload",description:`<strong>llm_int8_enable_fp32_cpu_offload</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
This flag is used for advanced use cases and users that are aware of this feature. If you want to split
your model in different parts and run some parts in int8 on GPU and some parts in fp32 on CPU, you can use
this flag. This is useful for offloading large models such as <code>google/flan-t5-xxl</code>. Note that the int8
operations will not be run on CPU.`,name:"llm_int8_enable_fp32_cpu_offload"},{anchor:"transformers.BitsAndBytesConfig.llm_int8_has_fp16_weight",description:`<strong>llm_int8_has_fp16_weight</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
This flag runs LLM.int8() with 16-bit main weights. This is useful for fine-tuning as the weights do not
have to be converted back and forth for the backward pass.`,name:"llm_int8_has_fp16_weight"},{anchor:"transformers.BitsAndBytesConfig.bnb_4bit_compute_dtype",description:`<strong>bnb_4bit_compute_dtype</strong> (<code>torch.dtype</code> or str, <em>optional</em>, defaults to <code>torch.float32</code>) &#x2014;
This sets the computational type which might be different than the input time. For example, inputs might be
fp32, but computation can be set to bf16 for speedups.`,name:"bnb_4bit_compute_dtype"},{anchor:"transformers.BitsAndBytesConfig.bnb_4bit_quant_type",description:`<strong>bnb_4bit_quant_type</strong> (<code>str</code>,  <em>optional</em>, defaults to <code>&quot;fp4&quot;</code>) &#x2014;
This sets the quantization data type in the bnb.nn.Linear4Bit layers. Options are FP4 and NF4 data types
which are specified by <code>fp4</code> or <code>nf4</code>.`,name:"bnb_4bit_quant_type"},{anchor:"transformers.BitsAndBytesConfig.bnb_4bit_use_double_quant",description:`<strong>bnb_4bit_use_double_quant</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
This flag is used for nested quantization where the quantization constants from the first quantization are
quantized again.`,name:"bnb_4bit_use_double_quant"},{anchor:"transformers.BitsAndBytesConfig.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional parameters from which to initialize the configuration object.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L181"}}),pe=new q({props:{name:"is_quantizable",anchor:"transformers.BitsAndBytesConfig.is_quantizable",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L321"}}),fe=new q({props:{name:"post_init",anchor:"transformers.BitsAndBytesConfig.post_init",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L290"}}),ge=new q({props:{name:"quantization_method",anchor:"transformers.BitsAndBytesConfig.quantization_method",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L327"}}),he=new q({props:{name:"to_diff_dict",anchor:"transformers.BitsAndBytesConfig.to_diff_dict",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/utils/quantization_config.py#L357",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Dictionary of all the attributes that make up this configuration instance,</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Dict[str, Any]</code></p>
`}}),_e=new rt({props:{title:"HfQuantizer",local:"transformers.quantizers.HfQuantizer",headingTag:"h2"}}),be=new q({props:{name:"class transformers.quantizers.HfQuantizer",anchor:"transformers.quantizers.HfQuantizer",parameters:[{name:"quantization_config",val:": QuantizationConfigMixin"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L28"}}),ve=new q({props:{name:"adjust_max_memory",anchor:"transformers.quantizers.HfQuantizer.adjust_max_memory",parameters:[{name:"max_memory",val:": Dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L120"}}),qe=new q({props:{name:"adjust_target_dtype",anchor:"transformers.quantizers.HfQuantizer.adjust_target_dtype",parameters:[{name:"torch_dtype",val:": torch.dtype"}],parametersDescription:[{anchor:"transformers.quantizers.HfQuantizer.adjust_target_dtype.torch_dtype",description:`<strong>torch_dtype</strong> (<code>torch.dtype</code>, <em>optional</em>) &#x2014;
The torch_dtype that is used to compute the device_map.`,name:"torch_dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L90"}}),$e=new q({props:{name:"check_quantized_param",anchor:"transformers.quantizers.HfQuantizer.check_quantized_param",parameters:[{name:"model",val:": PreTrainedModel"},{name:"param_value",val:": torch.Tensor"},{name:"param_name",val:": str"},{name:"state_dict",val:": Dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L124"}}),ye=new q({props:{name:"create_quantized_param",anchor:"transformers.quantizers.HfQuantizer.create_quantized_param",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L134"}}),ze=new q({props:{name:"get_special_dtypes_update",anchor:"transformers.quantizers.HfQuantizer.get_special_dtypes_update",parameters:[{name:"model",val:""},{name:"torch_dtype",val:": torch.dtype"}],parametersDescription:[{anchor:"transformers.quantizers.HfQuantizer.get_special_dtypes_update.model",description:`<strong>model</strong> (<code>~transformers.PreTrainedModel</code>) &#x2014;
The model to quantize`,name:"model"},{anchor:"transformers.quantizers.HfQuantizer.get_special_dtypes_update.torch_dtype",description:`<strong>torch_dtype</strong> (<code>torch.dtype</code>) &#x2014;
The dtype passed in <code>from_pretrained</code> method.`,name:"torch_dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L102"}}),xe=new q({props:{name:"postprocess_model",anchor:"transformers.quantizers.HfQuantizer.postprocess_model",parameters:[{name:"model",val:": PreTrainedModel"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.quantizers.HfQuantizer.postprocess_model.model",description:`<strong>model</strong> (<code>~transformers.PreTrainedModel</code>) &#x2014;
The model to quantize`,name:"model"},{anchor:"transformers.quantizers.HfQuantizer.postprocess_model.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
The keyword arguments that are passed along <code>_process_model_after_weight_loading</code>.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L168"}}),we=new q({props:{name:"preprocess_model",anchor:"transformers.quantizers.HfQuantizer.preprocess_model",parameters:[{name:"model",val:": PreTrainedModel"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.quantizers.HfQuantizer.preprocess_model.model",description:`<strong>model</strong> (<code>~transformers.PreTrainedModel</code>) &#x2014;
The model to quantize`,name:"model"},{anchor:"transformers.quantizers.HfQuantizer.preprocess_model.kwargs",description:`<strong>kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
The keyword arguments that are passed along <code>_process_model_before_weight_loading</code>.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L152"}}),Te=new q({props:{name:"update_device_map",anchor:"transformers.quantizers.HfQuantizer.update_device_map",parameters:[{name:"device_map",val:": Optional"}],parametersDescription:[{anchor:"transformers.quantizers.HfQuantizer.update_device_map.device_map",description:`<strong>device_map</strong> (<code>Union[dict, str]</code>, <em>optional</em>) &#x2014;
The device_map that is passed through the <code>from_pretrained</code> method.`,name:"device_map"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L78"}}),Ce=new q({props:{name:"update_torch_dtype",anchor:"transformers.quantizers.HfQuantizer.update_torch_dtype",parameters:[{name:"torch_dtype",val:": torch.dtype"}],parametersDescription:[{anchor:"transformers.quantizers.HfQuantizer.update_torch_dtype.torch_dtype",description:`<strong>torch_dtype</strong> (<code>torch.dtype</code>) &#x2014;
The input dtype that is passed in <code>from_pretrained</code>`,name:"torch_dtype"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L66"}}),ke=new q({props:{name:"validate_environment",anchor:"transformers.quantizers.HfQuantizer.validate_environment",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/quantizers/base.py#L144"}}),{c(){y=r("meta"),J=n(),w=r("p"),Pe=n(),l(K.$$.fragment),it=n(),X=r("p"),X.textContent=Hn,dt=n(),Z=r("p"),Z.innerHTML=Dn,lt=n(),l(A.$$.fragment),mt=n(),l(ee.$$.fragment),ct=n(),T=r("div"),l(te.$$.fragment),Vt=n(),Ae=r("p"),Ae.innerHTML=Bn,Ft=n(),L=r("div"),l(ne.$$.fragment),jt=n(),Le=r("p"),Le.textContent=Gn,ut=n(),l(oe.$$.fragment),pt=n(),C=r("div"),l(re.$$.fragment),Ot=n(),Qe=r("p"),Qe.innerHTML=En,Wt=n(),Q=r("div"),l(ae.$$.fragment),St=n(),Me=r("p"),Me.textContent=In,ft=n(),l(se.$$.fragment),gt=n(),x=r("div"),l(ie.$$.fragment),Ut=n(),He=r("p"),He.innerHTML=Nn,Rt=n(),M=r("div"),l(de.$$.fragment),Yt=n(),De=r("p"),De.textContent=Vn,Jt=n(),H=r("div"),l(le.$$.fragment),Kt=n(),Be=r("p"),Be.textContent=Fn,Xt=n(),D=r("div"),l(me.$$.fragment),Zt=n(),Ge=r("p"),Ge.textContent=jn,ht=n(),l(ce.$$.fragment),_t=n(),$=r("div"),l(ue.$$.fragment),en=n(),Ee=r("p"),Ee.innerHTML=On,tn=n(),Ie=r("p"),Ie.innerHTML=Wn,nn=n(),Ne=r("p"),Ne.innerHTML=Sn,on=n(),B=r("div"),l(pe.$$.fragment),rn=n(),Ve=r("p"),Ve.innerHTML=Un,an=n(),G=r("div"),l(fe.$$.fragment),sn=n(),Fe=r("p"),Fe.textContent=Rn,dn=n(),E=r("div"),l(ge.$$.fragment),ln=n(),je=r("p"),je.innerHTML=Yn,mn=n(),I=r("div"),l(he.$$.fragment),cn=n(),Oe=r("p"),Oe.textContent=Jn,bt=n(),l(_e.$$.fragment),vt=n(),d=r("div"),l(be.$$.fragment),un=n(),We=r("p"),We.textContent=Kn,pn=n(),Se=r("p"),Se.innerHTML=Xn,fn=n(),N=r("div"),l(ve.$$.fragment),gn=n(),Ue=r("p"),Ue.textContent=Zn,hn=n(),V=r("div"),l(qe.$$.fragment),_n=n(),Re=r("p"),Re.innerHTML=eo,bn=n(),F=r("div"),l($e.$$.fragment),vn=n(),Ye=r("p"),Ye.textContent=to,qn=n(),j=r("div"),l(ye.$$.fragment),$n=n(),Je=r("p"),Je.textContent=no,yn=n(),O=r("div"),l(ze.$$.fragment),zn=n(),Ke=r("p"),Ke.innerHTML=oo,xn=n(),W=r("div"),l(xe.$$.fragment),wn=n(),Xe=r("p"),Xe.innerHTML=ro,Tn=n(),S=r("div"),l(we.$$.fragment),Cn=n(),Ze=r("p"),Ze.innerHTML=ao,kn=n(),U=r("div"),l(Te.$$.fragment),Pn=n(),et=r("p"),et.innerHTML=so,An=n(),R=r("div"),l(Ce.$$.fragment),Ln=n(),tt=r("p"),tt.textContent=io,Qn=n(),Y=r("div"),l(ke.$$.fragment),Mn=n(),nt=r("p"),nt.innerHTML=lo,qt=n(),at=r("p"),this.h()},l(e){const i=go("svelte-u9bgzb",document.head);y=a(i,"META",{name:!0,content:!0}),i.forEach(s),J=o(e),w=a(e,"P",{}),_(w).forEach(s),Pe=o(e),m(K.$$.fragment,e),it=o(e),X=a(e,"P",{"data-svelte-h":!0}),g(X)!=="svelte-1m63e94"&&(X.textContent=Hn),dt=o(e),Z=a(e,"P",{"data-svelte-h":!0}),g(Z)!=="svelte-bnel0f"&&(Z.innerHTML=Dn),lt=o(e),m(A.$$.fragment,e),mt=o(e),m(ee.$$.fragment,e),ct=o(e),T=a(e,"DIV",{class:!0});var P=_(T);m(te.$$.fragment,P),Vt=o(P),Ae=a(P,"P",{"data-svelte-h":!0}),g(Ae)!=="svelte-1s7ccdx"&&(Ae.innerHTML=Bn),Ft=o(P),L=a(P,"DIV",{class:!0});var yt=_(L);m(ne.$$.fragment,yt),jt=o(yt),Le=a(yt,"P",{"data-svelte-h":!0}),g(Le)!=="svelte-gy26u4"&&(Le.textContent=Gn),yt.forEach(s),P.forEach(s),ut=o(e),m(oe.$$.fragment,e),pt=o(e),C=a(e,"DIV",{class:!0});var ot=_(C);m(re.$$.fragment,ot),Ot=o(ot),Qe=a(ot,"P",{"data-svelte-h":!0}),g(Qe)!=="svelte-1i667it"&&(Qe.innerHTML=En),Wt=o(ot),Q=a(ot,"DIV",{class:!0});var zt=_(Q);m(ae.$$.fragment,zt),St=o(zt),Me=a(zt,"P",{"data-svelte-h":!0}),g(Me)!=="svelte-1ozftb6"&&(Me.textContent=In),zt.forEach(s),ot.forEach(s),ft=o(e),m(se.$$.fragment,e),gt=o(e),x=a(e,"DIV",{class:!0});var k=_(x);m(ie.$$.fragment,k),Ut=o(k),He=a(k,"P",{"data-svelte-h":!0}),g(He)!=="svelte-i3efvr"&&(He.innerHTML=Nn),Rt=o(k),M=a(k,"DIV",{class:!0});var xt=_(M);m(de.$$.fragment,xt),Yt=o(xt),De=a(xt,"P",{"data-svelte-h":!0}),g(De)!=="svelte-4jdj2l"&&(De.textContent=Vn),xt.forEach(s),Jt=o(k),H=a(k,"DIV",{class:!0});var wt=_(H);m(le.$$.fragment,wt),Kt=o(wt),Be=a(wt,"P",{"data-svelte-h":!0}),g(Be)!=="svelte-1ozftb6"&&(Be.textContent=Fn),wt.forEach(s),Xt=o(k),D=a(k,"DIV",{class:!0});var Tt=_(D);m(me.$$.fragment,Tt),Zt=o(Tt),Ge=a(Tt,"P",{"data-svelte-h":!0}),g(Ge)!=="svelte-pjgtd6"&&(Ge.textContent=jn),Tt.forEach(s),k.forEach(s),ht=o(e),m(ce.$$.fragment,e),_t=o(e),$=a(e,"DIV",{class:!0});var z=_($);m(ue.$$.fragment,z),en=o(z),Ee=a(z,"P",{"data-svelte-h":!0}),g(Ee)!=="svelte-woamwr"&&(Ee.innerHTML=On),tn=o(z),Ie=a(z,"P",{"data-svelte-h":!0}),g(Ie)!=="svelte-ki5gis"&&(Ie.innerHTML=Wn),nn=o(z),Ne=a(z,"P",{"data-svelte-h":!0}),g(Ne)!=="svelte-8qsk2q"&&(Ne.innerHTML=Sn),on=o(z),B=a(z,"DIV",{class:!0});var Ct=_(B);m(pe.$$.fragment,Ct),rn=o(Ct),Ve=a(Ct,"P",{"data-svelte-h":!0}),g(Ve)!=="svelte-10tvzyv"&&(Ve.innerHTML=Un),Ct.forEach(s),an=o(z),G=a(z,"DIV",{class:!0});var kt=_(G);m(fe.$$.fragment,kt),sn=o(kt),Fe=a(kt,"P",{"data-svelte-h":!0}),g(Fe)!=="svelte-gy26u4"&&(Fe.textContent=Rn),kt.forEach(s),dn=o(z),E=a(z,"DIV",{class:!0});var Pt=_(E);m(ge.$$.fragment,Pt),ln=o(Pt),je=a(Pt,"P",{"data-svelte-h":!0}),g(je)!=="svelte-19bn0da"&&(je.innerHTML=Yn),Pt.forEach(s),mn=o(z),I=a(z,"DIV",{class:!0});var At=_(I);m(he.$$.fragment,At),cn=o(At),Oe=a(At,"P",{"data-svelte-h":!0}),g(Oe)!=="svelte-1p6bdas"&&(Oe.textContent=Jn),At.forEach(s),z.forEach(s),bt=o(e),m(_e.$$.fragment,e),vt=o(e),d=a(e,"DIV",{class:!0});var h=_(d);m(be.$$.fragment,h),un=o(h),We=a(h,"P",{"data-svelte-h":!0}),g(We)!=="svelte-1xvcahi"&&(We.textContent=Kn),pn=o(h),Se=a(h,"P",{"data-svelte-h":!0}),g(Se)!=="svelte-twdedh"&&(Se.innerHTML=Xn),fn=o(h),N=a(h,"DIV",{class:!0});var Lt=_(N);m(ve.$$.fragment,Lt),gn=o(Lt),Ue=a(Lt,"P",{"data-svelte-h":!0}),g(Ue)!=="svelte-1d4i4z7"&&(Ue.textContent=Zn),Lt.forEach(s),hn=o(h),V=a(h,"DIV",{class:!0});var Qt=_(V);m(qe.$$.fragment,Qt),_n=o(Qt),Re=a(Qt,"P",{"data-svelte-h":!0}),g(Re)!=="svelte-4t526i"&&(Re.innerHTML=eo),Qt.forEach(s),bn=o(h),F=a(h,"DIV",{class:!0});var Mt=_(F);m($e.$$.fragment,Mt),vn=o(Mt),Ye=a(Mt,"P",{"data-svelte-h":!0}),g(Ye)!=="svelte-1meey31"&&(Ye.textContent=to),Mt.forEach(s),qn=o(h),j=a(h,"DIV",{class:!0});var Ht=_(j);m(ye.$$.fragment,Ht),$n=o(Ht),Je=a(Ht,"P",{"data-svelte-h":!0}),g(Je)!=="svelte-1j1vsi1"&&(Je.textContent=no),Ht.forEach(s),yn=o(h),O=a(h,"DIV",{class:!0});var Dt=_(O);m(ze.$$.fragment,Dt),zn=o(Dt),Ke=a(Dt,"P",{"data-svelte-h":!0}),g(Ke)!=="svelte-i8h8td"&&(Ke.innerHTML=oo),Dt.forEach(s),xn=o(h),W=a(h,"DIV",{class:!0});var Bt=_(W);m(xe.$$.fragment,Bt),wn=o(Bt),Xe=a(Bt,"P",{"data-svelte-h":!0}),g(Xe)!=="svelte-1uznum5"&&(Xe.innerHTML=ro),Bt.forEach(s),Tn=o(h),S=a(h,"DIV",{class:!0});var Gt=_(S);m(we.$$.fragment,Gt),Cn=o(Gt),Ze=a(Gt,"P",{"data-svelte-h":!0}),g(Ze)!=="svelte-mjhdcv"&&(Ze.innerHTML=ao),Gt.forEach(s),kn=o(h),U=a(h,"DIV",{class:!0});var Et=_(U);m(Te.$$.fragment,Et),Pn=o(Et),et=a(Et,"P",{"data-svelte-h":!0}),g(et)!=="svelte-1e5epn5"&&(et.innerHTML=so),Et.forEach(s),An=o(h),R=a(h,"DIV",{class:!0});var It=_(R);m(Ce.$$.fragment,It),Ln=o(It),tt=a(It,"P",{"data-svelte-h":!0}),g(tt)!=="svelte-1kpdm09"&&(tt.textContent=io),It.forEach(s),Qn=o(h),Y=a(h,"DIV",{class:!0});var Nt=_(Y);m(ke.$$.fragment,Nt),Mn=o(Nt),nt=a(Nt,"P",{"data-svelte-h":!0}),g(nt)!=="svelte-1lxocan"&&(nt.innerHTML=lo),Nt.forEach(s),h.forEach(s),qt=o(e),at=a(e,"P",{}),_(at).forEach(s),this.h()},h(){b(y,"name","hf:doc:metadata"),b(y,"content",vo),b(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),b(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,i){t(document.head,y),v(e,J,i),v(e,w,i),v(e,Pe,i),c(K,e,i),v(e,it,i),v(e,X,i),v(e,dt,i),v(e,Z,i),v(e,lt,i),c(A,e,i),v(e,mt,i),c(ee,e,i),v(e,ct,i),v(e,T,i),c(te,T,null),t(T,Vt),t(T,Ae),t(T,Ft),t(T,L),c(ne,L,null),t(L,jt),t(L,Le),v(e,ut,i),c(oe,e,i),v(e,pt,i),v(e,C,i),c(re,C,null),t(C,Ot),t(C,Qe),t(C,Wt),t(C,Q),c(ae,Q,null),t(Q,St),t(Q,Me),v(e,ft,i),c(se,e,i),v(e,gt,i),v(e,x,i),c(ie,x,null),t(x,Ut),t(x,He),t(x,Rt),t(x,M),c(de,M,null),t(M,Yt),t(M,De),t(x,Jt),t(x,H),c(le,H,null),t(H,Kt),t(H,Be),t(x,Xt),t(x,D),c(me,D,null),t(D,Zt),t(D,Ge),v(e,ht,i),c(ce,e,i),v(e,_t,i),v(e,$,i),c(ue,$,null),t($,en),t($,Ee),t($,tn),t($,Ie),t($,nn),t($,Ne),t($,on),t($,B),c(pe,B,null),t(B,rn),t(B,Ve),t($,an),t($,G),c(fe,G,null),t(G,sn),t(G,Fe),t($,dn),t($,E),c(ge,E,null),t(E,ln),t(E,je),t($,mn),t($,I),c(he,I,null),t(I,cn),t(I,Oe),v(e,bt,i),c(_e,e,i),v(e,vt,i),v(e,d,i),c(be,d,null),t(d,un),t(d,We),t(d,pn),t(d,Se),t(d,fn),t(d,N),c(ve,N,null),t(N,gn),t(N,Ue),t(d,hn),t(d,V),c(qe,V,null),t(V,_n),t(V,Re),t(d,bn),t(d,F),c($e,F,null),t(F,vn),t(F,Ye),t(d,qn),t(d,j),c(ye,j,null),t(j,$n),t(j,Je),t(d,yn),t(d,O),c(ze,O,null),t(O,zn),t(O,Ke),t(d,xn),t(d,W),c(xe,W,null),t(W,wn),t(W,Xe),t(d,Tn),t(d,S),c(we,S,null),t(S,Cn),t(S,Ze),t(d,kn),t(d,U),c(Te,U,null),t(U,Pn),t(U,et),t(d,An),t(d,R),c(Ce,R,null),t(R,Ln),t(R,tt),t(d,Qn),t(d,Y),c(ke,Y,null),t(Y,Mn),t(Y,nt),v(e,qt,i),v(e,at,i),$t=!0},p(e,[i]){const P={};i&2&&(P.$$scope={dirty:i,ctx:e}),A.$set(P)},i(e){$t||(u(K.$$.fragment,e),u(A.$$.fragment,e),u(ee.$$.fragment,e),u(te.$$.fragment,e),u(ne.$$.fragment,e),u(oe.$$.fragment,e),u(re.$$.fragment,e),u(ae.$$.fragment,e),u(se.$$.fragment,e),u(ie.$$.fragment,e),u(de.$$.fragment,e),u(le.$$.fragment,e),u(me.$$.fragment,e),u(ce.$$.fragment,e),u(ue.$$.fragment,e),u(pe.$$.fragment,e),u(fe.$$.fragment,e),u(ge.$$.fragment,e),u(he.$$.fragment,e),u(_e.$$.fragment,e),u(be.$$.fragment,e),u(ve.$$.fragment,e),u(qe.$$.fragment,e),u($e.$$.fragment,e),u(ye.$$.fragment,e),u(ze.$$.fragment,e),u(xe.$$.fragment,e),u(we.$$.fragment,e),u(Te.$$.fragment,e),u(Ce.$$.fragment,e),u(ke.$$.fragment,e),$t=!0)},o(e){p(K.$$.fragment,e),p(A.$$.fragment,e),p(ee.$$.fragment,e),p(te.$$.fragment,e),p(ne.$$.fragment,e),p(oe.$$.fragment,e),p(re.$$.fragment,e),p(ae.$$.fragment,e),p(se.$$.fragment,e),p(ie.$$.fragment,e),p(de.$$.fragment,e),p(le.$$.fragment,e),p(me.$$.fragment,e),p(ce.$$.fragment,e),p(ue.$$.fragment,e),p(pe.$$.fragment,e),p(fe.$$.fragment,e),p(ge.$$.fragment,e),p(he.$$.fragment,e),p(_e.$$.fragment,e),p(be.$$.fragment,e),p(ve.$$.fragment,e),p(qe.$$.fragment,e),p($e.$$.fragment,e),p(ye.$$.fragment,e),p(ze.$$.fragment,e),p(xe.$$.fragment,e),p(we.$$.fragment,e),p(Te.$$.fragment,e),p(Ce.$$.fragment,e),p(ke.$$.fragment,e),$t=!1},d(e){e&&(s(J),s(w),s(Pe),s(it),s(X),s(dt),s(Z),s(lt),s(mt),s(ct),s(T),s(ut),s(pt),s(C),s(ft),s(gt),s(x),s(ht),s(_t),s($),s(bt),s(vt),s(d),s(qt),s(at)),s(y),f(K,e),f(A,e),f(ee,e),f(te),f(ne),f(oe,e),f(re),f(ae),f(se,e),f(ie),f(de),f(le),f(me),f(ce,e),f(ue),f(pe),f(fe),f(ge),f(he),f(_e,e),f(be),f(ve),f(qe),f($e),f(ye),f(ze),f(xe),f(we),f(Te),f(Ce),f(ke)}}}const vo='{"title":"Quantization","local":"quantization","sections":[{"title":"AqlmConfig","local":"transformers.AqlmConfig","sections":[],"depth":2},{"title":"AwqConfig","local":"transformers.AwqConfig","sections":[],"depth":2},{"title":"GPTQConfig","local":"transformers.GPTQConfig","sections":[],"depth":2},{"title":"BitsAndBytesConfig","local":"transformers.BitsAndBytesConfig","sections":[],"depth":2},{"title":"HfQuantizer","local":"transformers.quantizers.HfQuantizer","sections":[],"depth":2}],"depth":1}';function qo(st){return co(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class To extends po{constructor(y){super(),fo(this,y,qo,bo,mo,{})}}export{To as component};
