Group Common optimization passes#

group ov_transformation_common_api

A set of common optimization passes.

class AddTransformation : public ov::pass::low_precision::EltwiseBaseTransformation#
#include <add.hpp>

AddTransformation propagates dequantization subtraction from one input branch to another and propagates dequantization multiplication from the same branch through Add operation.

For more details about the transformation, refer to AddTransformation page in the OpenVINO Developer Guide.

class AlignQuantizationIntervals : public ov::pass::ModelPass#
#include <align_quantization_intervals.hpp>

AlignQuantizationIntervals transformation marks precision preserved operations subgraph by IntervalsAlignmentAttribute after FakeQuantize operations.

For more details about the transformation, refer to AlignQuantizationIntervals page in the OpenVINO Developer Guide.

class AlignQuantizationParameters : public ov::pass::ModelPass#
#include <align_quantization_parameters.hpp>

AlignQuantizationParameters transformation marks precision preserved operations subgraph by QuantizationAlignmentAttribute attribute after FakeQuantize operations.

For more details about the transformation, refer to AlignQuantizationParameters page in the OpenVINO Developer Guide.

class AvgPoolTransformation : public ov::pass::low_precision::LayerTransformation#
#include <avg_pool.hpp>

AvgPoolTransformation propagates dequantization operations through AvgPool operation.

For more details about the transformation, refer to AvgPoolTransformation page in the OpenVINO Developer Guide.

class BatchToSpaceTransformation : public ov::pass::low_precision::LayerTransformation#
#include <batch_to_space.hpp>

BatchToSpaceTransformation propagates dequantization operations through BatchToSpace operation.

For more details about the transformation, refer to BatchToSpaceTransformation page in the OpenVINO Developer Guide.

class BroadcastTransformation : public ov::pass::low_precision::TransparentBaseTransformation#
#include <broadcast.hpp>

BroadcastTransformation propagates dequantization operations through Broadcast operation.

For more details about the transformation, refer to BroadcastTransformation page in the OpenVINO Developer Guide.

class ClampTransformation : public ov::pass::low_precision::LayerTransformation#
#include <clamp.hpp>

ClampTransformation propagates dequantization operations through Clamp operation.

For more details about the transformation, refer to ClampTransformation page in the OpenVINO Developer Guide.

class CleanupTransformation : public ov::pass::low_precision::LayerTransformation#
#include <cleanup_transformation.hpp>

Base class for cleanup low precision transformation.

Subclassed by ov::pass::low_precision::EliminateFakeQuantizeTransformation, ov::pass::low_precision::FoldConvertTransformation, ov::pass::low_precision::FuseConvertTransformation, ov::pass::low_precision::FuseElementwiseToFakeQuantizeTransformation, ov::pass::low_precision::MultiplyToGroupConvolutionTransformation

class ConcatTransformation : public ov::pass::low_precision::LayerTransformation#
#include <concat.hpp>

ConcatTransformation propagates dequantization operations through Concat operation.

For more details about the transformation, refer to ConcatTransformation page in the OpenVINO Developer Guide.

class ConvertSubtractConstant : public ov::pass::MatcherPass#
#include <convert_subtract_constant.hpp>

ConvertSubtractConstant marks Convert operations on constant subgraph by DISABLED_CONSTANT_FOLDING attribute to prevent constant folding.

For more details about the transformation, refer to ConvertSubtractConstant page in the OpenVINO Developer Guide.

class ConvolutionTransformation : public ov::pass::low_precision::WeightableLayerTransformation#
#include <convolution.hpp>

ConvolutionTransformation propagates dequantization operations through Convolution operation.

For more details about the transformation, refer to ConvolutionTransformation page in the OpenVINO Developer Guide.

Subclassed by ov::pass::low_precision::GroupConvolutionTransformation

class ConvolutionBackpropDataTransformation : public ov::pass::low_precision::WeightableLayerTransformation#
#include <convolution_backprop_data.hpp>

ConvolutionBackpropDataTransformation propagates dequantization operations through ConvolutionBackpropData operation.

For more details about the transformation, refer to ConvolutionBackpropDataTransformation page in the OpenVINO Developer Guide.

template<typename AttributeType, typename OperationType = ov::pass::pattern::op::Label>
class CreateAttribute : public ov::pass::low_precision::BaseMatcherPass#
#include <create_attribute.hpp>

CreateAttribute transformation marks OperationType operations by AttributeType attribute.

For more details about the transformation, refer to CreateAttribute page in the OpenVINO Developer Guide.

template<typename AttributeType, typename OperationType>
class CreatePrecisionsDependentAttribute : public ov::pass::MatcherPass#
#include <create_precisions_dependent_attribute.hpp>

CreatePrecisionsDependentAttribute transformation marks OperationType operations by PrecisionPreservedAttribute and AttributeType attributes with the same shared part.

For more details about the transformation, refer to CreatePrecisionsDependentAttribute page in the OpenVINO Developer Guide.

class DepthToSpaceTransformation : public ov::pass::low_precision::TransparentBaseTransformation#
#include <depth_to_space.hpp>

DepthToSpaceTransformation propagates dequantization operations through DepthToSpace operation.

For more details about the transformation, refer to DepthToSpaceTransformation page in the OpenVINO Developer Guide.

class EliminateFakeQuantizeTransformation : public ov::pass::low_precision::CleanupTransformation#
#include <eliminate_fake_quantize.hpp>

EliminateFakeQuantizeTransformation removes FakeQuantize operations.

For more details about the transformation, refer to EliminateFakeQuantizeTransformation page in the OpenVINO Developer Guide.

class EltwiseBaseTransformation : public ov::pass::low_precision::LayerTransformation#
#include <eltwise_base_transformation.hpp>

EltwiseBaseTransformation is base class for element-wise LPT transformations.

Subclassed by ov::pass::low_precision::AddTransformation, ov::pass::low_precision::MultiplyPartialTransformation

class FakeQuantizeTransformation : public ov::pass::low_precision::LayerTransformation#
#include <fake_quantize.hpp>

FakeQuantizeTransformation fuses dequantization operations into FakeQuantize operation.

For more details about the transformation, refer to FakeQuantizeTransformation page in the OpenVINO Developer Guide.

class FakeQuantizeDecompositionTransformation : public ov::pass::low_precision::LayerTransformation#
#include <fake_quantize_decomposition.hpp>

FakeQuantizeDecompositionTransformation decomposes FakeQuantize operations to quantize (FakeQuantize with changes output intervals and low precision output type) and dequantize operations.

For more details about the transformation, refer to FakeQuantizeDecompositionTransformation page in the OpenVINO Developer Guide.

class FoldConvertTransformation : public ov::pass::low_precision::CleanupTransformation#
#include <fold_convert.hpp>

FoldConvertTransformation evaluates Convert operation on Subtract constant subgraph. Important notice: this transformation ignores DisableConstantFolding runtime attribute.

For more details about the transformation, refer to FoldConvertTransformation page in the OpenVINO Developer Guide.

class FoldFakeQuantizeTransformation : public ov::pass::low_precision::LayerTransformation#
#include <fold_fake_quantize.hpp>

FoldFakeQuantizeTransformation evaluate FakeQuantize operations.

For more details about the transformation, refer to FoldFakeQuantizeTransformation page in the OpenVINO Developer Guide.

class FuseConvertTransformation : public ov::pass::low_precision::CleanupTransformation#
#include <fuse_convert.hpp>

FuseConvertTransformation fuses Convert operation with Multiply, Subtract or Add operations.

For more details about the transformation, refer to FuseConvertTransformation page in the OpenVINO Developer Guide.

class FuseElementwiseToFakeQuantizeTransformation : public ov::pass::low_precision::CleanupTransformation#
#include <fuse_elementwise_to_fake_quantize.hpp>

Base class for fuse elementwise to FakeQuantize low precision transformation.

Subclassed by ov::pass::low_precision::FuseMultiplyToFakeQuantizeTransformation, ov::pass::low_precision::FuseSubtractToFakeQuantizeTransformation

class FuseMultiplyToFakeQuantizeTransformation : public ov::pass::low_precision::FuseElementwiseToFakeQuantizeTransformation#
#include <fuse_multiply_to_fake_quantize.hpp>

FuseMultiplyToFakeQuantizeTransformation fuses Multiply operation to FakeQuantize.

For more details about the transformation, refer to FuseMultiplyToFakeQuantizeTransformation page in the OpenVINO Developer Guide.

class FuseSubtractToFakeQuantizeTransformation : public ov::pass::low_precision::FuseElementwiseToFakeQuantizeTransformation#
#include <fuse_subtract_to_fake_quantize.hpp>

FuseSubtractToFakeQuantizeTransformation fuses Subtract operation to FakeQuantize.

For more details about the transformation, refer to FuseSubtractToFakeQuantizeTransformation page in the OpenVINO Developer Guide.

class GroupConvolutionTransformation : public ov::pass::low_precision::ConvolutionTransformation#
#include <group_convolution.hpp>

GroupConvolutionTransformation propagates dequantization operations through GroupConvolution operation.

For more details about the transformation, refer to GroupConvolutionTransformation page in the OpenVINO Developer Guide.

class InterpolateTransformation : public ov::pass::low_precision::LayerTransformation#
#include <interpolate.hpp>

InterpolateTransformation propagates dequantization operations through Interpolate operation.

For more details about the transformation, refer to InterpolateTransformation page in the OpenVINO Developer Guide.

class LayerTransformation : public ov::pass::MatcherPass#
#include <layer_transformation.hpp>

Base class for low precision transformation.

Subclassed by ov::pass::low_precision::AssignAndReadValueTransformation, ov::pass::low_precision::AvgPoolTransformation, ov::pass::low_precision::BatchToSpaceTransformation, ov::pass::low_precision::ClampTransformation, ov::pass::low_precision::CleanupTransformation, ov::pass::low_precision::ConcatTransformation, ov::pass::low_precision::ConvertTransformation, ov::pass::low_precision::EltwiseBaseTransformation, ov::pass::low_precision::FakeQuantizeDecompositionTransformation, ov::pass::low_precision::FakeQuantizeTransformation, ov::pass::low_precision::FoldFakeQuantizeTransformation, ov::pass::low_precision::GatherTransformation, ov::pass::low_precision::InterpolateTransformation, ov::pass::low_precision::MVNTransformation, ov::pass::low_precision::MatMulTransformation, ov::pass::low_precision::MaxPoolTransformation, ov::pass::low_precision::MoveFakeQuantize, ov::pass::low_precision::NormalizeL2Transformation, ov::pass::low_precision::PReluTransformation, ov::pass::low_precision::PadTransformation, ov::pass::low_precision::RecurrentCellTransformation, ov::pass::low_precision::ReduceBaseTransformation, ov::pass::low_precision::ReluTransformation, ov::pass::low_precision::ReshapeTransformation, ov::pass::low_precision::ShuffleChannelsTransformation, ov::pass::low_precision::SpaceToBatchTransformation, ov::pass::low_precision::SplitTransformation, ov::pass::low_precision::SqueezeTransformation, ov::pass::low_precision::StridedSliceTransformation, ov::pass::low_precision::SubtractTransformation, ov::pass::low_precision::TransparentBaseTransformation, ov::pass::low_precision::TransposeTransformation, ov::pass::low_precision::UnsqueezeTransformation, ov::pass::low_precision::WeightableLayerTransformation

class Params#
#include <layer_transformation.hpp>
class PrecisionDetails#
#include <layer_transformation.hpp>
class MarkupAvgPoolPrecisionPreserved : public ov::pass::ModelPass#
#include <markup_avg_pool_precision_preserved.hpp>

MarkupAvgPoolPrecisionPreserved transformation marks AvgPool operations as precision preserved or not.

For more details about the transformation, refer to MarkupAvgPoolPrecisionPreserved page in the OpenVINO Developer Guide.

class MarkupBias : public ov::pass::MatcherPass#
#include <markup_bias.hpp>

MarkupBias transformation marks biases after target layers.

For more details about the transformation, refer to MarkupBias page in the OpenVINO Developer Guide.

class MarkupCanBeQuantized : public ov::pass::ModelPass#
#include <markup_can_be_quantized.hpp>

MarkupCanBeQuantized transformation marks Convolution, ConvolutionBackpropData, GroupConvolution and Concat operations as able to be quantized or not. If an operation is not quantized, then PrecisionsAttribute attribute instance is created with empty precisions.

For more details about the transformation, refer to MarkupCanBeQuantized page in the OpenVINO Developer Guide.

class MarkupPrecisions : public ov::pass::ModelPass#
#include <markup_precisions.hpp>

MarkupPrecisions transformation marks: 1) not supported operations by PrecisionsAttribute attribute with empty precisions, 2) operations with required precisions by PrecisionsAttribute attribute according to the provided restrictions, 3) precision preserved operations by PrecisionPreservedAttribute attribute.

For more details about the transformation, refer to MarkupPrecisions page in the OpenVINO Developer Guide.

class Restriction#
#include <markup_precisions.hpp>
class RestrictionByVersion#
#include <markup_precisions.hpp>
class MarkupQuantizationGranularity : public ov::pass::ModelPass#
#include <markup_quantization_granularity.hpp>

MarkupPerTensorQuantization transformation marks operations as required per-tensor quantization according to the provided restrictions.

For more details about the transformation, refer to MarkupPerTensorQuantization page in the OpenVINO Developer Guide.

class PerTensorQuantization#
#include <markup_quantization_granularity.hpp>
class MatMulTransformation : public ov::pass::low_precision::LayerTransformation#
#include <mat_mul.hpp>

MatMulTransformation propagates dequantization operations through MatMul operation.

For more details about the transformation, refer to MatMulTransformation page in the OpenVINO Developer Guide.

class MaxPoolTransformation : public ov::pass::low_precision::LayerTransformation#
#include <max_pool.hpp>

MaxPoolTransformation propagates dequantization operations through MaxPool operation.

For more details about the transformation, refer to MaxPoolTransformation page in the OpenVINO Developer Guide.

class MultiplyTransformation : public ov::pass::low_precision::WeightableLayerTransformation#
#include <multiply.hpp>

MultiplyTransformation propagates dequantization operations through Multiply operation.

For more details about the transformation, refer to MultiplyTransformation page in the OpenVINO Developer Guide.

class MultiplyPartialTransformation : public ov::pass::low_precision::EltwiseBaseTransformation#
#include <multiply_partial.hpp>

MultiplyPartialTransformation propagates dequantization operations through Multiply operation.

For more details about the transformation, refer to MultiplyPartialTransformation page in the OpenVINO Developer Guide.

class MultiplyToGroupConvolutionTransformation : public ov::pass::low_precision::CleanupTransformation#
#include <multiply_to_group_convolution.hpp>

MultiplyToGroupConvolutionTransformation replace quantized Multiply operations to GroupConvolution to speed up inference.

For more details about the transformation, refer to MultiplyToGroupConvolutionTransformation page in the OpenVINO Developer Guide.

class MVNTransformation : public ov::pass::low_precision::LayerTransformation#
#include <mvn.hpp>

MVNTransformation propagates dequantization operations through MVN operation.

For more details about the transformation, refer to MVNTransformation page in the OpenVINO Developer Guide.

class NormalizeL2Transformation : public ov::pass::low_precision::LayerTransformation#
#include <normalize_l2.hpp>

NormalizeL2Transformation propagates dequantization operations through NormalizeL2 operation.

For more details about the transformation, refer to NormalizeL2Transformation page in the OpenVINO Developer Guide.

class PadTransformation : public ov::pass::low_precision::LayerTransformation#
#include <pad.hpp>

PadTransformation propagates dequantization operations through Pad operation.

For more details about the transformation, refer to PadTransformation page in the OpenVINO Developer Guide.

class PReluTransformation : public ov::pass::low_precision::LayerTransformation#
#include <prelu.hpp>

PReluTransformation propagates dequantization operations through PRelu operation.

For more details about the transformation, refer to PReluTransformation page in the OpenVINO Developer Guide.

class PropagatePrecisions : public ov::pass::ModelPass#
#include <propagate_precisions.hpp>

PropagatePrecisions transformation propagates PrecisionsAttribute attribute instances precision preserved operations.

For more details about the transformation, refer to PropagatePrecisions page in the OpenVINO Developer Guide.

template<class AttributeType>
class PropagateSharedValue : public ov::pass::ModelPass#
#include <propagate_shared_value.hpp>

PropagateSharedValue transformation propagates shared value AttributeType attribute instances through precision preserved operations.

For more details about the transformation, refer to PropagateSharedValue page in the OpenVINO Developer Guide.

template<typename AttributeType>
class PropagateThroughPrecisionPreserved : public ov::pass::MatcherPass#
#include <propagate_through_precision_preserved.hpp>

PropagateThroughPrecisionPreserved transformation propagates AttributeType attribute instances through precision preserved operations.

For more details about the transformation, refer to PropagateThroughPrecisionPreserved page in the OpenVINO Developer Guide.

template<typename AttributeType>
class PropagateToInput : public ov::pass::MatcherPass#
#include <propagate_to_input.hpp>

PropagateToInput transformation propagates AttributeType shared value attribute instances from parent output ports to consumers input ports.

For more details about the transformation, refer to PropagateToInput page in the OpenVINO Developer Guide.

class PullReshapeThroughDequantization : public ov::pass::MatcherPass#
#include <pull_reshape_through_dequantization.hpp>

PullReshapeThroughDequantization propagates dequantization operations through Reshape operations. The transformation is used on constant subgraph weights to prepare a model for the next low precision transformations.

For more details about the transformation, refer to PullReshapeThroughDequantization page in the OpenVINO Developer Guide.

class PullTransposeThroughDequantization : public ov::pass::MatcherPass#
#include <pull_transpose_through_dequantization.hpp>

PullTransposeThroughDequantization propagates dequantization operations through Transpose operations. The transformation is used on constant subgraph weights to prepare a model for the next low precision transformations.

For more details about the transformation, refer to PullTransposeThroughDequantization page in the OpenVINO Developer Guide.

class ReduceBaseTransformation : public ov::pass::low_precision::LayerTransformation#
#include <reduce_base_transformation.hpp>

ReduceBaseTransformation: base class for Reduce*Transformation, detects dequantization operations in front of the Reduce* operation and propagates them through the Reduce* if possible.

Subclassed by ov::pass::low_precision::ReduceMaxTransformation, ov::pass::low_precision::ReduceMeanTransformation, ov::pass::low_precision::ReduceMinTransformation, ov::pass::low_precision::ReduceSumTransformation

class ReduceMaxTransformation : public ov::pass::low_precision::ReduceBaseTransformation#
#include <reduce_max.hpp>

ReduceMaxTransformation propagates dequantization operations through ReduceMax operation.

For more details about the transformation, refer to ReduceMaxTransformation page in the OpenVINO Developer Guide.

class ReduceMeanTransformation : public ov::pass::low_precision::ReduceBaseTransformation#
#include <reduce_mean.hpp>

ReduceMeanTransformation propagates dequantization operations through ReduceMean operation.

For more details about the transformation, refer to ReduceMeanTransformation page in the OpenVINO Developer Guide.

class ReduceMinTransformation : public ov::pass::low_precision::ReduceBaseTransformation#
#include <reduce_min.hpp>

ReduceMinTransformation propagates dequantization operations through ReduceMin operation.

For more details about the transformation, refer to ReduceMinTransformation page in the OpenVINO Developer Guide.

class ReduceSumTransformation : public ov::pass::low_precision::ReduceBaseTransformation#
#include <reduce_sum.hpp>

ReduceSumTransformation propagates dequantization operations through ReduceSum operation.

For more details about the transformation, refer to ReduceSumTransformation page in the OpenVINO Developer Guide.

class ReluTransformation : public ov::pass::low_precision::LayerTransformation#
#include <relu.hpp>

ReluTransformation propagates dequantization operations through Relu operation.

For more details about the transformation, refer to ReluTransformation page in the OpenVINO Developer Guide.

class ReshapeTransformation : public ov::pass::low_precision::LayerTransformation#
#include <reshape.hpp>

ReshapeTransformation propagates dequantization operations through Reshape operation.

For more details about the transformation, refer to ReshapeTransformation page in the OpenVINO Developer Guide.

class AvgPoolPrecisionPreservedAttribute : public ov::PrecisionPreservedAttribute#
#include <avg_pool_precision_preserved_attribute.hpp>

AvgPoolPrecisionPreservedAttribute is utility attribute which is used only during AvgPool operation precision preserved property definition.

For more details about the attribute, refer to AvgPoolPrecisionPreservedAttribute page in the OpenVINO Developer Guide.

class IntervalsAlignmentSharedValue#
#include <intervals_alignment_attribute.hpp>

IntervalsAlignmentSharedValue is used by IntervalsAlignmentAttribute as attribute shared value.

class Interval#
#include <intervals_alignment_attribute.hpp>
class IntervalsAlignmentAttribute : public SharedAttribute<IntervalsAlignmentSharedValue>#
#include <intervals_alignment_attribute.hpp>

IntervalsAlignmentAttribute defines subgraph with the same quantization intervals alignment. FakeQuantize operations are included. The attribute is used by quantization operations.

For more details about the attribute, refer to IntervalsAlignmentAttribute page in the OpenVINO Developer Guide.

class PrecisionPreservedAttribute : public SharedAttribute<bool>#
#include <precision_preserved_attribute.hpp>

PrecisionPreservedAttribute defines the precision preserved operation. If the attribute is absent, then an operation is not precision preserved.

For more details about the attribute, refer to PrecisionPreservedAttribute page in the OpenVINO Developer Guide.

Subclassed by ov::AvgPoolPrecisionPreservedAttribute

class PrecisionsAttribute : public SharedAttribute<std::vector<ov::element::Type>>#
#include <precisions_attribute.hpp>

PrecisionsAttribute defines precision which is required for input/output port or an operation.

For more details about the attribute, refer to PrecisionsAttribute page in the OpenVINO Developer Guide.

class QuantizationAlignmentAttribute : public SharedAttribute<bool>#
#include <quantization_alignment_attribute.hpp>

QuantizationAlignmentAttribute defines subgraph with the same quantization alignment. FakeQuantize operations are not included. The attribute is used by quantization operations.

For more details about the attribute, refer to QuantizationAlignmentAttribute page in the OpenVINO Developer Guide.

class QuantizationGranularityAttribute : public ov::RuntimeAttribute#
#include <quantization_granularity_attribute.hpp>

QuantizationGranularityAttribute defines quantization granularity of operation inputs.

For more details about the attribute, refer to QuantizationGranularityAttribute page in the OpenVINO Developer Guide.

class SharedValueAttribute : public std::enable_shared_from_this<SharedValueAttribute>#
#include <shared_value_attribute.hpp>

SharedValueAttribute type for shared value attributes. The attribute is used for attribute SharedValue value backward propagation.

struct SharedValue : public std::enable_shared_from_this<SharedValue>#
#include <shared_value_attribute.hpp>
class ShuffleChannelsTransformation : public ov::pass::low_precision::LayerTransformation#
#include <shuffle_channels.hpp>

ShuffleChannelsTransformation propagates dequantization operations through ShuffleChannels operation.

For more details about the transformation, refer to ShuffleChannelsTransformation page in the OpenVINO Developer Guide.

class SpaceToBatchTransformation : public ov::pass::low_precision::LayerTransformation#
#include <space_to_batch.hpp>

SpaceToBatchTransformation propagates dequantization operations through SpaceToBatch operation.

For more details about the transformation, refer to SpaceToBatchTransformation page in the OpenVINO Developer Guide.

class SplitTransformation : public ov::pass::low_precision::LayerTransformation#
#include <split.hpp>

SplitTransformation propagates dequantization operations through Split operation.

For more details about the transformation, refer to SplitTransformation page in the OpenVINO Developer Guide.

Subclassed by ov::pass::low_precision::VariadicSplitTransformation

class SqueezeTransformation : public ov::pass::low_precision::LayerTransformation#
#include <squeeze.hpp>

SqueezeTransformation propagates dequantization operations through Squeeze operation.

For more details about the transformation, refer to SqueezeTransformation page in the OpenVINO Developer Guide.

class StridedSliceTransformation : public ov::pass::low_precision::LayerTransformation#
#include <strided_slice.hpp>

StridedSliceTransformation propagates dequantization operations through StridedSlice operation.

For more details about the transformation, refer to StridedSliceTransformation page in the OpenVINO Developer Guide.

class SubtractTransformation : public ov::pass::low_precision::LayerTransformation#
#include <subtract.hpp>

SubtractTransformation propagates dequantization operations through Subtract operation.

For more details about the transformation, refer to SubtractTransformation page in the OpenVINO Developer Guide.

class TransformationContext#
#include <transformation_context.hpp>

TransformationContext instance is used to pass model transformation context data between transformations.

class TransparentBaseTransformation : public ov::pass::low_precision::LayerTransformation#
#include <transparent_base_transformation.hpp>

TransparentBaseTransformation is base type for precision preserved operation transformation.

Subclassed by ov::pass::low_precision::BroadcastTransformation, ov::pass::low_precision::DepthToSpaceTransformation

class TransposeTransformation : public ov::pass::low_precision::LayerTransformation#
#include <transpose.hpp>

TransposeTransformation propagates dequantization operations through Transpose operation.

For more details about the transformation, refer to TransposeTransformation page in the OpenVINO Developer Guide.

class UnsqueezeTransformation : public ov::pass::low_precision::LayerTransformation#
#include <unsqueeze.hpp>

UnsqueezeTransformation propagates dequantization operations through Unsqueeze operation.

For more details about the transformation, refer to UnsqueezeTransformation page in the OpenVINO Developer Guide.

template<typename AttributeType, typename ExpectedAttributeType = AttributeType>
class UpdateSharedPrecisionPreserved : public ov::pass::MatcherPass#
#include <update_shared_precision_preserved.hpp>

UpdateSharedPrecisionPreserved transformation updates shared AttributeType attribute instance value to true for precision preserved operations if ExpectedAttributeType exist.

For more details about the transformation, refer to UpdateSharedPrecisionPreserved page in the OpenVINO Developer Guide.

class VariadicSplitTransformation : public ov::pass::low_precision::SplitTransformation#
#include <variadic_split.hpp>

VariadicSplitTransformation propagates dequantization operations through VariadicSplit operation.

For more details about the transformation, refer to VariadicSplitTransformation page in the OpenVINO Developer Guide.

class WeightableLayerTransformation : public ov::pass::low_precision::LayerTransformation#
#include <weightable_layer_transformation.hpp>

WeightableLayerTransformation is base type for weightable operation transformation.

Subclassed by ov::pass::low_precision::ConvolutionBackpropDataTransformation, ov::pass::low_precision::ConvolutionTransformation, ov::pass::low_precision::MultiplyTransformation

struct CanBeTransformedParams#
#include <weightable_layer_transformation.hpp>
class InitMasks : public ov::pass::GraphRewrite#
#include <pruning.hpp>

Initialising masks for pruned operations.

class InitConstMask : public ov::pass::MatcherPass#
#include <pruning.hpp>

Check Constant operation values by given dimensions and set masks according to results that are bases on condition lambda function. Works for Constant with floating point type (f16, f32, f64).

class PropagateMasks : public ov::pass::GraphRewrite#
#include <pruning.hpp>

Contains several MatcherPasses that initialize and propagate masks from Constant operation to the network output.

class ShrinkWeights : public ov::pass::ModelPass#
#include <pruning.hpp>

Based on masks in Constant operation it inserts Gather operations to shrink them. After this pass execution ConstantFolding is required.

class Pruning : public ov::pass::ModelPass#
#include <pruning.hpp>

This is just a sequence of passes that performs pruning transformations pipeline.

class AdaptivePoolToReduce : public ov::pass::MatcherPass#
#include <adaptive_pool_to_reduce.hpp>

AdaptivePoolToReduce transformation replaces AdaptiveXXXPool with ReduceXXX when possible.

class AddFakeQuantizeFusion : public ov::pass::MatcherPass#
#include <add_fake_quantize_fusion.hpp>

AddFakeQuantizeFusion transformation replaces following graph: Add->FakeQuantize to a single FakeQuantize Restrictions:

  • second input to Add is a Constant

class AUGRUCellFusion : public ov::pass::MatcherPass#
#include <augru_cell_fusion.hpp>

AUGRUCellFusion transformation replaces a sequence of operations with AUGRUCell op.

Supported activations: 1st is Sigmoid, 2nd is Tanh Clip attribute is not supported. Linear_before_reset attribute is not supported. Supported weights format: ‘rzh’

class BatchToSpaceFusion : public ov::pass::MatcherPass#
#include <batch_to_space_fusion.hpp>

BatchToSpaceFusion transformation replaces following graph: Transpose (or Reshape) -> DepthToSpace -> StridedSlice -> Transpose (or Reshape) to BatchToSpace Restrictions:

  • input rank must be 4

  • Transpose permutation must be [1, 0, 2, 3]

  • DepthToSpaceMode must be BLOCKS_FIRST

class BinarizeWeights : public ov::pass::MatcherPass#
#include <binarize_weights.hpp>

This transformation converts weights to -1/+1 form and applies normalization factors to output low/high and after Convolution. For example, following graph.

    .... ....  out_low  out_high           weights ..    ..  out_low out_high
      |    |      |        |                  |     |    |      |     |
     +--------------------------+           +--------------------------+
     | FakeQuantize (levels==2) |           | FakeQuantize (levels==2) |
     |     (on activations)     |           |       (on weights)       |
     +--------------------------+           +--------------------------+
                   |                                      |
                   |                                      |
                   -----------------    -------------------
                                   |    |
                                   v    v
                              +-------------+
                              | Convolution |
                              +-------------+
                                     |
                                     v
is transformed to:
             normalized normalized
    .... ....  out_low   out_high
      |    |      |         |
     +--------------------------+           +--------------------------+
     | FakeQuantize (levels==2) |           |         Constant         |
     |     (on activations)     |           | (with converted weights) |
     +--------------------------+           +--------------------------+
                   |                                      |
                   |                                      |
                   -----------------    -------------------
                                   |    |
                                   v    v
                              +-------------+
                              | Convolution |
                              +-------------+
                                     |
                                     v
                              +------------+     +---------------------------------------------------------------+
                              |  Multiply  | <---| Constant (normalization factor coming from FQ on activations) |
                              +------------+     +---------------------------------------------------------------+
                                     |
                                     v
                              +------------+     +-----------------------------------------------------------+
                              |  Multiply  | <---| Constant (normalization factor coming from FQ on weights) |
                              +------------+     +------------------------------------------------------------
                                     |
                                     v
Normalization factors are chosen based output_high value. If it’s zero - norm factor is equal to output_low and output_high otherwise

class BroadcastElementwiseFusion : public ov::pass::MatcherPass#
#include <broadcast_elementwise_fusion.hpp>

Removing Broadcast OP before ElementWise if output shape of Broadcast are equal neighboring input shape of ElementWise.

class BroadcastTransition : public ov::pass::MatcherPass#
#include <broadcast_transition.hpp>

BroadcastTransition transformation moves broadcast through binary eltwise operation.

class ClampFusion : public ov::pass::MatcherPass#
#include <clamp_fusion.hpp>

ClampFusion transformation replaces following graph: Maximum->Minimum to Clamp Restrictions:

  • one of the parameters to Maximum is a scalar constant

  • one of the parameters to Minimum is a scalar constant

class CompressFloatConstantsImpl : public ov::pass::MatcherPass#
#include <compress_float_constants.hpp>

CompressFloatConstantsImpl transformation replaces FP32/FP64 Constants with FP16 ones.

Public Functions

CompressFloatConstantsImpl(bool postponed = false)#

Transformation constructor.

Parameters:

postponed – If true then the transformation won’t compress the constants keeping them in the original type but still will insert Converts. This is a special mode of operation that requires another transformation to apply a real compression on constants. Constants eligible for postponed compression are marked with a special rt_info tag.

class CompressFloatConstants : public ov::pass::GraphRewrite#
#include <compress_float_constants.hpp>

CompressFloatConstants transformation replaces FP32/FP64 Constants with FP16 ones.

Public Functions

inline CompressFloatConstants(bool postponed = false)#

Transformation constructor.

Parameters:

postponed – Postponed compression, see ov::pass::CompressFloatConstantsImpl for details.

class ConcatFusion : public ov::pass::MatcherPass#
#include <concat_fusion.hpp>

ConcatFusion transformation fuses sequence of Concats.

class ReplaceConcatReduceByMinOrMax : public ov::pass::MatcherPass#
#include <concat_reduce_fusion.hpp>

ReplaceConcatReduceByMinOrMax transformation replaces Concat with 2 inputs and ReduceMin/Max by a single Minimum/Maximum with 2 inputs and inserts squeeze in case when Reduce has keep_dims = false.

class PullSqueezeThroughEltwise : public ov::pass::MatcherPass#
#include <concat_reduce_fusion.hpp>

PullSqueezeThroughEltwise transformation propagates Squeeze up through binary elementwise operations:

class ConcatReduceFusion : public ov::pass::GraphRewrite#
#include <concat_reduce_fusion.hpp>

ConcatReduceFusion pass replaces the following graph:

          +---------------+            +---------------+
          │               │            |               |
          │     input     │            |     input     |
          │               │            |               |
          +---------------+            +----------------
                  |                            |
                  |                            |
                  \                            /
                   \                          /
                    \                        /
                     \                      /
                      \                    /
                       \                  /
                        \                /
                         \              /
                          \            /
                         +---------------+
                         |               |
                         |     Concat    |
                         |               |
                         +----------------
                                 |
                                 v
                         +---------------+
                         |               |
                         |   ReduceMin/  |
                         |   ReduceMax   |
                         +----------------
by a single Minimum/Maximum with 2 inputs and tries to eliminate Squeeze/Unsqueeze layers before and after Min/Max.

class ConcatToBroadcast : public ov::pass::MatcherPass#
#include <concat_to_broadcast.hpp>

ConcatToBroadcast transformation replaces Concat, having multiple inputs from the same output, with a Broadcast node.

class ConvToBinaryConv : public ov::pass::MatcherPass#
#include <conv_to_binary_conv.hpp>

This transformation converts Convolution to BinaryConvolution under following conditions:

  • first input to Convolution is a FakeQuantize with levels==2 with output low,high being either (0, 1) or (-1, 1)

  • second input (weights) is a constant with values -1 or 1 The transformation also converts weights to binary Constant (with ‘u1’ type) For example, when output_low is equal to 0 and output_high is equal to 1, following graph

     .... ....  out_low   out_high
       |    |      |         |
      +--------------------------+           +-------------------------------------+
      | FakeQuantize (levels==2) |           |               Constant              |
      |     (on activations)     |           | (weights containing -1 or 1 values) |
      +--------------------------+           +-------------------------------------+
                    |                                      |
                    |                                      |
                    -----------------    -------------------
                                    |    |
                                    v    v
                               +-------------+
                               | Convolution |
                               +-------------+
                                      |
                                      v
    
    is transformed to:
     .... ....  out_low   out_high
       |    |      |         |
      +--------------------------+           +---------------------------------+
      | FakeQuantize (levels==2) |           |     Constant (with u1 type)     |
      |     (on activations)     |           | (with u1 type - binary weights) |
      +--------------------------+           +---------------------------------+
                    |                                      |
                    |                                      |
                    -----------------    -------------------
                                    |    |
                                    v    v
                            +-------------------+
                            | BinaryConvolution |
                            +-------------------+
                                      |
                                      v
                               +------------+     +----------------------------------------------------+
                               |            |     |                   Constant                         |
                               |     Add    | <---|          (weights from original graph,             |
                               |            |     |  sum-reduced over [1,..., len(weights.shape)] axes |
                               +------------+     +----------------------------------------------------+
                                      |
                                      v
                               +------------+     +-----+
                               |  Multiply  | <---| 0.5 |
                               +------------+     +-----+
                                      |
                                      v
    

class ConvertNmsGatherPathToUnsigned : public ov::pass::GraphRewrite#
#include <convert_nms_gather_path_to_unsigned.hpp>

Converts Gather indices to unsigned if indices are from NMS selected indices output. NMS returns -1 for not selected boxes, old version of Gather fill corresponding output for such indices with zero. But new Gather-8 has support of negative indices indicating counting from the end. In order to keep such behaviour (until dynamism is not supported) instead of -1 new Gather-8 will accept UINT32_MAX which is always outside of the bounds and corresponding output for such indices in gather always will be filled with zeros.

class ConvertQuantizeDequantize : public ov::pass::MatcherPass#
#include <convert_quantize_dequantize.hpp>

ConvertQuantizeDequantize transformation replaces following graph: FakeQuantize->Convert->Convert->Subtract->Multiply with a single FakeQuantize. Restrictions:

  • quantized data type must be i8 or u8

  • ’levels’ attribute to FakeQuantize must be equal to 256

  • (output_low, output_high) must be (-128, 127) or (0, 256) (depends on sign of quantized data type)

  • ’zero_point’ and ‘scale’ must be broadcastable to FakeQuantize’s output

class ConvertU4WeightsZeroPointToScalar : public ov::pass::MatcherPass#
#include <convert_u4_weights_zero_point_to_scalar.hpp>

Converts U4 weights zero point to scalar if all values are equal.

class ConvolutionToGroupConvolutionFusion : public ov::pass::MatcherPass#
#include <convolution_to_group_convolution_fusion.hpp>

ConvolutionToGroupConvolutionFusion transformation replaces following graph: Split (or VariadicSplit) / \ Conv … Conv \ / \ / Concat.

to GroupConvolution

class DepthToSpaceFusion : public ov::pass::MatcherPass#
#include <depth_to_space_fusion.hpp>

DepthToSpaceFusion transformation detects Reshape-Transpose-Reshape pattern and tries to fuse it into a single DepthToSpace layer.

DepthToSpaceFusion transformation is optional and disabled by default. The transformation can be enabled with callback using setCallback method. See the example below.

Callback example:

// This callback enables DepthToSpaceFusion transformation
auto callback = [](const std::shared_ptr<const ov::Node> & node) -> bool {
    return std::dynamic_pointer_cast<const ov::opset3::DepthToSpace>(node) != nullptr;
};

auto p = ov::pass::DepthToSpaceFusion();
p.setCallback(callback);
p.run_on_function(f);

class DilatedConvolutionConverter : public ov::pass::MatcherPass#
#include <dilated_convolution_converter.hpp>

DilatedConvolutionConverter transformation replaces following graph: SpaceToBatch -> Convolution(GroupConvolution) -> BatchToSpace to a single Convolution(GroupConvolution) node with updated pads and dilations Restrictions:

  • pads in SpaceToBatch must have 0 on first and second position

class DisableRandomUniformConstantFolding : public ov::pass::MatcherPass#
#include <disable_random_uniform_constant_folding.hpp>

Disables ConstantFolding for RandomUniform operation. It is required as RandomUniform should generate new sequence each run.

class DivideFusion :