qat.purr.compiler.metrics module

class CompilationMetrics(enabled_metrics=None)

Bases: object

Container object for all metrics generated during the compilation pipeline. All fields are generated from the MetricsType flag after the names are snake-cased and hold the value associated with that particular flag.

are_enabled(metric)
as_dict()

Generates a dictionary of the valid metrics.

enable(enabled_metrics, overwrite=False)

Enable these sets of metrics for collection. If overwrite is True then the passed-in values will overwrite existing ones.

get_metric(metric)
merge(other)
optimized_circuit: Optional[str]
optimized_instruction_count: Optional[int]
record_metric(metric, value)
class MetricsMixin

Bases: object

are_metrics_enabled(metric_type=None)

Do we have a metrics collection, and if so does it have any active metrics.

enable_metrics(enabled_metrics=None, overwrite=True)

Enables the set of metrics in the current collection. If overwrite is set to true, or there are no compilation metrics it’ll create a new collection, if overwrite is false it’ll enable these metrics in the currently-active collection.

record_metric(metric, value)

Records a metric value if the collection has this sort of metric enabled.