Skip to content

Commit

Permalink
[LPT] comments fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eshoguli committed Sep 22, 2021
1 parent 9f62459 commit d7dc7f5
Show file tree
Hide file tree
Showing 31 changed files with 53 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ngraph::AvgPoolPrecisionPreservedAttribute class represents the `AvgPoolPrecisionPreserved` attribute.

Utility attribute which is used only during `AvgPool` operation precision preserved property definition.
Utility attribute, which is used only during `AvgPool` operation, precision preserved property definition.

| Property name | Values |
|---------------|----------------------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ngraph::IntervalsAlignmentAttribute class represents the `IntervalsAlignment` attribute.

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

| Property name | Values |
|---------------|----------------------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ngraph::PerTensorQuantizationAttribute class represents the `PerTensorQuantization` attribute.

The attribute defines if operation input port requires per-tensor quantization.
The attribute defines if the operation input port requires per-tensor quantization.

| Property name | Values |
|---------------|----------------------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ngraph::PrecisionPreservedAttribute class represents the `PrecisionPreserved` attribute.

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

| Property name | Values |
|---------------|----------------------------------------------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ngraph::QuantizationAlignmentAttribute class represents the `QuantizationAlignment` attribute.

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

| Property name | Values |
|---------------|----------------------------------------------|
Expand Down
24 changes: 12 additions & 12 deletions docs/low_precision_transformations/lpt_attributes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenVINO™ Low Precision Transformations: attributes {#openvino_docs_IE_DG_lpt_attributes}
# OpenVINO™ Low Precision Transformations: Attributes {#openvino_docs_IE_DG_lpt_attributes}

## Introduction

Expand All @@ -12,19 +12,19 @@
| [QuantizationAlignment](@ref openvino_docs_IE_DG_lpt_QuantizationAlignment) | Quantization alignment | Yes | Yes |

> `Target` attribute group defines attribute usage during model transformation for the best performance:
> - `Precision` - the attribute is used to define the most optimal output port precision.
> - `Quantization interval` - the attribute is used to define quantization interval.
> - `Quantization alignment` - the attribute is used to define quantization alignment: per-channel or per-tensor quantization.
> - `Precision` - the attribute defines the most optimal output port precision.
> - `Quantization interval` - the attribute defines quantization interval.
> - `Quantization alignment` - the attribute defines quantization alignment: per-channel or per-tensor quantization.
>
> `Required` attribute group defines if attribute usage is required to get optimal model during transformation or not:
> - `Yes` - the attribute is used in low precision optimization which is used by all OpenVINO plugins.
> - `No` - the attribute is used in specific OpenVINO plugin.
> `Required` attribute group defines if attribute usage is required to get an optimal model during transformation:
> - `Yes` - the attribute is used by all OpenVINO plugins for low-precision optimization.
> - `No` - the attribute is used in a specific OpenVINO plugin.
>
> `Mutable` attribute group defines if transformation can update existing attribute or not:
> - `Yes` - the attribute can be updated by the next transformations in pipeline. But attribute update order is still important.
> - `No` - existing attribute can not be updated by the next transformation. Previous handled transformation has optimized model in accordance with current value.
> `Mutable` attribute group defines if transformation can update an existing attribute:
> - `Yes` - the attribute can be updated by the next transformations in the pipeline. But attribute update order is still important.
> - `No` - existing attribute can not be updated by the next transformation. Previous handled transformation has optimized a model according to the current value.
`FakeQuantize` decomposition is mandatory part of low precision transformations. Attributes which are used during decomposition are mandatory. Optional attributes are required for some operations only.
`FakeQuantize` decomposition is a mandatory part of low precision transformations. Attributes used during decomposition are mandatory. Optional attributes are required only for certain operations.

Attributes usage by transformations:

Expand All @@ -37,4 +37,4 @@ Attributes usage by transformations:
| IntervalsAlignment | AlignQuantizationIntervals | FakeQuantizeDecompositionTransformation |
| QuantizationAlignment | AlignQuantizationParameters | FakeQuantizeDecompositionTransformation |

> Note, please, the same type attribute instances can be created in different transformations. This approach is result of transformation single-responsibility principle. For example `Precision` attribute instances are created in `MarkupCanBeQuantized` and `MarkupPrecisions` transformations but the creation reason is different.
> **Note:** the same type of attribute instances can be created in different transformations. This approach is the result of the transformation single-responsibility principle. For example, `Precision` attribute instances are created in `MarkupCanBeQuantized` and `MarkupPrecisions` transformations, but the reasons for their creation are different.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenVINO™ LPT: step #1. Prerequisites transformations {#openvino_docs_IE_DG_lpt_step1_prerequisites}
# OpenVINO™ LPT: Step #1. Prerequisites Transformations {#openvino_docs_IE_DG_lpt_step1_prerequisites}

Prerequisites transformations are optional. The goal is prepare a model before to run other low precision transformations. Transformations don't operate with dequantization operations, don't update precisions. Transformations:
Prerequisites transformations are optional. The transformations prepare a model before running other low precision transformations. The transformations do not operate with dequantization operations or update precisions. Prerequisites transformations include:
* [PullReshapeThroughDequantization](@ref openvino_docs_IE_DG_lpt_PullReshapeThroughDequantization)
* [PullTransposeThroughDequantization](@ref openvino_docs_IE_DG_lpt_PullTransposeThroughDequantization)
* [LinOpSequenceFusion](@ref openvino_docs_IE_DG_lpt_LinOpSequenceFusion)
5 changes: 3 additions & 2 deletions docs/low_precision_transformations/pipeline/step2_markup.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# OpenVINO™ LPT: step #2. Markup transformations {#openvino_docs_IE_DG_lpt_step2_markup}
# OpenVINO™ LPT: Step #2. Markup Transformations {#openvino_docs_IE_DG_lpt_step2_markup}

This step defines the optimal `FakeQuantize` decomposition precisions for the best inference performance via operations markup with runtime attribute instances. Attributes are created for input and output ports and operations. Transformations do not change the operation output port precisions. A model markup low precision logic is decomposed and implemented into the following common markup transformations. Transformations order is important:

This step defines the most optimal `FakeQuantize` decomposition precisions for the best inference performance via operations markup with runtime attribute instances. Attributes are created for input & output ports and operations. Operation output port precisions are not changed in these transformations. Transformations order is important. A model markup low precision logic is decomposed and implemented into following common markup transformations (in usage order, order is important):
1. [MarkupCanBeQuantized](@ref openvino_docs_IE_DG_lpt_MarkupCanBeQuantized)
2. [MarkupPrecisions](@ref openvino_docs_IE_DG_lpt_MarkupPrecisions)
3. [MarkupPerTensorQuantization](@ref openvino_docs_IE_DG_lpt_MarkupPerTensorQuantization)
Expand Down
4 changes: 2 additions & 2 deletions docs/low_precision_transformations/pipeline/step3_main.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenVINO™ LPT: step #3. Main transformations {#openvino_docs_IE_DG_lpt_step3_main}
# OpenVINO™ LPT: Step #3. Main Transformations {#openvino_docs_IE_DG_lpt_step3_main}

Main transformations are the most part of low precision transformations. Transformations operate with dequantization operations. Transformations:
Main transformations are the majority of low precision transformations. Transformations operate with dequantization operations. Main transformations include:
* [AddTransformation](@ref openvino_docs_IE_DG_lpt_AddTransformation)
* [AvgPoolTransformation](@ref openvino_docs_IE_DG_lpt_AvgPoolTransformation)
* [ClampTransformation](@ref openvino_docs_IE_DG_lpt_AvgPoolTransformation)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# OpenVINO™ LPT: step #4. Cleanup transformations {#openvino_docs_IE_DG_lpt_step4_cleanup}
# OpenVINO™ LPT: Step #4. Cleanup Transformations {#openvino_docs_IE_DG_lpt_step4_cleanup}

* [FoldConvertTransformation](@ref openvino_docs_IE_DG_lpt_FoldConvertTransformation)
* [FoldFakeQuantizeTransformation](@ref openvino_docs_IE_DG_lpt_FoldFakeQuantizeTransformation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ngraph::pass::low_precision::AddTransformation class represents the `Add` operat

The transformation propagates dequantization subtraction from one input branch to another and propagates dequantization multiplication from the same branch through `Add` operation. In transformation result, one `Add` operation input branch is in low precision without dequantization operations (empty branch), another input branch is in original precision with updated dequantization operations (full branch).

Empty branch selection criteria step by step (by priority):
Criteria for selecting an empty branch in order of priority:

*Step #1.* If one branch is quantized only, then the quantized branch is empty branch.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LP_TRANSFORMATIONS_API MarkupCanBeQuantized;
/**
* @ingroup ie_transformation_common_api
* @brief MarkupCanBeQuantized transformation marks Convolution, ConvolutionBackpropData, GroupConvolution and Concat
* operations as can be quantized or not. If an operation is not quantized, then PrecisionsAttribute attribute instance
* operations as able to be quantized or not. If an operation is not quantized, then PrecisionsAttribute attribute instance
* is created with empty precisions.
*/
class ngraph::pass::low_precision::MarkupCanBeQuantized : public ngraph::pass::FunctionPass {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class LP_TRANSFORMATIONS_API MarkupPerTensorQuantization;

/**
* @ingroup ie_transformation_common_api
* @brief MarkupPerTensorQuantization transformation marks operations as required pre-tensor quantization in accordance with
* @brief MarkupPerTensorQuantization transformation marks operations as required per-tensor quantization according to the
* provided restrictions.
*/
class ngraph::pass::low_precision::MarkupPerTensorQuantization : public ngraph::pass::FunctionPass {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LP_TRANSFORMATIONS_API MarkupPrecisions;
* @ingroup ie_transformation_common_api
* @brief MarkupPrecisions transformation marks:
* 1) not supported operations by PrecisionsAttribute attribute with empty precisions,
* 2) operations with required precisions by PrecisionsAttribute attribute in accordance with provided restrictions,
* 2) operations with required precisions by PrecisionsAttribute attribute according to the provided restrictions,
* 3) precision preserved operations by PrecisionPreservedAttribute attribute.
*/
class ngraph::pass::low_precision::MarkupPrecisions : public ngraph::pass::FunctionPass {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LP_TRANSFORMATIONS_API PullReshapeThroughDequantization;
/**
* @ingroup ie_transformation_common_api
* @brief PullReshapeThroughDequantization propagates dequantization operations through Reshape operations.
* The transformation is used on constant subgraph on weights to prepare a model for next low precision transformations.
* The transformation is used on constant subgraph weights to prepare a model for the next low precision transformations.
*/
class ngraph::pass::low_precision::PullReshapeThroughDequantization : public ngraph::pass::MatcherPass {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LP_TRANSFORMATIONS_API PullTransposeThroughDequantization;
/**
* @ingroup ie_transformation_common_api
* @brief PullTransposeThroughDequantization propagates dequantization operations through Transpose operations.
* The transformation is used on constant subgraph on weights to prepare a model for next low precision transformations.
* The transformation is used on constant subgraph weights to prepare a model for the next low precision transformations.
*/
class ngraph::pass::low_precision::PullTransposeThroughDequantization : public ngraph::pass::MatcherPass {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LP_TRANSFORMATIONS_API PrecisionPreservedSharedValue : public SharedValue<

/**
* @ingroup ie_transformation_common_api
* @brief PrecisionPreservedAttribute defines precision preserved operation. If attribute is absent then an operation is
* @brief PrecisionPreservedAttribute defines the precision preserved operation. If the attribute is absent, then an operation is
* not precision preserved.
*/
class LP_TRANSFORMATIONS_API PrecisionPreservedAttribute : public SharedValueAttribute<PrecisionPreservedSharedValue> {
Expand Down

0 comments on commit d7dc7f5

Please sign in to comment.