# transformers 5.24.1 (Apache-2.0), harvested by tools/harvest_corpus.py
=== input
Config class for torchao quantization/sparsity techniques.

    Args:
        quant_type (`AOBaseConfig`):
            A torchao `AOBaseConfig` instance specifying the quantization type, e.g.
            `Int4WeightOnlyConfig(group_size=32)`, `Int8WeightOnlyConfig()`,
            `Int8DynamicActivationInt8WeightConfig()`, `Float8WeightOnlyConfig()`, etc.
        modules_to_not_convert (`list`, *optional*, default to `None`):
            The list of modules to not quantize, useful for quantizing models that explicitly require to have
            some modules left in their original precision.
        include_input_output_embeddings (`bool`, *optional*, defaults to `False`):
            Whether to include embedding in quantization or not, input embedding will be removed from
            the module_not_to_convert list as well if this flag is set.
        untie_embedding_weights (`bool`, *optional*, defaults to `False`):
            Whether to untie the weights when we are quantizing input embedding weights that is tied
            to other weights.

    Example:

    ```python
    from torchao.quantization import Int4WeightOnlyConfig

    quantization_config = TorchAoConfig(Int4WeightOnlyConfig(group_size=32))
    model = AutoModelForCausalLM.from_pretrained(
        model_id, device_map="cuda", torch_dtype=torch.bfloat16, quantization_config=quantization_config
    )
    ```
    
=== parse google
short_description: 'Config class for torchao quantization/sparsity techniques.'
long_description: |
  ```python
  from torchao.quantization import Int4WeightOnlyConfig
  
  quantization_config = TorchAoConfig(Int4WeightOnlyConfig(group_size=32))
  model = AutoModelForCausalLM.from_pretrained(
      model_id, device_map="cuda", torch_dtype=torch.bfloat16, quantization_config=quantization_config
  )
  ```
blank_after_short_description: True
blank_after_long_description: True
style: google
- DocstringParam
  description: |
    A torchao `AOBaseConfig` instance specifying the quantization type, e.g.
    `Int4WeightOnlyConfig(group_size=32)`, `Int8WeightOnlyConfig()`,
    `Int8DynamicActivationInt8WeightConfig()`, `Float8WeightOnlyConfig()`, etc.
  kind: param
  key: 'param'
  arg_name: 'quant_type'
  type_name: '`AOBaseConfig`'
  is_optional: False
- DocstringParam
  description: |
    The list of modules to not quantize, useful for quantizing models that explicitly require to have
    some modules left in their original precision.
  kind: param
  key: 'param'
  arg_name: 'modules_to_not_convert'
  type_name: '`list`'
  is_optional: True
  default: 'None'
  raw_type_name: '`list`, *optional*, default to `None`'
- DocstringParam
  description: |
    Whether to include embedding in quantization or not, input embedding will be removed from
    the module_not_to_convert list as well if this flag is set.
  kind: param
  key: 'param'
  arg_name: 'include_input_output_embeddings'
  type_name: '`bool`'
  is_optional: True
  default: 'False'
  raw_type_name: '`bool`, *optional*, defaults to `False`'
- DocstringParam
  description: |
    Whether to untie the weights when we are quantizing input embedding weights that is tied
    to other weights.
  kind: param
  key: 'param'
  arg_name: 'untie_embedding_weights'
  type_name: '`bool`'
  is_optional: True
  default: 'False'
  raw_type_name: '`bool`, *optional*, defaults to `False`'
- DocstringExample
  kind: examples
  key: 'examples'
=== detect
google
=== compose google
Config class for torchao quantization/sparsity techniques.

```python
from torchao.quantization import Int4WeightOnlyConfig

quantization_config = TorchAoConfig(Int4WeightOnlyConfig(group_size=32))
model = AutoModelForCausalLM.from_pretrained(
    model_id, device_map="cuda", torch_dtype=torch.bfloat16, quantization_config=quantization_config
)
```

Args:
    quant_type (`AOBaseConfig`): A torchao `AOBaseConfig` instance specifying the quantization type, e.g.
        `Int4WeightOnlyConfig(group_size=32)`, `Int8WeightOnlyConfig()`,
        `Int8DynamicActivationInt8WeightConfig()`, `Float8WeightOnlyConfig()`, etc.
    modules_to_not_convert (`list`, *optional*, default to `None`): The list of modules to not quantize, useful for quantizing models that explicitly require to have
        some modules left in their original precision.
    include_input_output_embeddings (`bool`, *optional*, defaults to `False`): Whether to include embedding in quantization or not, input embedding will be removed from
        the module_not_to_convert list as well if this flag is set.
    untie_embedding_weights (`bool`, *optional*, defaults to `False`): Whether to untie the weights when we are quantizing input embedding weights that is tied
        to other weights.

Examples:
