otx.algorithms.common.adapters.nncf#
Adapters for nncf support.
Functions
check_nncf_is_enabled. |
|
Get NNCF related metadata. |
|
get_nncf_version. |
|
|
is_accuracy_aware_training_set. |
|
Check if path is NNCF checkpoint. |
is_in_nncf_tracing. |
|
|
Check if state_dict is NNCF state_dict. |
Wrapper for original NNCF no_nncf_trace context. |
|
|
A context manager for nncf graph tracing. |
|
A wrapper function not to trace in NNCF. |
|
A wrapper function to trace in NNCF. |
is_nncf_enabled. |
Classes
|
AccuracyAwareLrUpdater. |
- class otx.algorithms.common.adapters.nncf.AccuracyAwareLrUpdater(lr_hook)[source]#
Bases:
object
AccuracyAwareLrUpdater.
- property base_lrs#
base_lrs.
- 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.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_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.