Common optimization passes

Overview

A set of common optimization passes. More…

// typedefs

typedef std::unordered_map<ov::NodeTypeInfo, std::function<bool(const std::shared_ptr<ov::Node>&, ov::element::Type, size_t idx)>> type_to_fuse_map;

// classes

class ov::pass::AUGRUCellFusion;
class ov::pass::AddFakeQuantizeFusion;
class ov::pass::AddOldApiMapToParameters;
class ngraph::pass::low_precision::AddTransformation;
class ngraph::pass::low_precision::AlignQuantizationIntervals;
class ngraph::pass::low_precision::AlignQuantizationParameters;
class ngraph::AvgPoolPrecisionPreservedAttribute;
class ngraph::pass::low_precision::AvgPoolTransformation;
class ov::pass::BatchToSpaceFusion;
class ov::pass::BidirectionalGRUSequenceDecomposition;
class ov::pass::BidirectionalLSTMSequenceDecomposition;
class ov::pass::BidirectionalRNNSequenceDecomposition;
class ov::pass::BidirectionalSequenceDecomposition;
class ov::pass::BinarizeWeights;
class ov::pass::BroadcastConstRangeReplacement;
class ov::pass::BroadcastElementwiseFusion;
class ov::pass::ClampFusion;
class ngraph::pass::low_precision::ClampTransformation;
class ov::pass::CompressFloatConstants;
class ov::pass::CompressFloatConstantsImpl;
class ov::pass::ConcatReduceFusion;
class ngraph::pass::low_precision::ConcatTransformation;
class ov::pass::ConvStridesPropagation;
class ov::pass::ConvToBinaryConv;
class ov::pass::ConvertBatchToSpace;
class ov::pass::ConvertCompressedOnlyToLegacy;
class ov::pass::ConvertCompressedToMixedPrecision;
class ov::pass::ConvertDeformableConv8To1;
class ov::pass::ConvertDetectionOutput1ToDetectionOutput8;
class ov::pass::ConvertDetectionOutput8ToDetectionOutput1;
class ov::pass::ConvertGRUSequenceToTensorIterator;
class ov::pass::ConvertGather0D;
class ov::pass::ConvertGather1ToGather7;
class ov::pass::ConvertGather7ToGather1;
class ov::pass::ConvertGather7ToGather8;
class ov::pass::ConvertGather8ToGather7;
class ov::pass::ConvertInterpolate1ToInterpolate4;
class ov::pass::ConvertLSTMSequenceToTensorIterator;
class ov::pass::ConvertMVN1ToMVN6;
class ov::pass::ConvertMaxPool1ToMaxPool8;
class ov::pass::ConvertMaxPool8ToMaxPool1;
class ov::pass::ConvertNmsGatherPathToUnsigned;
class ov::pass::ConvertPadToGroupConvolution;
class ov::pass::ConvertPriorBox8To0;
class ov::pass::ConvertQuantizeDequantize;
class ov::pass::ConvertRNNSequenceToTensorIterator;
class ov::pass::ConvertROIAlign3To9;
class ov::pass::ConvertROIAlign9To3;
class ov::pass::ConvertScatterElementsToScatter;
class ov::pass::ConvertSoftMax1ToSoftMax8;
class ov::pass::ConvertSoftMax8ToSoftMax1;
class ov::pass::ConvertSpaceToBatch;
class ngraph::pass::low_precision::ConvertSubtractConstant;
class ov::pass::ConvertTensorIteratorToGRUSequence;
class ov::pass::ConvertTensorIteratorToLSTMSequence;
class ov::pass::ConvertTensorIteratorToRNNSequence;
class ov::pass::ConvertXorToLogicalXor;
class ngraph::pass::low_precision::ConvolutionBackpropDataTransformation;
class ngraph::pass::low_precision::ConvolutionTransformation;
template <
    typename AttributeType,
    typename OperationType = ngraph::pattern::op::Label
    >
class ngraph::pass::low_precision::CreateAttribute;
template <typename AttributeType, typename OperationType>
class ngraph::pass::low_precision::CreatePrecisionsDependentAttribute;
class ov::pass::DepthToSpaceFusion;
class ngraph::pass::low_precision::DepthToSpaceTransformation;
class ov::pass::DilatedConvolutionConverter;
class ov::pass::DisableDecompressionConvertConstantFolding;
class ov::pass::DisableRandomUniformConstantFolding;
class ov::pass::DivideFusion;
class ov::pass::DivisionByZeroFP16Resolver;
class ov::pass::DropoutWithRandomUniformReplacer;
class ov::pass::EinsumDecomposition;
class ov::pass::EliminateConcat;
class ov::pass::EliminateConvert;
class ov::pass::EliminateConvertNonZero;
class ov::pass::EliminateEltwise;
class ov::pass::EliminateGatherUnsqueeze;
class ov::pass::EliminatePad;
class ov::pass::EliminateScatterUpdate;
class ov::pass::EliminateSplit;
class ov::pass::EliminateSqueeze;
class ov::pass::EliminateTranspose;
class ov::pass::EliminateUnsqueezeGather;
class ngraph::pass::low_precision::EltwiseBaseTransformation;
class ov::pass::EnableDecompressionConvertConstantFolding;
class ov::pass::EyeDecomposition;
class ov::pass::FakeQuantizeDecomposition;
class ngraph::pass::low_precision::FakeQuantizeDecompositionTransformation;
class ov::pass::FakeQuantizeMulFusion;
class ov::pass::FakeQuantizeReshapeFusion;
class ngraph::pass::low_precision::FakeQuantizeTransformation;
class ov::pass::FixRtInfo;
class ngraph::pass::low_precision::FoldConvertTransformation;
class ngraph::pass::low_precision::FoldFakeQuantizeTransformation;
class ngraph::pass::low_precision::FuseConvertTransformation;
class ngraph::pass::low_precision::FuseMultiplyToFakeQuantizeTransformation;
class ngraph::pass::low_precision::FuseSubtractToFakeQuantizeTransformation;
class ov::pass::FusedNamesCleanup;
class ov::pass::GRUCellDecomposition;
class ov::pass::GRUCellFusion;
class ov::pass::GatherNegativeConstIndicesNormalize;
class ov::pass::GatherNopElimination;
class ov::pass::Gelu7Downgrade;
class ov::pass::GeluFusion;
class ov::pass::GeluFusionWithErfFour;
class ov::pass::GeluFusionWithErfOne;
class ov::pass::GeluFusionWithErfThree;
class ov::pass::GeluFusionWithErfTwo;
class ov::pass::GeluFusionWithTanh;
class ngraph::pass::low_precision::GroupConvolutionTransformation;
class ov::pass::GroupedGatherElimination;
class ov::pass::GroupedStridedSliceOptimizer;
class ov::pass::HSigmoidDecomposition;
class ov::pass::HSigmoidFusion;
class ov::pass::HSigmoidFusionWithClampDiv;
class ov::pass::HSigmoidFusionWithClampMul;
class ov::pass::HSigmoidFusionWithReluDiv;
class ov::pass::HSigmoidFusionWithReluMul;
class ov::pass::HSigmoidFusionWithoutRelu;
class ov::pass::HSwishDecomposition;
class ov::pass::HSwishFusion;
class ov::pass::HSwishFusionWithClamp;
class ov::pass::HSwishFusionWithHSigmoid;
class ov::pass::HSwishFusionWithReluDiv;
class ov::pass::HSwishFusionWithReluMul;
class ngraph::pass::InitConstMask;
class ngraph::pass::InitMasks;
class ov::pass::InitNodeInfo;
class ov::pass::InterpolateSequenceFusion;
class ngraph::pass::low_precision::InterpolateTransformation;
class ngraph::IntervalsAlignmentAttribute;
class ngraph::IntervalsAlignmentSharedValue;
class ov::pass::LSTMCellDecomposition;
class ov::pass::LSTMStatesBroadcast;
class ngraph::pass::low_precision::LayerTransformation;
class ov::pass::LeakyReluFusion;
class ov::pass::LinOpSequenceFusion;
class ov::pass::LogSoftmaxDecomposition;
class ov::pass::MVN6Decomposition;
class ov::pass::MVNFusion;
class ov::pass::MVNFusionWithConstantsInside;
class ov::pass::MVNFusionWithoutConstants;
class ngraph::pass::low_precision::MVNTransformation;
class ov::pass::MarkDequantizationSubgraph;
class ov::pass::MarkDividesInShapeSubgraphs;
class ov::pass::MarkPrecisionSensitiveConstants;
class ov::pass::MarkPrecisionSensitiveShapeOfSubgraphs;
class ngraph::pass::low_precision::MarkupAvgPoolPrecisionPreserved;
class ngraph::pass::low_precision::MarkupCanBeQuantized;
class ngraph::pass::low_precision::MarkupPrecisions;
class ngraph::pass::low_precision::MarkupQuantizationGranularity;
class ov::pass::MatMulMultiplyFusion;
class ngraph::pass::low_precision::MatMulTransformation;
class ngraph::pass::low_precision::MaxPoolTransformation;
class ov::pass::MimicSetBatchSize;
class ov::pass::MishFusion;
class ov::pass::MulFakeQuantizeFusion;
class ov::pass::MultiplyConvolutionFusion;
class ngraph::pass::low_precision::MultiplyToGroupConvolutionTransformation;
class ngraph::pass::low_precision::MultiplyTransformation;
class ov::pass::NearestNeighborUpsamplingFusion;
class ov::pass::NormalizeL2Decomposition;
class ov::pass::NormalizeL2Fusion;
class ngraph::pass::low_precision::NormalizeL2Transformation;
class ov::pass::PReluFusion;
class ov::pass::PReluFusionMultiplyAdd;
class ov::pass::PReluFusionMultiplySub;
class ov::pass::PReluFusionNegativeAdd;
class ov::pass::PReluFusionNegativeSub;
class ngraph::pass::low_precision::PReluTransformation;
class ov::pass::PadFusionAvgPool;
class ov::pass::PadFusionConvolution;
class ov::pass::PadFusionConvolutionBackpropData;
class ov::pass::PadFusionGroupConvolution;
class ov::pass::PadFusionGroupConvolutionBackpropData;
class ngraph::pass::low_precision::PadTransformation;
class ngraph::PrecisionPreservedAttribute;
class ngraph::PrecisionsAttribute;
class ngraph::pass::PropagateMasks;
class ngraph::pass::low_precision::PropagatePrecisions;
template <class AttributeType>
class ngraph::pass::low_precision::PropagateSharedValue;
template <typename AttributeType>
class ngraph::pass::low_precision::PropagateThroughPrecisionPreserved;
template <typename AttributeType>
class ngraph::pass::low_precision::PropagateToInput;
class ov::pass::Proposal1Scales;
class ngraph::pass::Pruning;
class ngraph::pass::low_precision::PullReshapeThroughDequantization;
class ov::pass::PullReshapeThroughReduce;
class ov::pass::PullSqueezeThroughEltwise;
class ov::pass::PullThroughReduce;
class ngraph::pass::low_precision::PullTransposeThroughDequantization;
class ov::pass::PullUnsqueezeThroughReduce;
class ov::pass::PushConstantToSubgraph;
class ngraph::QuantizationAlignmentAttribute;
class ngraph::QuantizationGranularityAttribute;
class ov::pass::RNNCellDecomposition;
class ov::pass::RandomUniformFusion;
class ngraph::pass::low_precision::ReduceBaseTransformation;
class ov::pass::ReduceL1Decomposition;
class ov::pass::ReduceL2Decomposition;
class ngraph::pass::low_precision::ReduceMaxTransformation;
class ngraph::pass::low_precision::ReduceMeanTransformation;
class ov::pass::ReduceMerge;
class ngraph::pass::low_precision::ReduceMinTransformation;
class ov::pass::ReduceReshapeFusion;
class ngraph::pass::low_precision::ReduceSumTransformation;
class ov::pass::ReluFakeQuantizeFusion;
class ngraph::pass::low_precision::ReluTransformation;
class ov::pass::RemoveConcatZeroDimInput;
class ov::pass::ReplaceConcatReduceByMinOrMax;
class ov::pass::ReshapeAMatMul;
class ov::pass::ReshapePRelu;
class ov::pass::ReshapeSequenceFusion;
class ov::pass::ReshapeSinkingMatMul;
class ov::pass::ReshapeTo1D;
class ngraph::pass::low_precision::ReshapeTransformation;
class ov::pass::ResolveNameCollisions;
class ov::pass::ReverseInputChannelsFusion;
class ov::pass::SelectWithOneValueCondition;
class ov::pass::SequenceFusion;
class ov::pass::SetBatchSize;
class ov::pass::ShapeOfConstFolding;
class ov::pass::SharedShapeOf;
class ov::pass::SharedSqueeze;
class ov::pass::SharedStridedSliceEraser;
class ngraph::pass::ShrinkWeights;
class ov::pass::ShuffleChannelsFusion;
class ngraph::pass::low_precision::ShuffleChannelsTransformation;
class ov::pass::SkipGatherBeforeTransposeAndReshape;
class ov::pass::SliceToStridedSlice;
class ov::pass::SoftPlusDecomposition;
class ov::pass::SoftPlusFusion;
class ov::pass::SoftPlusToMishFusion;
class ov::pass::SoftSignDecomposition;
class ov::pass::SoftmaxDecomposition;
class ov::pass::SoftmaxFusion;
class ov::pass::SpaceToBatchFusion;
class ov::pass::SplitConcatPairToInterpolateFusion;
class ov::pass::SplitSqueezeConcatFusion;
class ngraph::pass::low_precision::SplitTransformation;
class ov::pass::SqueezeStridedSlice;
class ngraph::pass::low_precision::SqueezeTransformation;
class ov::pass::StridedSliceOptimization;
class ov::pass::StridedSliceSqueeze;
class ngraph::pass::low_precision::StridedSliceTransformation;
class ov::pass::StridesOptimization;
class ov::pass::SubtractFusion;
class ngraph::pass::low_precision::SubtractTransformation;
class ov::pass::SupportedNodesStridesPropagation;
class ov::pass::SwishFusion;
class ov::pass::SwishFusionWithBeta;
class ov::pass::SwishFusionWithSigmoid;
class ov::pass::SwishFusionWithSigmoidWithBeta;
class ov::pass::SwishFusionWithoutBeta;
class ngraph::pass::low_precision::TransformationContext;
class ngraph::pass::low_precision::TransparentBaseTransformation;
class ov::pass::TransposeConvert;
class ov::pass::TransposeEltwise;
class ov::pass::TransposeFQReduction;
class ov::pass::TransposeFuse;
class ov::pass::TransposeReduction;
class ov::pass::TransposeReshapeEliminationForMatmul;
class ov::pass::TransposeSinking;
class ov::pass::TransposeToReshape;
class ngraph::pass::low_precision::TransposeTransformation;
class ov::pass::UnrollIf;
class ov::pass::UnrollTensorIterator;
class ngraph::pass::low_precision::UnsqueezeTransformation;
class ov::pass::UnsupportedNodesStridesPropagation;
template <
    typename AttributeType,
    typename ExpectedAttributeType = AttributeType
    >
class ngraph::pass::low_precision::UpdateSharedPrecisionPreserved;
class ov::pass::UselessStridedSliceEraser;
class ngraph::pass::low_precision::VariadicSplitTransformation;
class ngraph::pass::low_precision::WeightableLayerTransformation;
class ov::pass::WeightsDequantizeToFakeQuantize;
class ov::pass::WrapInterpolateIntoTransposes;

Detailed Documentation

A set of common optimization passes.

Typedefs

typedef std::unordered_map<ov::NodeTypeInfo, std::function<bool(const std::shared_ptr<ov::Node>&, ov::element::Type, size_t idx)>> type_to_fuse_map

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