Skip to content

Commit 3111e23

Browse files
authored
[CPU][DOCS] Remove recommendation to use partially defined shapes (#14675)
1 parent b2feb56 commit 3111e23

File tree

3 files changed

+0
-36
lines changed

3 files changed

+0
-36
lines changed

docs/OV_Runtime_UG/supported_plugins/CPU.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -136,27 +136,6 @@ CPU provides full functional support for models with dynamic shapes in terms of
136136

137137
> **NOTE**: The CPU plugin does not support tensors with dynamically changing rank. In case of an attempt to infer a model with such tensors, an exception will be thrown.
138138
139-
Dynamic shapes support introduces additional overhead on memory management and may limit internal runtime optimizations.
140-
The more degrees of freedom are used, the more difficult it is to achieve the best performance.
141-
The most flexible configuration, and the most convenient approach, is the fully undefined shape, which means that no constraints to the shape dimensions are applied.
142-
However, reducing the level of uncertainty results in performance gains.
143-
You can reduce memory consumption through memory reuse, achieving better cache locality and increasing inference performance. To do so, set dynamic shapes explicitly, with defined upper bounds.
144-
145-
@sphinxtabset
146-
147-
@sphinxtab{C++}
148-
@snippet docs/snippets/cpu/dynamic_shape.cpp defined_upper_bound
149-
@endsphinxtab
150-
151-
@sphinxtab{Python}
152-
@snippet docs/snippets/cpu/dynamic_shape.py defined_upper_bound
153-
@endsphinxtab
154-
155-
@endsphinxtabset
156-
157-
> **NOTE**: Using fully undefined shapes may result in significantly higher memory consumption compared to inferring the same model with static shapes.
158-
> If memory consumption is unacceptable but dynamic shapes are still required, the model can be reshaped using shapes with defined upper bounds to reduce memory footprint.
159-
160139
Some runtime optimizations work better if the model shapes are known in advance.
161140
Therefore, if the input data shape is not changed between inference calls, it is recommended to use a model with static shapes or reshape the existing model with the static input shape to get the best performance.
162141

docs/snippets/cpu/dynamic_shape.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,6 @@
22

33

44
int main() {
5-
{
6-
//! [defined_upper_bound]
7-
ov::Core core;
8-
auto model = core.read_model("model.xml");
9-
10-
model->reshape({{ov::Dimension(1, 10), ov::Dimension(1, 20), ov::Dimension(1, 30), ov::Dimension(1, 40)}});
11-
//! [defined_upper_bound]
12-
}
13-
145
{
156
//! [static_shape]
167
ov::Core core;

docs/snippets/cpu/dynamic_shape.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
from openvino.runtime import Core
66

7-
#! [defined_upper_bound]
8-
core = Core()
9-
model = core.read_model("model.xml")
10-
model.reshape([(1, 10), (1, 20), (1, 30), (1, 40)])
11-
#! [defined_upper_bound]
12-
137
#! [static_shape]
148
core = Core()
159
model = core.read_model("model.xml")

0 commit comments

Comments
 (0)