neural_compressor.common.base_config

Module Contents

Classes

ConfigRegistry

BaseConfig

The base config for all algorithm configs.

ComposableConfig

The base config for all algorithm configs.

Functions

register_config(framework_name, algo_name[, priority])

Register config decorator.

get_all_config_set_from_config_registry(...)

register_supported_configs_for_fwk(fwk_name)

Register supported configs for specific framework.

Attributes

options

neural_compressor.common.base_config.register_config(framework_name: str, algo_name: str, priority: float | int = 0)[source]

Register config decorator.

The register the configuration classes for different algorithms within specific frameworks.

Usage example:

@register_config(framework_name=FRAMEWORK_NAME, algo_name=ExampleAlgorithm, priority=100) class ExampleAlgorithmConfig:

# Configuration details for the ExampleAlgorithm

Parameters:
  • framework_name – the framework name.

  • algo_name – the algorithm name.

  • priority – the priority of the configuration. A larger number indicates a higher priority, which will be tried first at the auto-tune stage. Defaults to 0.

class neural_compressor.common.base_config.BaseConfig(white_list: List[neural_compressor.common.utils.OP_NAME_OR_MODULE_TYPE] | None = DEFAULT_WHITE_LIST)[source]

The base config for all algorithm configs.

class neural_compressor.common.base_config.ComposableConfig(configs: List[BaseConfig])[source]

The base config for all algorithm configs.

neural_compressor.common.base_config.register_supported_configs_for_fwk(fwk_name: str)[source]

Register supported configs for specific framework.

Parameters:

fwk_name – the framework name.