otx.algorithms.common.adapters.nncf#

Adapters for nncf support.

Functions

check_nncf_is_enabled()

check_nncf_is_enabled.

get_nncf_metadata()

Get NNCF related metadata.

get_nncf_version()

get_nncf_version.

is_accuracy_aware_training_set(nncf_config)

is_accuracy_aware_training_set.

is_checkpoint_nncf(path)

Check if path is NNCF checkpoint.

is_in_nncf_tracing()

is_in_nncf_tracing.

is_state_nncf(state)

Check if state_dict is NNCF state_dict.

no_nncf_trace()

Wrapper for original NNCF no_nncf_trace context.

nncf_trace_context(self, img_metas[, ...])

A context manager for nncf graph tracing.

no_nncf_trace_wrapper(self, fn, *args, **kwargs)

A wrapper function not to trace in NNCF.

nncf_trace_wrapper(self, fn, *args, **kwargs)

A wrapper function to trace in NNCF.

is_nncf_enabled()

is_nncf_enabled.

Classes

AccuracyAwareLrUpdater(lr_hook)

AccuracyAwareLrUpdater.

class otx.algorithms.common.adapters.nncf.AccuracyAwareLrUpdater(lr_hook)[source]#

Bases: object

AccuracyAwareLrUpdater.

step(*args, **kwargs)[source]#

step.

property base_lrs#

base_lrs.

otx.algorithms.common.adapters.nncf.check_nncf_is_enabled()[source]#

check_nncf_is_enabled.

otx.algorithms.common.adapters.nncf.get_nncf_metadata()[source]#

Get NNCF related metadata.

The function returns NNCF metadata that should be stored into a checkpoint. The metadata is used to check in wrap_nncf_model if the checkpoint should be used to resume NNCF training or initialize NNCF fields of NNCF-wrapped model.

otx.algorithms.common.adapters.nncf.get_nncf_version()[source]#

get_nncf_version.

otx.algorithms.common.adapters.nncf.is_accuracy_aware_training_set(nncf_config)[source]#

is_accuracy_aware_training_set.

otx.algorithms.common.adapters.nncf.is_checkpoint_nncf(path)[source]#

Check if path is NNCF checkpoint.

The function uses metadata stored in a checkpoint to check if the checkpoint was the result of trainning of NNCF-compressed model. See the function get_nncf_metadata above.

otx.algorithms.common.adapters.nncf.is_in_nncf_tracing()[source]#

is_in_nncf_tracing.

otx.algorithms.common.adapters.nncf.is_nncf_enabled()[source]#

is_nncf_enabled.

otx.algorithms.common.adapters.nncf.is_state_nncf(state)[source]#

Check if state_dict is NNCF state_dict.

The function uses metadata stored in a dict_state to check if the checkpoint was the result of trainning of NNCF-compressed model. See the function get_nncf_metadata above.

otx.algorithms.common.adapters.nncf.nncf_trace_context(self, img_metas, nncf_compress_postprocessing=True)[source]#

A context manager for nncf graph tracing.

otx.algorithms.common.adapters.nncf.nncf_trace_wrapper(self, fn, *args, **kwargs)[source]#

A wrapper function to trace in NNCF.

otx.algorithms.common.adapters.nncf.no_nncf_trace()[source]#

Wrapper for original NNCF no_nncf_trace context.

otx.algorithms.common.adapters.nncf.no_nncf_trace_wrapper(self, fn, *args, **kwargs)[source]#

A wrapper function not to trace in NNCF.