qat.core.metrics_base module

class MetricsManager(enabled_metrics=<MetricsType.Default: 6>, **kwargs)

Bases: BaseModel

Stores useful intermediary metrics that are generated during compilation, such as an optimised circuit or the instruction count.

Pydantic version based on qat.purr.compiler.metrics elements.

Parameters:

enabled_metrics (MetricsType) – Which metrics to enable? Default, MetricsType.Default.

are_enabled(metric)
as_dict()

Generates a dictionary of the valid metrics.

enable(enabled_metrics, overwrite=False)

Enable these sets of metrics for collection.

Parameters:
  • enabled_metrics (MetricsType) – Which metrics to enable? Default, MetricsType.Default.

  • overwrite (bool) – If true, overwrite these metrics with a new collection. If false, just enable them in the current collection. Default, true.

enable_metrics(enabled_metrics=<MetricsType.Default: 6>, overwrite=True)

Enables the set of metrics in the current collection.

Parameters:
  • enabled_metrics (MetricsType) – Which metrics to enable? Default, MetricsType.Default.

  • overwrite (bool) – If true, overwrite these metrics with a new collection. If false, just enable them in the current collection. Default, true.

enabled_metrics: Optional[MetricsType]
get_metric(metric)
merge(other)
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

optimized_circuit: Optional[str]
optimized_instruction_count: Optional[int]
record_metric(metric, value)
classmethod validate_all_fields_exist(value)

Validate that all expected MetricsType flags have defined fields.