Skip to main content
Version: 24.8.0

Settings

CLASS - Settings(

)

This Dataclass holds all the information necessary to run CLIKA Compression.

Class Variables

Methods

save

save(

) ‑> None

Saves the setting configuration to a YAML file.

load_from_path

load_from_path(

) ‑> Optional[Settings]

Loads the setting configuration from a YAML file.

initialize_from_dict

initialize_from_dict(

) ‑> Settings

Initializing a Settings object from a dict.

get_layer_settings

get_layer_settings(

) ‑> Optional[LayerSettings]

Get the LayerSettings for a given Name.

Parameters:

  • name (str) - Name of Layer

Returns:

set_layer_settings

set_layer_settings(

) ‑> None

Set LayerSettings for a given Layer name.

Parameters:

set_quantization_parameters_for_layer

set_quantization_parameters_for_layer(

) ‑> None

Sets quantization settings directly for a given layer with name. This is basically a shortcut instead of putting Quantization Settings in LayerSettings and then setting it for a specific layer.

Parameters:

  • name (str) - Name of the Layer, can be derived either from the pytorch model standard layer name, or from the block name on the model architecture CLIKA Graph that is generated after training as "model_init.svg" inside the outputs folder
  • skip_quantization (Optional[bool]) - Whether or not to skip quantization for this layer
  • skip_quantization_downstream (Optional[bool]) - Whether or not to skip quantization from this node and downstream in the graph
  • skip_quantization_until (Optional[Union[str, Tuple[str], List[str]]]) - Whether to skip quantization from the current node to the specified node or nodes given by name
  • activations_num_bits (Optional[int]) - Number of bits to use for the activations of the layer
  • weights_num_bits (Optional[int]) - Number of bits to use for the weights of the layer

set_quantization_settings_for_layer

set_quantization_settings_for_layer(

  • name: str
  • settings: BaseQuantizationSettings

) ‑> None

Set Quantization Settings for a specific Layer. This is basically a shortcut instead of putting Quantization Settings in LayerSettings and then setting it for a specific layer.

Parameters:

  • name (str) - name of the Layer, can be derived either from the pytorch model standard layer name, or from the block name on the model architecture CLIKA Graph that is generated after training as "model_init.svg" inside the outputs folder
  • settings (BaseQuantizationSettings) - The Quantization Settings for a specific Layer.