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 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::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 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 : public ov::pass::MatcherPass
#include <divide_fusion.hpp>

DivideFusion transformation replaces a sub-graph Pow(y, -1) * x or x * Pow(y, -1) with Divide(x,y)

class DropoutWithRandomUniformReplacer : public ov::pass::MatcherPass
#include <dropout_with_random_uniform_replacer.hpp>

This transformation replaces possible Dropout block (in inference mode) with RandomUniform to Broadcast of half-ones in a sub-graph.

Dropout block: RandomUniform ——-&#8212;> Add &#8212;> Floor /\ /\ /\ | | | Const(0) Const(1) Const(1) min_val max_val

Resulted block: Broadcast —-&#8212;> Add &#8212;> Floor /\ /\ | | Const(0.5) Const(1)

class EliminateUnsqueezeGather : public ov::pass::MatcherPass
#include <eliminate_unsqueeze_gather.hpp>

Remove Unsqueeze + Gather pair, if Gather gathers data by dimension that was previously added by Unsqueeze.

class EliminateGatherUnsqueeze : public ov::pass::MatcherPass
#include <eliminate_unsqueeze_gather.hpp>

Matches Gather ->[Binary Operation]-> Unsqueeze If axis for Gather and Unsqueeze is the same and Gather indices are scalar Unsqueeze is being removed and indices become 1D. Must be executed after SharedOpOptimization &#8212; It is possible to have multiple similar Unsqueeze operations after Gather, so they must be optimized beforehand.

class EnableShapeOfConstantFolding : public ov::pass::MatcherPass
#include <enable_shapeof_constant_folding.hpp>

This transformation enables constfoldability for ShapeOf nodes that was disabled by DisableShapeOfConstantFolding.

class FakeQuantizeMulFusion : public ov::pass::MatcherPass
#include <fq_mul_fusion.hpp>

This transformation looks for a FQ + Mul pair in the graph and moves the Mul operation above the FQ node. The last two inputs of FQ are multiplied by the value that was originally below the FQ node.

class FakeQuantizeReshapeFusion : public ov::pass::MatcherPass
#include <fq_reshape_fusion.hpp>

This transformation looks for a FQ + Reshape pair in the graph and moves the Reshape operation above the FQ node. Shapes of limit inputs are updated following FQ broadcasting semantics.

class RPE_Fusion : public ov::pass::MatcherPass
#include <fuse_rotary_positional_embeddings.hpp>

Fuses special sub-graph into an internal Rotary Positional Embedding operation.

class FusedNamesCleanup : public ov::pass::ModelPass
#include <fused_names_cleanup.hpp>

FusedNamesCleanup removes fused_names attribute.

class GeluFusionWithErfOne : public ov::pass::MatcherPass
#include <gelu_fusion.hpp>

GeluFusion transformation replaces a sub-graph (0.5 * x) * (1 + erf(x / sqrt(2))) with a Gelu op.

class GeluFusionWithErfTwo : public ov::pass::MatcherPass
#include <gelu_fusion.hpp>

GeluFusion transformation replaces a sub-graph 0.5 * (x * (1 + erf(x / sqrt(2)))) with a Gelu op.

class GeluFusionWithErfThree : public ov::pass::MatcherPass
#include <gelu_fusion.hpp>

GeluFusion transformation replaces a sub-graph x * (0.5 * (1 + erf(x / sqrt(2)))) with a Gelu op.

class GeluFusionWithErfFour : public ov::pass::MatcherPass
#include <gelu_fusion.hpp>

GeluFusion transformation replaces a sub-graph x * (0.5 + 0.5 * erf(x * (1 / sqrt(2)))) with a Gelu op.

class GeluFusionWithTanh : public ov::pass::MatcherPass
#include <gelu_fusion.hpp>

GeluFusion transformation replaces a sub-graph x * (0.5 * (1 + tanh([sqrt(2 / pi)] * [x + 0.044715^3]))) with a Gelu (Tanh) op.

class GeluFusionWithTanhNoPower : public ov::pass::MatcherPass
#include <gelu_fusion.hpp>

GeluFusion transformation replaces a sub-graph x * 0.5 * (1 + tanh((x * 0.044715 * x + 1) * x * sqrt(2 / pi))) with a Gelu (Tanh) op.

class GeluFusion : public ov::pass::GraphRewrite
#include <gelu_fusion.hpp>

GeluFusion transformation replaces various sub-graphs with a Gelu op.

class GRUCellFusion : public ov::pass::MatcherPass
#include <gru_cell_fusion.hpp>

GRUCellFusion transformation replaces a sequence of operations with GRUCell op.

If BiasAdds are not present in the pattern, then Constants with zero values will be created to match the specification.

Supported activations: Relu, Sigmoid, Tanh Clip attribute is not supported. Linear_before_reset attribute is not supported. Supported weights formats: zr, rz

class HSigmoidFusionWithReluDiv : public ov::pass::MatcherPass
#include <hsigmoid_fusion.hpp>

HSigmoidFusion transformation replaces a sub-graph ((min(Relu(x + 3), 6)) / 6) with a HSigmoid op.

class HSigmoidFusionWithReluMul : public ov::pass::MatcherPass
#include <hsigmoid_fusion.hpp>

HSigmoidFusion transformation replaces a sub-graph ((min(Relu(x + 3), 6)) * const(1/6)) with a HSigmoid op.

class HSigmoidFusionWithoutRelu : public ov::pass::MatcherPass
#include <hsigmoid_fusion.hpp>

HSigmoidFusion transformation replaces a sub-graph (min(max(x + 3, 0), 6) / 6) with a HSigmoid op.

class HSigmoidFusionWithClampMul : public ov::pass::MatcherPass
#include <hsigmoid_fusion.hpp>

HSigmoidFusion transformation replaces a sub-graph (Clamp(x + 3, 0, 6) * const(1/6)) with a HSigmoid op.

class HSigmoidFusionWithClampDiv : public ov::pass::MatcherPass
#include <hsigmoid_fusion.hpp>

HSigmoidFusion transformation replaces a sub-graph (Clamp(x + 3, 0, 6) * / 6) with a HSigmoid op.

class HSigmoidFusion : public ov::pass::GraphRewrite
#include <hsigmoid_fusion.hpp>

HSigmoidFusion transformation replaces various sub-graphs with a HSigmoid op.

class HSwishFusionWithReluDiv : public ov::pass::MatcherPass
#include <hswish_fusion.hpp>

HSwishFusion transformation replaces a sub-graph (x * (min(Relu(x + 3), 6))) / 6 with a HSwish op.

class HSwishFusionWithReluMul : public ov::pass::MatcherPass
#include <hswish_fusion.hpp>

HSwishFusion transformation replaces a sub-graph (x * (min(Relu(x + 3), 6)) * const(1/6) with a HSwish op.

class HSwishFusionWithHSigmoid : public ov::pass::MatcherPass
#include <hswish_fusion.hpp>

HSwishFusion transformation replaces a sub-graph x * HSigmoid(x) with a HSwish op.

class HSwishFusionWithClamp : public ov::pass::MatcherPass
#include <hswish_fusion.hpp>

HSwishFusion transformation replaces a sub-graph (Clamp(x + 3, 0, 6) * x) with a HSwish * 6.

class HSwishFusion : public ov::pass::GraphRewrite
#include <hswish_fusion.hpp>

HSwishFusion transformation replaces various sub-graphs with a HSwish op.

class InterpolateSequenceFusion : public ov::pass::MatcherPass
#include <interpolate_sequence_fusion.hpp>

InterpolateSequenceFusion transformation replaces a sequence of operations to Interpolate op.

class LeakyReluFusion : public ov::pass::MatcherPass
#include <leaky_relu_fusion.hpp>

LeakyReluFusion transformation replaces following graph: Multiply->Maximum to LeakyRelu.

class LinOpSequenceFusion : public ov::pass::GraphRewrite
#include <lin_op_sequence_fusion.hpp>

LinOpSequenceFusion transformation fuses linear operation sequence.

class LSTMCellFusion : public ov::pass::MatcherPass
#include <lstm_cell_fusion.hpp>

LSTMCellFusion transformation replaces a sequence of operations with LSTMCell op.

class MarkPrecisionSensitiveShapeOfSubgraphs : public ov::pass::ModelPass
#include <mark_precision_sensitive_shapeof_subgraphs.hpp>

MarkPrecisionSensitiveShapeOfSubgraphs marks entirely all shape subgraphs starting from precision-sensitive inputs and ending at the ShapeOf node as disabled for FP16 compression.

Subclassed by ov::pass::MarkDividesInShapeSubgraphs, ov::pass::MarkPrecisionSensitiveConstants, ov::pass::MarkShapeOfSubgraphs

class MarkShapeOfSubgraphs : public ov::pass::MarkPrecisionSensitiveShapeOfSubgraphs
#include <mark_precision_sensitive_shapeof_subgraphs.hpp>

MarkShapeOfSubgraphs marks shape subgraphs. Information whether the node belongs to the shape path or to the data path is needed during evaluate and CF.

class MarkPrecisionSensitiveConstants : public ov::pass::MarkPrecisionSensitiveShapeOfSubgraphs
#include <mark_precision_sensitive_shapeof_subgraphs.hpp>

MarkPrecisionSensitiveConstants marks the constants inside of all shape subgraphs starting from precision-sensitive inputs and ending at the ShapeOf node as disabled for FP16 compression.

class MarkDividesInShapeSubgraphs : public ov::pass::MarkPrecisionSensitiveShapeOfSubgraphs
#include <mark_precision_sensitive_shapeof_subgraphs.hpp>

MarkDividesInShapeSubgraphs marks the Divide layers inside of all shape subgraphs starting from precision-sensitive input and ending at the ShapeOf node as disabled for ConvertDivide transformation.

class MatMulMultiplyFusion : public ov::pass::MatcherPass
#include <matmul_multiply_fusion.hpp>

MatMulMultiplyFusion transformation matches following graph:

    +----------+            +----------+
    |    A     |            |    B     |
    +----------+            +----------+
         |                       |
         -----------    ----------
                   |    |
                   v    v
                 +--------+
                 | MatMul |
                 +--------+
                     |
                     v
                +----------+     +----------+
                | Multiply |<----| Constant |
                +----------+     +----------+

and replaces with:

                      +-------+   +----------+
                      |   B   |   | Constant |
                      +-------+   +----------+
                           |            |
                           ------  ------
                                |  |
                                v  v
    +----------+            +----------+
    |    A     |            | Multiply |
    +----------+            +----------+
         |                       |
         -----------    ----------
                   |    |
                   v    v
                 +--------+
                 | MatMul |
                 +--------+

class MishFusion : public ov::pass::MatcherPass
#include <mish_fusion.hpp>

MishFusion transformation replaces group of operations: x * tanh(log(exp(x) + 1)) to Mish op.

class MultiplyConvolutionFusion : public ov::pass::MatcherPass
#include <mul_conv_fusion.hpp>

Multiply->Convolution fusion replaces following graph:

+—-&#8212;+ +——-&#8212;+ | Input

| | Constant | +—-&#8212;+ +——-&#8212;+ | |

| | v v +——-

&#8212;+ +——&#8212;+ | Multiply | | Weights | +——-&#8212;+ +——&#8212;+ | |

| | v v +————-

&#8212;+ | Convolution Op | +————-&#8212;+

to following:

                      +---------+   +----------+
                      | Weights |   | Constant |
                      +---------+   +----------+
                           |            |
                           ------  ------
                                |  |
                                v  v
     +-------+              +----------+
     | Input |              | Multiply |
     +-------+              +----------+
         |                       |
         -----------    ----------
                   |    |
                   v    v
              +----------------+
              | Convolution Op |
              +----------------+
where ‘Convolution Op’ is one of:
  • Convolution

  • ConvolutionBackpropData

  • GroupConvolution

  • GroupConvolutionBackpropData

Restrictions:

  • weights’ shape is static

  • if the constant input to Multiply has the same rank as ‘input’, the constant first dimension has to be 1

  • constant input to Multiply has to be broadcastable to weights when ‘Convolution Op’ is either Convolution or GroupConvolution

  • shape of a constant input to Multiply has to be in one of following forms: (1), (1, 1, …, 1), (C, 1, …, 1), (1, C, 1, …, 1) when ‘Convolution Op’ is either ConvolutionBackpropData or GroupConvolutionBackpropData

class MulFakeQuantizeFusion : public ov::pass::MatcherPass
#include <mul_fake_quantize_fusion.hpp>

MulFakeQuantizeFusion transformation replaces following graph: Mul->FakeQuantize to a single FakeQuantize Restrictions:

  • second input to Mul is a Constant

class MVNFusionWithoutConstants : public ov::pass::MatcherPass
#include <mvn_fusion.hpp>

MVNFusion transformation replaces group of operations: (x - ReduceMean(x, axes)) / (Sqrt(ReduceMean((x - ReduceMean(x, axes)) ^ 2)) + eps) to MVN op.

class MVNFusionWithConstantsInside : public ov::pass::MatcherPass
#include <mvn_fusion.hpp>

MVNFusion transformation replaces group of operations: gamma * (x - ReduceMean(x, axes)) / (Sqrt(ReduceMean((x - ReduceMean(x, axes)) ^ 2)) + eps) + beta to MVN op.

class MVNFusion : public ov::pass::GraphRewrite
#include <mvn_fusion.hpp>

MVNFusion transformation replaces various sub-graphs with a MVN op.

class NearestNeighborUpsamplingFusion : public ov::pass::MatcherPass
#include <nearest_neighbor_upsampling_fusion.hpp>

NearestNeighborUpsamplingFusion transformation fuses subgraph that uses the simpler operations, as ShapeOf, StridedSlice, Concat, Reshape, Mul to calculate Interpolate with mode=’nearest’.

class NonZeroHorizontalFusion : public ov::pass::MatcherPass
#include <nonzero_horizontal_fusion.hpp>

NonZeroHorizontalFusion transformation makes horizontal fusion for equal NonZero layers.

class EliminatePad : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminatePad eliminates pad that does nothing.

class EliminateConvert : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateConvert eliminates convert that does nothing.

class EliminateConvertNonZero : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateConvertNonZero eliminates convert before NonZero.

class EliminateConcat : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateConcat eliminates concat that does nothing.

class EliminateSplit : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateSplit eliminates split that does nothing.

class EliminateSqueeze : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateSqueeze eliminates squeeze that does nothing.

class EliminateTranspose : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateTranspose eliminates transpose that does nothing.

class EliminateEltwise : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateEltwise eliminates eltwise ops that do nothing.

class EliminateScatterUpdate : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateScatterUpdate eliminates scatter ops that do nothing (updates/indices are empty)

class EliminateSplitConcat : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateSplit eliminates split+concat pairs which do nothing.

class EliminateNopBroadcast : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

EliminateNopBroadcast eliminates broadcast or tile with all ones on the second input.

class NopSliceBeforeGatherElements : public ov::pass::MatcherPass
#include <nop_elimination.hpp>

NopSliceBeforeGatherElements eliminates slice before GElements if slicing from 0 It is valid since GatherElements doesn’t support negative indices and Slice won’t affect indexing of elements in the original tensor that GatherElements would like to take.

class NormalizeL2Fusion : public ov::pass::MatcherPass
#include <normalize_l2_fusion.hpp>

NormalizeL2Fusion transformation replaces sub-graphs: x/(sqrt(max(reduce_sum(x[j0, …, jN]**2, axes), eps)) x/(sqrt(add(reduce_sum(x[j0, …, jN]**2, axes), eps)) x/(pow(max(reduce_sum(x[j0, …, jN]**2, axes), eps), 0.5) x/(pow(add(reduce_sum(x[j0, …, jN]**2, axes), eps), 0.5) x*(pow(max(reduce_sum(x[j0, …, jN]**2, axes), eps), -0.5) x*(pow(add(reduce_sum(x[j0, …, jN]**2, axes), eps), -0.5) with a NormalizeL2(x, axes, eps, eps_mode[MAX|ADD]) op.

class UselessSliceEraser : public ov::pass::ModelPass
#include <optimize_strided_slice.hpp>

UselessSliceEraser transformation removes Slice/StridedSlice operations with equal input and output shapes.

class GroupedStridedSliceOptimizer : public ov::pass::ModelPass
#include <optimize_strided_slice.hpp>

GroupedStridedSliceOptimizer transformation replaces group of StridedSlice operations with VariadicSplit. All StridedSlice operations must slice data with the same axis and stride = 1.

class GroupedSliceToVSplitOptimization : public ov::pass::ModelPass
#include <optimize_strided_slice.hpp>

GroupedSliceToVSplitOptimization transformation replaces group of Slice operations with VariadicSplit. All Slice operations must slice data with the same axis and step = 1.

class StridedSliceOptimization : public ov::pass::ModelPass
#include <optimize_strided_slice.hpp>

StridedSliceOptimization transformation executes all transformations related to StridedSlice optimizations.

class PadFusionAvgPool : public ov::pass::MatcherPass
#include <pad_fusion.hpp>

PadFusion transformation replaces following graph: Pad -> AvgPool to AvgPool, under following conditions.

  • pad mode is op::PadMode::CONSTANT

  • pad value is 0

  • exclude_pad in AvgPool is set to false or pads_begin, pads_end are set to zero

class PadFusionConvolution : public ov::pass::MatcherPass
#include <pad_fusion.hpp>

PadFusion transformation replaces following graph: Pad -> Convolution to Convolution, under following conditions.

class PadFusionConvolutionBackpropData : public ov::pass::MatcherPass
#include <pad_fusion.hpp>

PadFusion transformation replaces following graph: Pad -> ConvolutionBackpropData to ConvolutionBackpropData, under following conditions.

  • pad mode is op::PadMode::CONSTANT

  • pad value is 0

  • pads in ConvolutionBackpropData are greater than pads in Pad node

class PadFusionGroupConvolution : public ov::pass::MatcherPass
#include <pad_fusion.hpp>

PadFusion transformation replaces following graph: Pad -> GroupConvolution to GroupConvolution, under following conditions.

class PadFusionGroupConvolutionBackpropData : public ov::pass::MatcherPass
#include <pad_fusion.hpp>

PadFusion transformation replaces following graph: Pad -> GroupConvolutionBackpropData to GroupConvolutionBackpropData, under following conditions.

  • pad mode is op::PadMode::CONSTANT

  • pad value is 0

  • pads in GroupConvolutionBackpropData are greater than pads in Pad node

class PReluFusionNegativeAdd : public ov::pass::MatcherPass
#include <prelu_fusion.hpp>

PReluFusionNegativeAdd transformation replaces a sub-graph Op / \ Relu Negative | | | Relu | | | Negative | | | Multiply \ / Add.

class PReluFusionNegativeSub : public ov::pass::MatcherPass
#include <prelu_fusion.hpp>

PReluFusionNegativeSub transformation replaces a sub-graph Op / \ Relu Negative | | | Relu | | | Multiply \ / Sub.

class PReluFusionMultiplyAdd : public ov::pass::MatcherPass
#include <prelu_fusion.hpp>

PReluFusionMultiplyAdd transformation replaces a sub-graph Op / \ Relu Multiply (-1) | | | Relu | | | Multiply \ / Add.

class PReluFusionMultiplySub : public ov::pass::MatcherPass
#include <prelu_fusion.hpp>

PReluFusionMultiplySub transformation replaces a sub-graph Op / \ Relu Multiply (-1) | | | Relu | | | Multiply \ / Sub.

class PReluFusionAbsSubMulMulAdd : public ov::pass::MatcherPass
#include <prelu_fusion.hpp>

PReluFusionAbsSubMulMulAdd transformation replaces a sub-graph Op / | \ Relu | Abs | \ | | Subtract | | | Multiply | | | Multiply (0.5) \ / Add.

class PReluFusionNegReluMulAdd : public ov::pass::MatcherPass
#include <prelu_fusion.hpp>

PReluFusionNegReluMulAdd transformation replaces a sub-graph Op / \ Relu Negative | | | Relu | | | Multiply \ / Add.

class PReluFusion : public ov::pass::GraphRewrite
#include <prelu_fusion.hpp>

PReluFusion transformation replaces various sub-graphs with a PRelu op.

class PullUnsqueezeThroughReduce : public ov::pass::MatcherPass
#include <pull_through_reduce.hpp>

PullUnsqueezeThroughReduce transformation The transformation pulls Unsqueeze operator though Reduce ops if possible. In the further processing such Unsqueeze can be often skipped as nop.

class PullReshapeThroughReduce : public ov::pass::MatcherPass
#include <pull_through_reduce.hpp>

PullReshapeThroughReduce transformation The transformation pulls Reshape operator though Reduce ops if possible. In the further processing such Reshape can be often skipped as nop.

class PullThroughReduce : public ov::pass::GraphRewrite
#include <pull_through_reduce.hpp>

PullThroughReduce transformation The transformation pulls Reshape or Unsqueeze operators though Reduce ops if possible. In the further processing such Reshape/Unsqueeze can be often skipped as nop.

class PushConstantToSubgraph : public ov::pass::ModelPass
#include <push_constant_to_subgraph.hpp>

PushConstantToSubgraph transformation detects MultiSubGraphOp inputs that can be constfoldable pushes that inputs to subgraphs.

class RandomUniformFusion : public ov::pass::MatcherPass
#include <random_uniform_fusion.hpp>

RandomUniformFusion transformation replaces RandomUniform -> Add or RandomUniform -> Mul subgraph with a RandomUniform and replaces min and max const with corrected values.

class ReduceMerge : public ov::pass::MatcherPass
#include <reduce_merge.hpp>

ReduceMerge transformation matches following graph:

+——-&#8212;+ +——-&#8212;+ | A | | B | +——-&#8212;+ +——-&#8212;+ | |

| | v v +—–

&#8212;+ +—–&#8212;+ | Reduce | | C | +—–&#8212;+ +—–&#8212;+ | | | —-&#8212; | | v v +——-&#8212;+ | Reduce | +——-&#8212;+

and replaces with:

      +----------+     +----------+
      |    B     |     |    C     |
      +----------+     +----------+
           |                |
           -------    -------
                 |    |
                 v    v
+——-&#8212;+ +—————-&#8212;+ | A | | Concat/Constant | +——-&#8212;+ +—————-&#8212;+ | | | —–&#8212; | | v v +——-&#8212;+ | Reduce | +——-&#8212;+

class ReduceReshapeFusion : public ov::pass::MatcherPass
#include <reduce_reshape_fusion.hpp>

ReduceReshapeFusion transformation Fuse ReduceOp(keep_dims=false)+Reshape to ReduceOp(keep_dims=true)

class ReluFakeQuantizeFusion : public ov::pass::MatcherPass
#include <relu_fake_quantize_fusion.hpp>

ReluFakeQuantizeFusion transformation replaces following graph: Relu -> FakeQuantize to FakeQuantize under following conditions:

  • ‘input_low’ input to FakeQuantize is a Constant

  • ’input_low’ has non negative values

class RemoveConcatZeroDimInput : public ov::pass::MatcherPass
#include <remove_concat_zero_dim_input.hpp>

RemoveConcatZeroDimInput transformation removes input of Concat if the tensor size is equal to 0.

class ReshapePRelu : public ov::pass::MatcherPass
#include <reshape_prelu.hpp>

ReshapePRelu reshape second input of PRelu (slope)

class ReshapeSequenceFusion : public ov::pass::MatcherPass
#include <reshape_sequence_fusion.hpp>

ReshapeSequenceFusion fuses sequence of Reshape operation into single Reshape or eliminates full redundant sequence.

class ReverseInputChannelsFusion : public ov::pass::ModelPass
#include <ric_fusion.hpp>

ReverseInputChannelsFusion.

class SelectWithOneValueCondition : public ov::pass::MatcherPass
#include <select_with_one_value_condition.hpp>

SelectWithOneValueCondition transformation eliminates Select operation if the condition is constant and consists of al True or False elements.

class SequenceFusion : public ov::pass::MatcherPass
#include <sequence_fusion.hpp>

SequenceFusion transformation replaces a chain of Cells operations with single Sequence op.

Supported cells: GRUCell, LSTMCell, RNNCell, AUGRUCell Prerequisites: the source of W,R,B inputs must be the same or it can be different Constants with the same type, shape and value.

class SharedOpOptimization : public ov::pass::ModelPass
#include <shared_ops_optimization.hpp>

SharedOpOptimization optimizes operations which are sourcing from same Output<Node> and perform the same action on the same data.

class ShuffleChannelsFusion : public ov::pass::MatcherPass
#include <shuffle_channels_fusion.hpp>

ShuffleChannelsFusion transformation detects Reshape-Transpose-Reshape pattern and tries to fuse it into a single ShuffleChannels layer with axis = 1.

x’ = reshape(x, [N, group, C / group, H, W]) or reshape(x, [N, group, C / group, H * W]) x’’ = transpose(x’, [0, 2, 1, 3, 4]) or transpose(x’, [0, 2, 1, 3]) y = reshape(x’’, [N, C, H, W])

Param reshape_constants_check:

the flag that defines the need for additional checks of reshapes constant Additional checks are required when ShuffleChannelsFusion using inside offline transformations and are not necessary when ShuffleChannelsFusion using inside CommonOptimizations

class GroupedGatherElimination : public ov::pass::MatcherPass
#include <simplify_shape_of_sub_graph.hpp>

GroupedGatherElimination transformation replaces group of Gather operations with the first Gather in this group and updated indices input in case all Gathers in the group are consumed by the same Concat in incremental order.

class GatherNopElimination : public ov::pass::MatcherPass
#include <simplify_shape_of_sub_graph.hpp>

GatherNopElimination transformation optimizes out useless Gather operations.

class SkipGatherBeforeTransposeAndReshape : public ov::pass::MatcherPass
#include <skip_gather_before_transpose_and_reshape.hpp>

SkipGatherBeforeTransposeAndReshape transformation removes Gather from the Gather->Transpose->Reshape sequence in case when input has batch=1 and gather has axis=0 and indices={0}. Also, this transformation corrects a transpose constant to save semantic.

class SoftmaxFusion : public ov::pass::MatcherPass
#include <softmax_fusion.hpp>

SoftmaxFusion transformation replaces following graphs:

       +---------------+
       │               │
       │     input     │
       │               │
       +---------------+
           │      │
           │      v
           │ +-----------+
           │ │           │
           │ │ ReduceMax │
           │ │           │
           │ +-----------+
           │      │
           │      │
           v      v
       +---------------+
       │               │
       │      Sub      │
       │               │
       +---------------+
               |
               |
               v
       +---------------+
       │               │
       │      Exp      │
       │               │
       +---------------+
           │      │
           │      v
           │ +-----------+
           │ │           │
           │ │ ReduceSum │
           │ │           │
           │ +-----------+
           │      │
           │      │
           v      v
        +-------------+
        |             │
        |     Div     │
        │             │
        +-------------+
and +————&#8212;+ │ │ │ input │ │ │ +————&#8212;+

v +————&#8212;+ │ │ │ Exp │ │ │ +————&#8212;+ │ │ │ v │ +——–&#8212;+ │ │ │ │ │ ReduceSum │ │ │ │ │ +——–&#8212;+ │ │ │ │ v v +———-&#8212;+ | │ | Div │ │ │ +———-&#8212;+

to a single Softmax node

  • Restrictions:

    • ReduceMax and ReduceSum axes must be scalar constants and they have to point to the same axis

class SoftPlusFusion : public ov::pass::MatcherPass
#include <softplus_fusion.hpp>

SoftPlusFusion transformation replaces group of operations: log(exp(x) + 1) to SoftPlus op.

class SoftPlusToMishFusion : public ov::pass::MatcherPass
#include <softplus_to_mish_fusion.hpp>

SoftPlusToMishFusion transformation replaces group of operations: x * tanh(softplus(x)) to Mish op.

class SpaceToBatchFusion : public ov::pass::MatcherPass
#include <space_to_batch_fusion.hpp>

SpaceToBatchFusion transformation replaces following graph: Transpose (or Reshape) -> Pad -> SpaceToDepth -> Transpose (or Reshape) to SpaceToBatch Restrictions:

  • input rank must be 4

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

  • pad value is 0, PadMode is CONSTANT

  • SpaceToDepthMode must be BLOCKS_FIRST

class SplitConcatPairToInterpolateFusion : public ov::pass::MatcherPass
#include <split_concat_pair_to_interpolate_fusion.hpp>

SplitConcatPairToInterpolateFusion transformation replaces group of operations: Split -> Concat to Interpolate op.

class SplitSqueezeConcatFusion : public ov::pass::MatcherPass
#include <split_squeeze_concat_fusion.hpp>

SplitSqueezeConcatFusion transformation replaces group of operations: Split -> Squeeze (multiple) -> Concat to Transpose -> Reshape ops.

class ConvStridesPropagation : public ov::pass::MatcherPass
#include <strides_optimization.hpp>

ConvStridesPropagation either propagates stride (greater than 1) from Convolution up through the graph or inserts pooling between current node and its consumers if the consumers have different StridesProp attributes. Strides can be propagated if Convolution kernel is {1, 1, …}.

class SupportedNodesStridesPropagation : public ov::pass::MatcherPass
#include <strides_optimization.hpp>

SupportedNodesStridesPropagation either propagates stride (greater than 1) from current node up through the graph or inserts pooling between current node and its consumers if the consumers have different StridesProp attributes.

class UnsupportedNodesStridesPropagation : public ov::pass::MatcherPass
#include <strides_optimization.hpp>

UnsupportedNodesStridesPropagation inserts pooling between current node and its consumers if the consumers have different StridesProp attributes.

class StridesOptimization : public ov::pass::BackwardGraphRewrite
#include <strides_optimization.hpp>

StridesOptimization transformation works backward on function and propagates strides up through the graph if possible.

class SubtractFusion : public ov::pass::MatcherPass
#include <subtract_fusion.hpp>

SubtractFusion transformation replaces a sub-graph Mul(y, -1) + x or x + Mul(y, -1) with Subtract(x,y)

class SwishFusionWithSigmoid : public ov::pass::MatcherPass
#include <swish_fusion.hpp>

SwishFusionWithSigmoid replaces a sub-graphs x * Sigmoid(x) with a Swish op.

class SwishFusionWithSigmoidWithBeta : public ov::pass::MatcherPass
#include <swish_fusion.hpp>

SwishFusionWithSigmoid replaces a sub-graphs x * Sigmoid(x * beta) with a Swish op.

class SwishFusionWithBeta : public ov::pass::MatcherPass
#include <swish_fusion.hpp>

SwishFusionWithSigmoid replaces a sub-graphs x / (1.0 + exp(-x * beta)) with a Swish op.

class SwishFusionWithoutBeta : public ov::pass::MatcherPass
#include <swish_fusion.hpp>

SwishFusionWithSigmoid replaces a sub-graphs x / (1.0 + exp(-x)) with a Swish op.

class SwishFusion : public ov::pass::GraphRewrite
#include <swish_fusion.hpp>

SwishFusion transformation replaces various sub-graphs with a Swish op.

class TransposeReshapeEliminationForMatmul : public ov::pass::MatcherPass
#include <transpose_reshape_elimination_for_matmul.hpp>

TransposeReshapeEliminationForMatmul transformation eliminates Transpose and Reshape which were created to align input and output dimension ranks before second MatMul input and after MatMul output (for example, after Einsum Decomposition inside TensorFlow 1 and OpenVINO EinsumDecomposition transformation)

class TransposeReduction : public ov::pass::MatcherPass
#include <transpose_sinking.hpp>

TransposeReduction transformation sinks Transpose through Reduce operations.

class TransposeFQReduction : public ov::pass::MatcherPass
#include <transpose_sinking.hpp>

TransposeFQReduction transformation sinks Transpose through FakeQuantize in case it is followed by reduction or squeeze.

class TransposeConvert : public ov::pass::MatcherPass
#include <transpose_sinking.hpp>

TransposeConvert transformation sinks Transpose through Convert.

class TransposeEltwise : public ov::pass::MatcherPass
#include <transpose_sinking.hpp>

TransposeEltwise transformation sinks Transpose through Eltwise.

class TransposeFuse : public ov::pass::MatcherPass
#include <transpose_sinking.hpp>

TransposeFuse transformation eliminates 2 consequtive Transposes if they result in no changes to input or fuses them to single Transpose if input gets changed.

class TransposeSinking : public ov::pass::GraphRewrite
#include <transpose_sinking.hpp>

TransposeSinking transformation sinks Transposes through known operations.

class TransposeToReshape : public ov::pass::MatcherPass
#include <transpose_to_reshape.hpp>

TransposeToReshape transformation replaces suitable Transposes with Reshape operation or optimizes them out.

class WeightsDequantizeToFakeQuantize : public ov::pass::MatcherPass
#include <weights_dequantize_to_fake_quantize.hpp>

WeightsDequantizeToFakeQuantize transformation replaces Constant (i8) -> Convert (to fp) -> Subtract (zp) -> Multiply (scale) -> with Constant (i8) -> Convert (to fp) -> FakeQuantize -> deducing levels and FakeQuantize limits according to actual values in the weights Constant.

class WrapInterpolateIntoTransposes : public ov::pass::MatcherPass
#include <wrap_interpolate_into_transposes.hpp>

WrapInterpolateIntoTransposes transformation replaces Interpolate with Transpose -> Interpolate -> Transpose when 1) the source Interpolate has the static input rank; 2) ‘axes’ input is a Constant; 3) number of axes is equal to input rank minus 2; 4) axes contain 0 or 1. The reason of this transformation is that now CPU plugin supports interpolation only with respect to spatial dimensions, but TensorFlow frontend gives Interpolate with axes {1, 2} for 4D tensors.

class UnrollIf : public ov::pass::ModelPass
#include <unroll_if.hpp>

The transformation replaces ‘If’ operations with one of the internal functions (bodies) if the provided condition is constant. The condition is true: ‘If’ op is replaced with then_body The condition is false ‘If’ op is replaced with else_body.

class UnrollTensorIterator : public ov::pass::ModelPass
#include <unroll_tensor_iterator.hpp>

Unrolls the body of the TensorIterator layer. Multiple body copies, the number of which is determined by the number of iterations of the TensorIterator layer, are created and connected to each other and to the external network. If the number of TensorIterator iterations is greater than 1, then additional Concat and Split layers are added to the network.

struct EnumClassHash#
#include <convert_precision.hpp>

ConvertPrecision transformation convert precision for entire ov::Model List of supported precision conversion: FROM -> TO u8 -> i32 u16 -> i32 u32 -> i32 u64 -> i32 i64 -> i32 f16 -> f32 bool -> u8 bool -> i32.

For all operations from opset1-opset4 this conversions can be applied without adding Conversion operations. That is possible because all operations that produces “FROM” type can produce “TO” type. And for this operations we have created special fuse_type_into_<type> function (can be found in cpp file) that performs type fusion into operation. m_additional_type_to_fuse_map allows to rewrite existing type convertors.

List of operations that are supported by this transformations for i64 -> i32 conversion: opset4::Parameter opset4::Convert opset4::ShapeOf opset4::Range opset3::NonMaxSuppression opset4::NonMaxSuppression opset4::TopK opset4::NonZero opset4::Bucketize

List of operations that are supported by this transformations for bool -> u8 conversion: LogicalAnd LogicalNot LogicalOr LogicalXor ReduceLogicalAnd ReduceLogicalOr Equal NotEqual Greater GreaterEqual Less LessEqual

class AlignMixedFP32FP16Types : public ov::pass::ModelPass
#include <align_mixed_fp32_fp16_types.hpp>

AlignMixedFP32FP16Types adds Converts to keep mixed FP16/FP32 graph type consistent.

class ConvertCompressedOnlyToLegacy : public ov::pass::ModelPass
#include <convert_compression_only_to_legacy.hpp>

ConvertCompressedOnlyToLegacy transformation converts compression only FP16 format to legacy FP16 format.

class EnableDecompressionConvertConstantFolding : public ov::pass::MatcherPass
#include <mark_decompression_convert_constant_folding.hpp>

Enables ConstantFolding for Convert operation in compressed function.

class DisableDecompressionConvertConstantFolding : public ov::pass::MatcherPass
#include <mark_decompression_convert_constant_folding.hpp>

Disables ConstantFolding for Convert operation in compressed function.

class KeepConstAndDecompression : public ov::pass::MatcherPass
#include <mark_decompression_convert_constant_folding.hpp>

Disables ConstantFolding for Convert operation and prevents conversion of f16 Consts to f32.

class KeepConstantsPrecisionAndAddConverts : public ov::pass::MatcherPass
#include <mark_decompression_convert_constant_folding.hpp>

Prevents Consts precision conversion and adds Convert with disabled ConstantFolding.

class MarkCompressedFloatConstants : public ov::pass::MatcherPass
#include <mark_decompression_convert_constant_folding.hpp>

Prevents ConstantFolding for f16/bf16 Const + Convert_To_FP32 to keep original FW float Constants. Original precision should be kept as long as possible, this prevents redundant conversions and saves memory. E.g. if original FW model was already compressed no need to upcast during CF, store intermediate f32 consts and then again compress them to f16 during save_model.

class InitNodeInfo : public ov::pass::ModelPass
#include <init_node_info.hpp>

InitNodeInfo transformation helps to set runtime info attributes in a single place.

Every runtime info attribute that needs to be initialized should be registered in run_on_function method. Also do not forget to override init methods for registered attribute. This transformations should be called first in transformation pipeline. If attribute was already set initialization will be skipped for this node.

class MarkDequantizationSubgraph : public ov::pass::MatcherPass
#include <mark_dequantization_subgraph.hpp>

MarkDequantizationSubgraph marks dequantization subgraph, that is: Convert->Subtract(optional)->Multiply in two ways:

class BidirectionalLSTMSequenceDecomposition : public ov::pass::MatcherPass
#include <bidirectional_sequences_decomposition.hpp>

Decompose LSTMSequence to forward and reverse LSTMSequence.

class BidirectionalGRUSequenceDecomposition : public ov::pass::MatcherPass
#include <bidirectional_sequences_decomposition.hpp>

Decompose GRUSequence to forward and reverse GRUSequence.

class BidirectionalRNNSequenceDecomposition : public ov::pass::MatcherPass
#include <bidirectional_sequences_decomposition.hpp>

Decompose RNNSequence to forward and reverse RNNSequence.

class BidirectionalSequenceDecomposition : public ov::pass::GraphRewrite
#include <bidirectional_sequences_decomposition.hpp>

Container for all types of sequences decomposition.

class ConvertBatchToSpace : public ov::pass::MatcherPass
#include <convert_batch_to_space.hpp>

ConvertBatchToSpace transformation decomposes BatchToSpace layer to Reshape->Transpose->Reshape->Crop.

Param convert_by_elements:

- reduces the maximum number of dimensions that arise during the transformation if enabled. Default value: true. false - BatchToSpace decomposes to Reshape->Transpose->Reshape->Crop. During transformation, the number of tensor dimensions can be increased by length of block_shape input of BatchToSpace layer. true - BatchToSpace decomposes to N x (Reshape->Transpose->Reshape)->Crop, where N = length of block_shape input of BatchToSpace layer. During transformation, the number of tensor dimensions can be increased by 1.

class ConvertBitwiseToLogical : public ov::pass::GraphRewrite
#include <convert_bitwise_to_logical_bool.hpp>

Converts Bitwise operators to Logical for boolean datatype for plugins that don’t support opset13 Bitwise and to allow for constant folding for bool.

class ConvertDeformableConv8To1 : public ov::pass::MatcherPass
#include <convert_deformable_conv_v8_to_v1.hpp>

ConvertDeformableConv8To1 converts v8::DeformableConvolution into v1::DeformableConvolution.

class ConvertGather0D : public ov::pass::MatcherPass
#include <convert_gather_0d.hpp>

ConvertGather0D decomposes v1::Gather operation into v0::Unsqueeze + v1::Gather + v0::Squeeze pattern when gather indices is scalar.

class ConvertGather7ToGather1 : public ov::pass::MatcherPass
#include <convert_gather_downgrade.hpp>

ConvertGather7ToGather1 converts v7::Gather into v1::Gather.

class ConvertGather8ToGather7 : public ov::pass::MatcherPass
#include <convert_gather_downgrade.hpp>

ConvertGather8ToGather7 converts v8::Gather into v7::Gather.

class ConvertGather1ToGather7 : public ov::pass::MatcherPass
#include <convert_gather_upgrade.hpp>

ConvertGather1ToGather7 converts v1::Gather into v7::Gather.

class ConvertGather7ToGather8 : public ov::pass::MatcherPass
#include <convert_gather_upgrade.hpp>

ConvertGather7ToGather8 converts v7::Gather into v8::Gather.

class ConvertInterpolate11ToInterpolate4 : public ov::pass::MatcherPass
#include <convert_interpolate11_downgrade.hpp>

Converts Interpolate version 11 to Interpolate version 4 if the new op uses any of the v4 allowed interpolation modes.

class ConvertInterpolate1ToInterpolate4 : public ov::pass::MatcherPass
#include <convert_interpolate1_to_interpolate4.hpp>

ConvertInterpolate1ToInterpolate4 covert v0:interpolate into v4::Interpolate.

class ConvertMaxPool8ToMaxPool1 : public ov::pass::MatcherPass
#include <convert_maxpool_downgrade.hpp>

ConvertMaxPool8ToMaxPool1 converts v8::MaxPool into v1::MaxPool.

class ConvertMaxPool1ToMaxPool8 : public ov::pass::MatcherPass
#include <convert_maxpool_upgrade.hpp>

ConvertMaxPool1ToMaxPool8 converts v1::MaxPool into v8::MaxPool.

class ConvertMVN1ToMVN6 : public ov::pass::MatcherPass
#include <convert_mvn1_to_mvn6.hpp>

ConvertMVN1ToMVN6 covert v0:MVN into v6::MVN.

class ConvertPad12ToPad1 : public ov::pass::MatcherPass
#include <convert_pad12_downgrade.hpp>

Converts Pad v12 to Pad v1.

class ConvertPadToGroupConvolution : public ov::pass::MatcherPass
#include <convert_pad_to_group_conv.hpp>

ConvertPadToGroupConvolution transformation replaces Pad operation with GroupConvolution but has some restrictions on Pad parameters:

  1. PadMode must be Constant and value is equal to 0

  2. Padding must be applied only for spatial dimensions

  3. Input shape rank must be static and greater than 3

  4. Padding values must be non-negative

class ConvertPriorBox8To0 : public ov::pass::MatcherPass
#include <convert_prior_box_v8_to_v0.hpp>

ConvertPriorBox8To1 converts v8::PriorBox into v0::PriorBox.

class ConvertROIAlign3To9 : public ov::pass::MatcherPass
#include <convert_roi_align_v3_to_v9.hpp>

ConvertROIAlign3To9 converts v3::ROIAlign into v9::ROIAlign.

class ConvertROIAlign9To3 : public ov::pass::MatcherPass
#include <convert_roi_align_v9_to_v3.hpp>

ConvertROIAlign9To3 converts v9::ROIAlign into v3::ROIAlign.

class ConvertScatterElementsToScatter : public ov::pass::MatcherPass
#include <convert_scatter_elements_to_scatter.hpp>

ConvertScatterElementsToScatter convert opset3::ScatterElementsUpdate to opset3::ScatterUpdate.

class ConvertScatterElementsUpdate12ToScatterElementsUpdate3 : public ov::pass::MatcherPass
#include <convert_scatter_elements_update12_downgrade.hpp>

Converts Pad v12 to Pad v1.

class ConvertRNNSequenceToTensorIterator : public ov::pass::MatcherPass
#include <convert_sequences_to_tensor_iterator.hpp>

ConvertRNNSequenceToTensorIterator transformation converts RNNSequence layer to TensorIterator *.

class ConvertGRUSequenceToTensorIterator : public ov::pass::MatcherPass
#include <convert_sequences_to_tensor_iterator.hpp>

ConvertGRUSequenceToTensorIterator transformation converts GRUSequence layer to TensorIterator *.

class ConvertLSTMSequenceToTensorIterator : public ov::pass::MatcherPass
#include <convert_sequences_to_tensor_iterator.hpp>

ConvertLSTMSequenceToTensorIterator transformation converts LSTMSequence layer to TensorIterator *.

class SliceToStridedSlice : public ov::pass::MatcherPass
#include <convert_slice_to_strided_slice.hpp>

SliceToStridedSlice transformation convert v8::Slice to v1::StridedSlice.

class ConvertSoftMax8ToSoftMax1 : public ov::pass::MatcherPass
#include <convert_softmax_downgrade.hpp>

ConvertSoftMax8ToSoftMax1 converts v8::SoftMax into v1::SoftMax.

class ConvertSoftMax1ToSoftMax8 : public ov::pass::MatcherPass
#include <convert_softmax_upgrade.hpp>

ConvertSoftMax1ToSoftMax8 converts v1::SoftMax into v8::SoftMax.

class ConvertSpaceToBatch : public ov::pass::MatcherPass
#include <convert_space_to_batch.hpp>

ConvertSpaceToBatch transformation decomposes SpaceToBatch layer to Pad->Reshape->Transpose->Reshape.

Param convert_by_elements:

- reduces the maximum number of dimensions that arise during the transformation if enabled. Default value: true. false - SpaceToBatch decomposes to Pad->Reshape->Transpose->Reshape. During transformation, the number of tensor dimensions can be increased by length of block_shape input of SpaceToBatch layer. true - SpaceToBatch decomposes to Pad-> N x (Reshape->Transpose->Reshape), where N = length of block_shape input of SpaceToBatch layer. During transformation, the number of tensor dimensions can be increased by 1.

class ConvertTensorIteratorToLSTMSequence : public ov::pass::MatcherPass
#include <convert_ti_to_sequences.hpp>

Finds all TensorIterator layers, detects the pattern Squeeze->LSTMCell->Unsqueeze in the TensorIterator body, converts this pattern to LSTMSequence layer and replaces them TensorIterator.

class ConvertTensorIteratorToRNNSequence : public ov::pass::MatcherPass
#include <convert_ti_to_sequences.hpp>

Finds all TensorIterator layers, detects the pattern Squeeze->RNNCell->Unsqueeze in the TensorIterator body, converts this pattern to RNNSequence layer and replaces them TensorIterator.

class ConvertTensorIteratorToGRUSequence : public ov::pass::MatcherPass
#include <convert_ti_to_sequences.hpp>

Finds all TensorIterator layers, detects the pattern Squeeze->GRUCell->Unsqueeze in the TensorIterator body, converts this pattern to GRUSequence layer and replaces them TensorIterator.

class ConvertLoopToLSTMSequence : public ov::pass::MatcherPass
#include <convert_ti_to_sequences.hpp>

Replaces Loop with LSTMCell inside to LSTMSequence.

class FuseReverseLSTMSequence : public ov::pass::MatcherPass
#include <convert_ti_to_sequences.hpp>

Fuses ReverseSequence->LSTM->ReverseSequence to LSTMSequence with REVERSE direction flag.

class FuseLSTMSequencesToBidirectionalLSTMSequence : public ov::pass::MatcherPass
#include <convert_ti_to_sequences.hpp>

Replaces two LSTMSequences to one bidirectional LSTMSequence.

class ConvertTopK11ToTopK3 : public ov::pass::MatcherPass
#include <convert_topk11_downgrade.hpp>

Converts TopK version 11 to TopK version 3 if TopK 11 stable attribute is set to false.

class ConvertXorToLogicalXor : public ov::pass::MatcherPass
#include <convert_xor_to_logical_xor.hpp>

ConvertXorToLogicalXor converts v0::Xor to v1::LogicalXor.

class ConvertDetectionOutput8ToDetectionOutput1 : public ov::pass::MatcherPass
#include <detection_output_downgrade.hpp>

ConvertDetectionOutput8ToDetectionOutput1 converts v8::DetectionOutput into v0::DetectionOutput.

class ConvertDetectionOutput1ToDetectionOutput8 : public ov::pass::MatcherPass
#include <detection_output_upgrade.hpp>

ConvertDetectionOutput1ToDetectionOutput8 converts v0::DetectionOutput into v8::DetectionOutput.

class EinsumDecomposition : public ov::pass::MatcherPass
#include <einsum_decomposition.hpp>

EinsumDecomposition transformation decomposes Einsum-7 operation into a sub-graph with more simple operations: Transpose, Reshape, MatMul, ReduceSum, Unsqueeze, ShapeOf, ReduceProd, StridedSlice, and Concat.

class EyeDecomposition : public ov::pass::MatcherPass
#include <eye_decomposition.hpp>

Do eye decomposition to sub-graph (model).

class FakeQuantizeDecomposition : public ov::pass::MatcherPass
#include <fq_decomposition.hpp>

FakeQuantizeDecomposition transformation decomposes FakeQuantize layer.

Expression from specification: if x <= min(input_low, input_high): output = output_low elif x > max(input_low, input_high): output = output_high else: output = round((x - input_low) / (input_high - input_low) * (levels-1)) / (levels-1) * (output_high - output_low) + output_low

expand brackets into round: round(x * (levels-1) / (input_high - input_low) - input_low * (levels-1) / (input_high - input_low)) div on (levels-1) and mult on (output_high - output_low) => mult on (output_high - output_low) / (levels-1)

=> round(x * (levels-1) / (input_high - input_low) - input_low * (levels-1) / (input_high - input_low)) * (output_high - output_low) / (levels-1) + output_low

This transformation doesn’t support following cases:

  1. At least one ‘range’ input is not Constant

  2. At least one ‘input_low’ input value greater or equal than ‘input_high’ input value

class Gelu7Downgrade : public ov::pass::MatcherPass
#include <gelu7_downgrade.hpp>

Gelu7Downgrade converts v7::Gelu operation to v2::Gelu unconditionally. This is done because only limited set of plugins support v7::Gelu which has an attribute specifying approximation mode. For other plugins the behaviour is to use v2 version of the operation which does not support the approximation mode.

class GRUCellDecomposition : public ov::pass::MatcherPass
#include <gru_cell_decomposition.hpp>

GRUCellDecomposition transformation decomposes GRUCell layer with inputs X, H, W, R, B to Add, Split, MatMul, Multiply and Subtract ops according to the formula: (.) - Denotes element-wise multiplication.

  • Denotes dot product. f, g - are activation functions

zt = f(Xt*(Wz^T) + Ht-1*(Rz^T) + Wbz + Rbz) rt = f(Xt*(Wr^T) + Ht-1*(Rr^T) + Wbr + Rbr) ht = g(Xt*(Wh^T) + (rt (.) Ht-1)*(Rh^T) + Rbh + Wbh) # when linear_before_reset := false # (default) ht = g(Xt*(Wh^T) + (rt (.) (Ht-1*(Rh^T) + Rbh)) + Wbh) # when linear_before_reset:= true Ht = (1 - zt) (.) ht + zt (.) Ht-1

class HSigmoidDecomposition : public ov::pass::MatcherPass
#include <hsigmoid_decomposition.hpp>

HSigmoidDecomposition transformation into sub-graph (min(Relu(x + 3), 6) * const(1/6).

class HSwishDecomposition : public ov::pass::MatcherPass
#include <hswish_decomposition.hpp>

HSwishDecomposition transformation into sub-graph x * (min(Relu(x + 3), 6) * const(1/6).

class LogSoftmaxDecomposition : public ov::pass::MatcherPass
#include <log_softmax_decomposition.hpp>

LogSoftmaxDecomposition transformation into sub-graph x - log(reduce_sum(exp(x), axis)).

class LSTMCellDecomposition : public ov::pass::MatcherPass
#include <lstm_cell_decomposition.hpp>

LSTMCellDecomposition transformation decomposes LSTMCell layer with inputs X, H, C, W, R, B to Add, Split, MatMul, Multiply ops according to the formula: (.) - Denotes element-wise multiplication.

  • Denotes dot product. f, g, h - are activation functions.

it = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Wbi + Rbi) ft = f(Xt*(Wf^T) + Ht-1*(Rf^T) + Wbf + Rbf) ct = g(Xt*(Wc^T) + Ht-1*(Rc^T) + Wbc + Rbc) ot = f(Xt*(Wo^T) + Ht-1*(Ro^T) + Wbo + Rbo) Ct = ft (.) Ct-1 + it (.) ct Ht = ot (.) h(Ct)

class MVN6Decomposition : public ov::pass::MatcherPass
#include <mvn6_decomposition.hpp>

MVN6Decomposition transformation into sub-graph x - ReduceMean(x, axes) if normalize_variance is false and into sub-graph (x - ReduceMean(x, axes)) / Sqrt(ReduceMean((x - ReduceMean(x, axes)) ^ 2)) if normalize_variance is true.

class NormalizeL2Decomposition : public ov::pass::MatcherPass
#include <normalize_l2_decomposition.hpp>

Decomposes NormalizeL2 into subgraph.

class ReduceL1Decomposition : public ov::pass::MatcherPass
#include <reduce_l1_decomposition.hpp>

Decomposes ReduceL1 into ReduceSum(abs(x)).

class ReduceL2Decomposition : public ov::pass::MatcherPass
#include <reduce_l2_decomposition.hpp>

Decomposes ReduceL2 into sqrt(ReduceSum(x * x)).

class RNNCellDecomposition : public ov::pass::MatcherPass
#include <rnn_cell_decomposition.hpp>

RNNCellDecomposition transformation decomposes RNNCell layer with inputs X, H, W, R, B to Add, MatMul ops according to the formula:

  • Denotes dot product. f - is an activation functions.

Ht = f(Xt*(Wi^T) + Ht-1*(Ri^T) + Wbi + Rbi)

class SoftmaxDecomposition : public ov::pass::MatcherPass
#include <softmax_decomposition.hpp>

SoftmaxDecomposition transformation replaces softmax with following graph:

       +---------------+
       │               │
       │     input     │
       │               │
       +---------------+
           │      │
           │      v
           │ +-----------+
           │ │           │
           │ │ ReduceMax │
           │ │           │
           │ +-----------+
           │      │
           │      │
           v      v
       +---------------+
       │               │
       │      Sub      │
       │               │
       +---------------+
               |
               |
               v
       +---------------+
       │               │
       │      Exp      │
       │               │
       +---------------+
           │      │
           │      v
           │ +-----------+
           │ │           │
           │ │ ReduceSum │
           │ │           │
           │ +-----------+
           │      │
           │      │
           v      v
        +-------------+
        |             │
        |     Div     │
        │             │
        +-------------+
class SoftPlusDecomposition : public ov::pass::MatcherPass
#include <softplus_decomposition.hpp>

SoftPlusDecomposition transformation replaces SoftPlus op to group of operations: log(exp(x) + 1).

class SoftSignDecomposition : public ov::pass::MatcherPass
#include <softsign_decomposition.hpp>

SoftSignDecomposition transformation replaces SoftSign with the following graph.

  Input ---> Abs
    |         |
    |         |
    |         |
    |         V
    |        Add <--- 1
    |         |
    |         |
    V         |
  Divide <----|
    |
    |
    |
    V
  Output
class ResolveNameCollisions : public ov::pass::ModelPass
#include <resolve_names_collisions.hpp>

ResolveNameCollisions transformation helps to fix names collisions if nodes with autogenerated names have conflicts with other node names.

Every transformation call can change the graph structure and create some additional operations, autogenerated name is used if new operation doesn’t have friendly name. This transformations should be called after the transformation pipeline in order to fix names collisions.

There is also an additional mode “resolve_all_names”, the logic of which is the same, but for all “friendly_names” in the model ov, not only for autogenerated.

class BroadcastConstRangeReplacement : public ov::pass::MatcherPass
#include <broadcast_const_range_replacement.hpp>

BroadcastConstRangeReplacement replaces Constant filled with range values starting from 0 and replaces it with Range op.

class LSTMStatesBroadcast : public ov::pass::ModelPass
#include <lstm_states_broadcast.hpp>

In case LSTMCell has constant initial hidden and cell state with single batch size we make them broadcast-able by batch.

class ReshapeAMatMul : public ov::pass::MatcherPass
#include <matmul_sr.hpp>

ReshapeAMatMul and ReshapeBMatMul transformations relax hard-coded Reshape followed by MatMul operation For 2D Reshape search patterns are:

  • MatMul(Reshape(any_input, any_input), any_input)

  • MatMul(any_input, Reshape(any_input, any_input))

class Proposal1Scales : public ov::pass::MatcherPass
#include <proposal_scales_stridedslice.hpp>

ProposalScales transformation helps to silently avoid reshape issues on the scale-input of Proposal layer.

Expected sub-graph looks like: Parameter [batch, 3 or 4] -> Reshape [-1] -(in: 3)-> PriorBox

PriorBox operation accepts 3 or 4 values as scales from specification standpoint PriorBox uses first set (batch) of scale values to proceed in the plugins According to this we explicitly take first batch of scales with StridedSlice operation

Resulting sub-graph: Parameter [batch, 3 or 4] -> Reshape [-1] -> StridedSlice[0: 3 or 4] -(in: 3)-> PriorBox

class ReshapeSinkingMatMul : public ov::pass::MatcherPass
#include <reshape_sinking.hpp>

ReshapeSinkingMatMul transformation looks for MatMul followed by optional Add surrounded with Reshape operations which are only needed to merge and unmerge dimensions into MatMuls batch. In case of success upscales MatMul to work with multidimensional batch and updates Reshape operators to make batch propagate through freely.

class ReshapeTo1D : public ov::pass::MatcherPass
#include <reshape_to_1D.hpp>

ReshapeTo1D transformation looks for Reshape from nD to 1D tensor and replaces its pattern to [-1].

class ShapeOfConstFolding : public ov::pass::MatcherPass
#include <shape_of_const_folding.hpp>

ShapeOfConstFolding constantfolds ShapeOf->Constant subgraph.

class StridedSliceSqueeze : public ov::pass::MatcherPass
#include <strided_slice_squeeze.hpp>

StridedSliceSqueeze transformation looks for SS -> Squeeze and corrects SS inputs and attributes for SS output to be squeeze-able.

class SqueezeStridedSlice : public ov::pass::MatcherPass
#include <strided_slice_squeeze.hpp>

StridedSliceSqueeze transformation looks for Squeeze -> SSe and corrects SS inputs and attributes for SS output to be squeeze-able.

class ChainedMaximumOptimization : public ov::pass::MatcherPass
#include <chained_maximum.hpp>

Optimizes graphs based on value symbols Maximum(Maximum(A, B), B) -> Maximum(A, B) Maximum(Maximum(A, B), A) -> Maximum(A, B)

class DeReshapeMatMul : public ov::pass::MatcherPass
#include <dereshape_matmul.hpp>

Transformation uses symbol information to optimize out Reshape operations surrounding MatMul. It checks that surrounding Reshapes are only manipulating with batch dimensions of tensor in a do-undo kind of way.

Example: Before: [A,B,C,D] -> Reshape -> [A*B,C,D] MatMul [A*B,C,E] -> Reshape -> [A,B,C,E] [A,B,D,E] -> Reshape -> [A*B,D,E]

After: [A,B,C,D] -> MatMul -> [A,B,C,E] [A,B,D,E] ->

Transformation allows slightly different variations of the pattern on inputs of MatMul.

  • Simplest pattern contains only Reshape operation on MatMul input: Reshape -> MatMul

  • The next acceptable variation is Concat of two inputs on MatMul input: Reshape -[-> Concat -]-> MatMul This variation would be transformed with realignment of the other input of Concat and the other outputs of Concat with the help of Reshape operations

  • The most complex variation on the MatMul input pattern is with Binary Elementwise Operation with scalar second input: Reshape -[-> Concat -]-[-> BEA (scalar) -]-> MatMul

Additionally, transformation supports variation of the pattern on output of MatMul. It allows for Binary Elementwise Arithmetic operation without second input scalar restriction. MatMul -[-> BEA -]-> Reshape this pattern variation is only applicable for the case when input reshapes are 4D -> 3D and output reshape is 3D -> 4D. Additionally, shape symbols on output of MatMul should be equal to the input shape symbols of the last Reshape, meaning that this Binary Elementwise Arithmetic doesn’t perform any broadcasting of input coming from MatMul &#8212; only other input may be broadcasted to the MatMul input of this BEA. This effect (equality of MatMul output shape symbols and output shape of BEA) is being handled by LabelResolvingThroughSelect transformation in the particular models that this variation targets.

Full pattern this transformation searches for: -> Reshape -[-> Concat -]-[-> BEA (scalar) -]-> MatMul -[-> BEA -]-> Reshape -> -> Reshape -[-> Concat -]-[-> BEA (scalar) -]->

NOTE: input branches could be (and in observed model cases are) asymmetrical, meaning that the presence of Concat on one input of MatMul doesn’t require the other input to also have Concat

class DeReshapeFullyConnected : public ov::pass::MatcherPass
#include <dereshape_matmul.hpp>

Transformation uses symbol information to optimize out Reshape operations surrounding special cases of MatMul. It checks that surrounding Reshapes are only manipulating with batch dimensions of tensor in a do-undo kind of way. The difference with previous optimization is that this case has Reshape only on one input of MatMul and the other input is strictly 2D. Such MatMuls are also called FullyConnected.

Example: Before: [A,B,4096] -> Reshape -> [A*B,4096] MatMul [A*B,4608] -> Reshape -> [A,B,4608] [4096,4608]

After: [A,B,4096] -> MatMul -> [A,B,4608] [4096,4608] ->

class NopBroadcast : public ov::pass::MatcherPass
#include <nop_broadcast.hpp>

Optimizes out Broadcast(data, Maximum(shape, ones)) if labels on data and shape are equal Use case with data being empty should not be considered here since original graph has Maximum with ones.

class ReshapeOptimizations : public ov::pass::MatcherPass
#include <reshape_optimizations.hpp>

Searches for Flatten-like Reshape operations and simplifies 2nd input of such Reshape using special zero feature.

class ApplySymbolEquivalence : public ov::pass::ModelPass
#include <symbol_optimization.hpp>

Resets symbols on output shapes and values according to symbol equivalence. It allows to reduce number of labels used in the model and to disambiguate symbol values.

class OptimizeSymbolsUsedAsValues : public ov::pass::ModelPass
#include <symbol_optimization.hpp>

Collects sources where each symbol initially appeared (on shape or shape sub-graph) and attaches all value usages of this label to this initial source.

class SymbolicOptimizations : public ov::pass::ModelPass
#include <symbolic_optimizations.hpp>

Runs optimizations which are based on symbolic shape inference.

class SymbolicPropagation : public ov::pass::ModelPass
#include <symbolic_optimizations.hpp>

Assigns labels / symbols to all tensors on shapes and values. Uses shape inference and other special rules to propagate labels / symbols.

class LabelResolvingThroughSelect : public ov::pass::MatcherPass
#include <symbolic_optimizations.hpp>

Transformation requires equal labels on one input of Add and output of last Reshape in the pattern: -> Add -> Reshape -[then or else input]-> Select -> Softmax -> Reshape ->

If shape labels onn mentioned tensors are equal we proved that no broadcasting of this input was done for Add and for Select. Therefore, we can put the same labels on the output of Add and Select. This transformation helps propagate labels and will not be needed if we would use information on equality of products of input and output dimensions of Reshape operations

class TSForwardBase : public ov::pass::MatcherPass
#include <ts_base.hpp>

TSForwardBase is a base class for all forward transformations.

Subclassed by ov::pass::transpose_sinking::TSBinaryForward, ov::pass::transpose_sinking::TSConcatForward, ov::pass::transpose_sinking::TSCumSumForward, ov::pass::transpose_sinking::TSDataMovementForward, ov::pass::transpose_sinking::TSGatherForward, ov::pass::transpose_sinking::TSInterpolateForward, ov::pass::transpose_sinking::TSReductionForward, ov::pass::transpose_sinking::TSShapeOfForward, ov::pass::transpose_sinking::TSSliceForward, ov::pass::transpose_sinking::TSSplitForward, ov::pass::transpose_sinking::TSSqueezeForward, ov::pass::transpose_sinking::TSTileForward, ov::pass::transpose_sinking::TSUnaryForward, ov::pass::transpose_sinking::TSUnsqueezeForward

class TSBinaryForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_binary.hpp>

TSBinaryForward transformation sinks Transpose through BinaryElementwiseArithmetic, BinaryElementwiseComparison, BinaryElementwiseLogical and PRelu operations in the forward direction.

class TSBinaryBackward : public ov::pass::MatcherPass
#include <ts_binary.hpp>

TSBinaryBackward transformation sinks Transpose through BinaryElementwiseArithmetic, BinaryElementwiseComparison, BinaryElementwiseLogical and PRelu operations in the backward direction.

class TSConcatForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_concat.hpp>

TSConcatForward transformation sinks Transpose through Concat operation in the forward direction.

class TSConcatBackward : public ov::pass::MatcherPass
#include <ts_concat.hpp>

TSConcatBackward transformation sinks Transpose through Concat operation in the backward direction.

class TSCumSumForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_cumsum.hpp>

TSCumSumForward transformation sinks Transpose through CumSum in the forward direction.

class TSCumSumBackward : public ov::pass::MatcherPass
#include <ts_cumsum.hpp>

TSCumSumBackward transformation sinks Transpose through CumSum in the backward direction.

class TSDataMovementForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_data_movement.hpp>

TSDataMovementForward transformation sinks Transpose through BatchToSpace, SpaceToBatch, ReverseSequence and Pad operations in the forward direction. These operations are categorized as “DataMovement” and are handled in a similar way in this transformation.

class TSDataMovementBackward : public ov::pass::MatcherPass
#include <ts_data_movement.hpp>

TSDataMovementBackward transformation sinks Transpose through BatchToSpace, SpaceToBatch, ReverseSequence and Pad operations in the backward direction. These operations are categorized as “DataMovement” and are handled in a similar way in this transformation.

class TSFuse : public ov::pass::MatcherPass
#include <ts_fuse.hpp>

TSFuse transformation eliminates 2 consecutive Transposes if they result in no changes to input or fuses them to single Transpose if input gets changed.

class TSGatherForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_gather.hpp>

TSGatherForward transformation sinks Transpose through Gather operations in the forward direction.

class TSGatherBackward : public ov::pass::MatcherPass
#include <ts_gather.hpp>

TSGatherBackward transformation sinks Transpose through Gather operation in the backward direction.

class TSGeneralForward : public ov::pass::GraphRewrite
#include <ts_general.hpp>

TSGeneralForward transformation combines all TransposeSinkingForward* transformations into single GraphRewrite pass.

class TSGeneralBackward : public ov::pass::GraphRewrite
#include <ts_general.hpp>

TSGeneralBackward transformation combines all TransposeSinkingBackward* transformations into single GraphRewrite pass.

class TSGeneral : public ov::pass::ModelPass
#include <ts_general.hpp>

TSGeneral transformation combines TSGeneralForward and TSGeneralBackward transformations into single ModelPass pass and inserts ConstantFolding pass after them.

class TSInterpolateForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_interpolate.hpp>

TSInterpolateForward transformation sinks Transpose through Interpolate operation in the forward direction.

class TSInterpolateBackward : public ov::pass::MatcherPass
#include <ts_interpolate.hpp>

TSInterpolateBackward transformation sinks Transpose through Interpolate operation in the backward direction.

class TSReductionForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_reduction.hpp>

TSReductionForward transformation sinks Transpose through Reduce operations in the forward direction.

class TSReductionBackward : public ov::pass::MatcherPass
#include <ts_reduction.hpp>

TSReductionBackward transformation sinks Transpose through Reduce operations in the backward direction.

class TSResetNoSinkingAttribute : public ov::pass::MatcherPass
#include <ts_reset_no_sinking_attribute.hpp>

TSResetNoSinkingAttribute transformation resets all NoSinkingAttribute runtime attributes in Transpose operations.

class TSShapeOfForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_shape_of.hpp>

TSShapeOfForward transformation sinks Transpose through ShapeOf in the forward direction.

It replaces:

+——&#8212;+ |Transpose| +——&#8212;+ | v +——&#8212;+ | ShapeOf | +——&#8212;+

with the following:

+——&#8212;+ | ShapeOf | +——&#8212;+ | v +—&#8212;+ |Gather| +—&#8212;+

class TSSplitForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_split.hpp>

TSSplitForward transformation sinks Transpose through Split, VariadicSplit operations in the forward direction.

class TSSplitBackward : public ov::pass::MatcherPass
#include <ts_split.hpp>

TSSplitBackward transformation sinks Transpose through Split, VariadicSplit operations in the backward direction.

class TSSqueezeForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_squeeze.hpp>

TSSqueezeForward transformation sinks Transpose through Reshape, Squeeze operations in the forward direction.

class TSSqueezeBackward : public ov::pass::MatcherPass
#include <ts_squeeze.hpp>

TSSqueezeBackward transformation sinks Transpose through Reshape, Squeeze operations in the backward direction.

class TSTileForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_tile.hpp>

TSTileForward transformation sinks Transpose through Tile in the forward direction.

class TSTileBackward : public ov::pass::MatcherPass
#include <ts_tile.hpp>

TSTileBackward transformation sinks Transpose through Tile in the backward direction.

class TSUnaryForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_unary.hpp>

TSUnaryForward transformation sinks Transpose through UnaryElementwiseArithmetic, Clamp, Elu, SoftPlus, LogicalNot, Convert, IsInf, IsNaN, IsFinite operations in the forward direction.

class TSUnaryBackward : public ov::pass::MatcherPass
#include <ts_unary.hpp>

TSUnaryBackward transformation sinks Transpose through UnaryElementwiseArithmetic, Clamp, Elu, SoftPlus, LogicalNot, Convert, IsInf, IsNaN, IsFinite in the backward direction.

class TSUnsqueezeForward : public ov::pass::transpose_sinking::TSForwardBase
#include <ts_unsqueeze.hpp>

TSUnsqueezeForward transformation sinks Transpose through Unsqueeze, Reshape operations in the forward direction.

class TSUnsqueezeBackward : public ov::pass::MatcherPass
#include <ts_unsqueeze.hpp>

TSUnsqueezeBackward transformation sinks Transpose through Unsqueeze, Reshape operations in the backward direction.

namespace ov

transformation aligns elementwise constant inputs ranks with its output rank

A namespace with const values for Execution Graph parameters names.

Executable Model Info is represented in ov::Model format with general ExecutionNode nodes inside including connections between the nodes. Each node describes an executable hardware-specific primitive and stores its parameters within ExecutionNode::get_rt_info map. There is a list of general keys for the parameters map.

OpenVINO C++ API.

Resolves transpose_b key from MatMul operation if corresponding input is constant or FakeQuantize by inserting Transpose.

Functions

LP_TRANSFORMATIONS_API void mark_as_bias (const std::shared_ptr< Node > &node)
LP_TRANSFORMATIONS_API bool marked_as_bias (const std::shared_ptr< const Node > &node)
std::ostream &operator<<(std::ostream &out, const Mask &mask)
Mask::Ptr getMask(const Output<const Node> &output)
Mask::Ptr getMask(const Output<Node> &output)
void setMask(Output<Node> output, const Mask::Ptr &mask)
void setMask(Input<Node> node, const Mask::Ptr &mask)
void mark_as_decompression(const std::shared_ptr<Node> &node)
void unmark_as_decompression(const std::shared_ptr<Node> &node)
bool is_decompression(const std::shared_ptr<Node> &node)
void mark_as_dequantization_node(const std::shared_ptr<Node> &node)
bool is_dequantization_node(const std::shared_ptr<Node> &node)
void disable_fp16_compression(const std::shared_ptr<Node> &node)
void enable_fp16_compression(const std::shared_ptr<Node> &node)
bool fp16_compression_is_disabled(const std::shared_ptr<const Node> &node)
void postpone_fp16_compression(RTMap &rt_info)
bool is_fp16_compression_postponed(const RTMap &rt_info)
void do_not_postpone_fp16_compression(RTMap &rt_info)
std::string getFusedNames(const std::shared_ptr<ov::Node> &node)

getFusedNames return string with operation names separated by coma in alphabetical order

Parameters:

node[in] The node will be used to get FusedNames attribute

std::vector<std::string> getFusedNamesVector(const std::shared_ptr<ov::Node> &node)

getFusedNamesVector return vector of fused names sorted in alphabetical order

Parameters:

node[in] The node will be used to get FusedNames attribute

Returns:

vector of strings

void mark_shape_subgraph(const std::shared_ptr<Node> &node)
void unmark_shape_subgraph(const std::shared_ptr<Node> &node)
bool is_shape_subgraph(const std::shared_ptr<const Node> &node)
void enable_keep_const_precision(const std::shared_ptr<Node> &node)
void disable_keep_const_precision(const std::shared_ptr<Node> &node)
bool is_keep_const_precision(const std::shared_ptr<const Node> &node)
bool has_nms_selected_indices(const Node *node)
void set_nms_selected_indices(Node *node)
void disable_divide_conversion(const std::shared_ptr<Node> &node)
void enable_divide_conversion(const std::shared_ptr<Node> &node)
bool divide_is_nonconvertible(const std::shared_ptr<Node> &node)
inline bool has_old_api_map_element_type(const std::shared_ptr<Node> &node)
inline OldApiMapElementType get_old_api_map_element_type(const std::shared_ptr<Node> &node)
inline void set_old_api_map_element_type(const std::shared_ptr<Node> &node, const OldApiMapElementType &old_api_map)
inline bool has_old_api_map_order(const std::shared_ptr<Node> &node)
inline OldApiMapOrder get_old_api_map_order(const std::shared_ptr<Node> &node)
inline void set_old_api_map_order(std::shared_ptr<