Common optimization passes¶
Overview¶
A set of common optimization passes. More…
// namespaces
namespace ngraph;
namespace ngraph::builder;
namespace ngraph::builder::opset1;
namespace ngraph::coordinates;
namespace ngraph::descriptor;
namespace ngraph::descriptor::layout;
namespace ngraph::element;
namespace ngraph::file_util;
namespace ngraph::op;
namespace ngraph::op::internal;
namespace ngraph::op::util;
namespace ngraph::op::util::detail;
namespace ngraph::op::util::error;
namespace ngraph::op::v0;
namespace ngraph::op::v1;
namespace ngraph::op::v3;
namespace ngraph::op::v4;
namespace ngraph::op::v5;
namespace ngraph::op::v6;
namespace ngraph::op::v7;
namespace ngraph::op::v8;
namespace ngraph::op::v9;
namespace ngraph::opset1;
namespace ngraph::opset2;
namespace ngraph::opset3;
namespace ngraph::opset4;
namespace ngraph::opset5;
namespace ngraph::opset6;
namespace ngraph::opset7;
namespace ngraph::opset8;
namespace ngraph::opset9;
namespace ngraph::pass;
namespace ngraph::pass::itt;
namespace ngraph::pass::itt::domains;
namespace ngraph::pass::low_precision;
namespace ngraph::pass::low_precision::itt;
namespace ngraph::pass::low_precision::itt::domains;
namespace ngraph::pass::low_precision::precision_set;
namespace ngraph::pattern;
namespace ngraph::pattern::op;
namespace ngraph::reduction;
namespace ngraph::runtime;
namespace ngraph::runtime::opt_kernel;
namespace ngraph::runtime::reference;
namespace ngraph::runtime::reference::adaptive_pool;
namespace ngraph::runtime::reference::detail;
namespace ngraph::runtime::reference::details;
namespace ngraph::runtime::reference::fake_quantize_details;
namespace ngraph::runtime::reference::fft_common;
namespace ngraph::runtime::reference::internal;
namespace ngraph::runtime::reference::kernel;
namespace ngraph::runtime::reference::nms_common;
namespace ngraph::snippets;
namespace ngraph::snippets::isa;
namespace ngraph::snippets::op;
namespace ngraph::snippets::pass;
// typedefs
typedef std::unordered_map<ngraph::NodeTypeInfo, std::function<bool(const std::shared_ptr<ngraph::Node>&, ngraph::element::Type, size_t idx)>> type_to_fuse_map;
// classes
class ngraph::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 ngraph::pass::BatchToSpaceFusion;
class ngraph::pass::BidirectionalGRUSequenceDecomposition;
class ngraph::pass::BidirectionalLSTMSequenceDecomposition;
class ngraph::pass::BidirectionalRNNSequenceDecomposition;
class ngraph::pass::BidirectionalSequenceDecomposition;
class ngraph::pass::BinarizeWeights;
class ngraph::pass::BroadcastConstRangeReplacement;
class ngraph::pass::BroadcastElementwiseFusion;
class ngraph::pass::ClampFusion;
class ngraph::pass::low_precision::ClampTransformation;
class ov::pass::CompressFloatConstants;
class ov::pass::CompressFloatConstantsImpl;
class ngraph::pass::ConcatReduceFusion;
class ngraph::pass::low_precision::ConcatTransformation;
class ngraph::pass::ConvStridesPropagation;
class ngraph::pass::ConvToBinaryConv;
class ngraph::pass::ConvertBatchToSpace;
class ov::pass::ConvertCompressedOnlyToLegacy;
class ngraph::pass::ConvertDeformableConv8To1;
class ngraph::pass::ConvertDetectionOutput1ToDetectionOutput8;
class ngraph::pass::ConvertDetectionOutput8ToDetectionOutput1;
class ngraph::pass::ConvertGRUSequenceMatcher;
class ngraph::pass::ConvertGRUSequenceToTensorIterator;
class ngraph::pass::ConvertGather0D;
class ngraph::pass::ConvertGather1ToGather7;
class ngraph::pass::ConvertGather7ToGather1;
class ngraph::pass::ConvertGather7ToGather8;
class ngraph::pass::ConvertGather8ToGather7;
class ngraph::pass::ConvertInterpolate1ToInterpolate4;
class ngraph::pass::ConvertLSTMSequenceMatcher;
class ngraph::pass::ConvertLSTMSequenceToTensorIterator;
class ngraph::pass::ConvertMVN1ToMVN6;
class ngraph::pass::ConvertMaxPool1ToMaxPool8;
class ngraph::pass::ConvertMaxPool8ToMaxPool1;
class ngraph::pass::ConvertNmsGatherPathToUnsigned;
class ngraph::pass::ConvertPadToGroupConvolution;
class ngraph::pass::ConvertPriorBox8To0;
class ngraph::pass::ConvertQuantizeDequantize;
class ngraph::pass::ConvertRNNSequenceMatcher;
class ngraph::pass::ConvertRNNSequenceToTensorIterator;
class ngraph::pass::ConvertROIAlign3To9;
class ngraph::pass::ConvertROIAlign9To3;
class ngraph::pass::ConvertScatterElementsToScatter;
class ngraph::pass::ConvertSoftMax1ToSoftMax8;
class ngraph::pass::ConvertSoftMax8ToSoftMax1;
class ngraph::pass::ConvertSpaceToBatch;
class ngraph::pass::low_precision::ConvertSubtractConstant;
class ngraph::pass::ConvertTensorIteratorToGRUSequence;
class ngraph::pass::ConvertTensorIteratorToLSTMSequence;
class ngraph::pass::ConvertTensorIteratorToRNNSequence;
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 ngraph::pass::DepthToSpaceFusion;
class ngraph::pass::low_precision::DepthToSpaceTransformation;
class ngraph::pass::DilatedConvolutionConverter;
class ov::pass::DisableDecompressionConvertConstantFolding;
class ngraph::pass::DisableRandomUniformConstantFolding;
class ngraph::pass::DivideFusion;
class ov::pass::DivisionByZeroFP16Resolver;
class ngraph::pass::DropoutWithRandomUniformReplacer;
class ngraph::pass::EinsumDecomposition;
class ngraph::pass::EliminateConcat;
class ngraph::pass::EliminateConvert;
class ngraph::pass::EliminateConvertNonZero;
class ngraph::pass::EliminateEltwise;
class ngraph::pass::EliminateGatherUnsqueeze;
class ngraph::pass::EliminatePad;
class ngraph::pass::EliminateSplit;
class ngraph::pass::EliminateSqueeze;
class ngraph::pass::EliminateTranspose;
class ngraph::pass::EliminateUnsqueezeGather;
class ngraph::pass::low_precision::EltwiseBaseTransformation;
class ov::pass::EnableDecompressionConvertConstantFolding;
class ngraph::pass::FakeQuantizeDecomposition;
class ngraph::pass::low_precision::FakeQuantizeDecompositionTransformation;
class ngraph::pass::FakeQuantizeMulFusion;
class ngraph::pass::FakeQuantizeReshapeFusion;
class ngraph::pass::low_precision::FakeQuantizeTransformation;
class ngraph::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 ngraph::pass::GRUCellDecomposition;
class ngraph::pass::GatherNegativeConstIndicesNormalize;
class ngraph::pass::GatherNopElimination;
class ngraph::pass::Gelu7Downgrade;
class ngraph::pass::GeluFusion;
class ngraph::pass::GeluFusionWithErfOne;
class ngraph::pass::GeluFusionWithErfThree;
class ngraph::pass::GeluFusionWithErfTwo;
class ngraph::pass::GeluFusionWithTanh;
class ngraph::pass::low_precision::GroupConvolutionTransformation;
class ngraph::pass::GroupedGatherElimination;
class ngraph::pass::GroupedStridedSliceOptimizer;
class ngraph::pass::HSigmoidDecomposition;
class ngraph::pass::HSigmoidFusion;
class ngraph::pass::HSigmoidFusionWithClampDiv;
class ngraph::pass::HSigmoidFusionWithClampMul;
class ngraph::pass::HSigmoidFusionWithReluDiv;
class ngraph::pass::HSigmoidFusionWithReluMul;
class ngraph::pass::HSigmoidFusionWithoutRelu;
class ngraph::pass::HSwishDecomposition;
class ngraph::pass::HSwishFusion;
class ngraph::pass::HSwishFusionWithClamp;
class ngraph::pass::HSwishFusionWithHSigmoid;
class ngraph::pass::HSwishFusionWithReluDiv;
class ngraph::pass::HSwishFusionWithReluMul;
class ngraph::pass::InitConstMask;
class ngraph::pass::InitMasks;
class ngraph::pass::InitNodeInfo;
class ngraph::pass::InterpolateSequenceFusion;
class ngraph::pass::low_precision::InterpolateTransformation;
class ngraph::IntervalsAlignmentAttribute;
class ngraph::IntervalsAlignmentSharedValue;
class ngraph::pass::LSTMCellDecomposition;
class ngraph::pass::low_precision::LayerTransformation;
class ngraph::pass::LeakyReluFusion;
class ngraph::pass::LinOpSequenceFusion;
class ngraph::pass::LogSoftmaxDecomposition;
class ngraph::pass::MVN6Decomposition;
class ngraph::pass::MVNFusion;
class ngraph::pass::MVNFusionWithConstantsInside;
class ngraph::pass::MVNFusionWithoutConstants;
class ngraph::pass::low_precision::MVNTransformation;
class ov::pass::MarkPrecisionSensitiveDivides;
class ov::pass::MarkPrecisionSensitiveSubgraphs;
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 ngraph::pass::MatMulMultiplyFusion;
class ngraph::pass::low_precision::MatMulTransformation;
class ngraph::pass::low_precision::MaxPoolTransformation;
class ngraph::pass::MimicSetBatchSize;
class ngraph::pass::MishFusion;
class ngraph::pass::MulFakeQuantizeFusion;
class ngraph::pass::MultiplyConvolutionFusion;
class ngraph::pass::low_precision::MultiplyToGroupConvolutionTransformation;
class ngraph::pass::low_precision::MultiplyTransformation;
class ngraph::pass::NearestNeighborUpsamplingFusion;
class ngraph::pass::NormalizeL2Decomposition;
class ngraph::pass::NormalizeL2Fusion;
class ngraph::pass::low_precision::NormalizeL2Transformation;
class ngraph::pass::PReluFusion;
class ngraph::pass::PReluFusionMultiplyAdd;
class ngraph::pass::PReluFusionMultiplySub;
class ngraph::pass::PReluFusionNegativeAdd;
class ngraph::pass::PReluFusionNegativeSub;
class ngraph::pass::low_precision::PReluTransformation;
class ngraph::pass::PadFusionAvgPool;
class ngraph::pass::PadFusionConvolution;
class ngraph::pass::PadFusionConvolutionBackpropData;
class ngraph::pass::PadFusionGroupConvolution;
class ngraph::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 ngraph::pass::Proposal1Scales;
class ngraph::pass::Pruning;
class ngraph::pass::low_precision::PullReshapeThroughDequantization;
class ngraph::pass::PullSqueezeThroughEltwise;
class ngraph::pass::low_precision::PullTransposeThroughDequantization;
class ngraph::QuantizationAlignmentAttribute;
class ngraph::QuantizationGranularityAttribute;
class ngraph::pass::RNNCellDecomposition;
class ngraph::pass::RandomUniformFusion;
class ngraph::pass::low_precision::ReduceBaseTransformation;
class ngraph::pass::ReduceL1Decomposition;
class ngraph::pass::ReduceL2Decomposition;
class ngraph::pass::low_precision::ReduceMaxTransformation;
class ngraph::pass::low_precision::ReduceMeanTransformation;
class ngraph::pass::ReduceMerge;
class ngraph::pass::low_precision::ReduceMinTransformation;
class ngraph::pass::low_precision::ReduceSumTransformation;
class ngraph::pass::ReluFakeQuantizeFusion;
class ngraph::pass::low_precision::ReluTransformation;
class ov::pass::RemoveConcatZeroDimInput;
class ngraph::pass::ReplaceConcatReduceByMinOrMax;
class ngraph::pass::ReshapeAMatMul;
class ngraph::pass::ReshapeSequenceFusion;
class ngraph::pass::ReshapeTo1D;
class ngraph::pass::low_precision::ReshapeTransformation;
class ov::pass::ResolveNameCollisions;
class ngraph::pass::ReverseInputChannelsFusion;
class ngraph::pass::SetBatchSize;
class ngraph::pass::SharedShapeOf;
class ngraph::pass::SharedSqueeze;
class ngraph::pass::SharedStridedSliceEraser;
class ngraph::pass::ShrinkWeights;
class ngraph::pass::ShuffleChannelsFusion;
class ngraph::pass::low_precision::ShuffleChannelsTransformation;
class ngraph::pass::SkipGatherBeforeTransposeAndReshape;
class ngraph::pass::SliceToStridedSlice;
class ngraph::pass::SoftPlusDecomposition;
class ngraph::pass::SoftPlusFusion;
class ngraph::pass::SoftPlusToMishFusion;
class ngraph::pass::SoftSignDecomposition;
class ngraph::pass::SoftmaxDecomposition;
class ngraph::pass::SoftmaxFusion;
class ngraph::pass::SpaceToBatchFusion;
class ngraph::pass::SplitConcatPairToInterpolateFusion;
class ngraph::pass::SplitSqueezeConcatFusion;
class ngraph::pass::low_precision::SplitTransformation;
class ngraph::pass::SqueezeStridedSlice;
class ngraph::pass::low_precision::SqueezeTransformation;
class ngraph::pass::StridedSliceOptimization;
class ngraph::pass::StridedSliceSqueeze;
class ngraph::pass::low_precision::StridedSliceTransformation;
class ngraph::pass::StridesOptimization;
class ngraph::pass::SubtractFusion;
class ngraph::pass::low_precision::SubtractTransformation;
class ngraph::pass::SupportedNodesStridesPropagation;
class ngraph::pass::SwishFusion;
class ngraph::pass::SwishFusionWithBeta;
class ngraph::pass::SwishFusionWithSigmoid;
class ngraph::pass::SwishFusionWithSigmoidWithBeta;
class ngraph::pass::SwishFusionWithoutBeta;
class ngraph::pass::low_precision::TransformationContext;
class ngraph::pass::low_precision::TransparentBaseTransformation;
class ngraph::pass::TransposeConvert;
class ngraph::pass::TransposeEltwise;
class ngraph::pass::TransposeFQReduction;
class ngraph::pass::TransposeFuse;
class ngraph::pass::TransposeReduction;
class ngraph::pass::TransposeReshapeEliminationForMatmul;
class ngraph::pass::TransposeSinking;
class ngraph::pass::TransposeToReshape;
class ngraph::pass::low_precision::TransposeTransformation;
class ngraph::pass::UnrollIf;
class ngraph::pass::UnrollTensorIterator;
class ngraph::pass::low_precision::UnsqueezeTransformation;
class ngraph::pass::UnsupportedNodesStridesPropagation;
template <
typename AttributeType,
typename ExpectedAttributeType = AttributeType
>
class ngraph::pass::low_precision::UpdateSharedPrecisionPreserved;
class ngraph::pass::UselessStridedSliceEraser;
class ngraph::pass::low_precision::VariadicSplitTransformation;
class ngraph::pass::low_precision::WeightableLayerTransformation;
class ngraph::pass::WeightsDequantizeToFakeQuantize;
class ngraph::pass::WrapInterpolateIntoTransposes;
Detailed Documentation¶
A set of common optimization passes.
Typedefs¶
typedef std::unordered_map<ngraph::NodeTypeInfo, std::function<bool(const std::shared_ptr<ngraph::Node>&, ngraph::element::Type, size_t idx)>> type_to_fuse_map
ConvertPrecision transformation convert precision for entire ngraph::Function 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> functoin (can be found in cpp file) that performs type fusion into operation.
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