-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reserving CPU resource in CPU inference #27321
Changes from 6 commits
dd848c2
23a6e42
ce804ee
bf63bf9
dd43e4a
13a146e
79099f0
b6ba3a6
ae3e1f0
7c53ce3
e27cc45
967f2fa
3ccc8c6
9e7ed1c
5cdfc10
e684864
d1f50d2
64e8114
bea7d8e
93fcb21
6412749
e171818
a575038
bd4a132
885d837
a6d7ea1
8cc37b1
daf179b
f6e5867
34b1aff
f3bcc0c
8c86f52
4e9d6a1
2e0295f
76bb972
a0c8793
af4cf60
9a36e8d
ab7484d
aab8519
f46103c
85b03f6
b1143c6
bb622bb
d0e19e1
c0f2e69
e06fbdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -479,6 +479,24 @@ static constexpr Property<std::set<ModelDistributionPolicy>> model_distribution_ | |
*/ | ||
static constexpr Property<bool> enable_cpu_pinning{"ENABLE_CPU_PINNING"}; | ||
|
||
/** | ||
* @brief This property allows CPU reservation during inference. | ||
* @ingroup ov_runtime_cpp_prop_api | ||
* | ||
* Cpu Reservation means reserve cpus which will not be used by other plugin. Developer can use this property to | ||
* enable or disable CPU reservation during inference on Windows and Linux. MacOS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say property support matrix should be described in User documentation as we do for other properties. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, added the property in User documentation. |
||
* does not support CPU reservation, and this property is always disabled. | ||
* This property defaults to false. | ||
* | ||
* The following code is example to use this property. | ||
* | ||
* @code | ||
* ie.set_property(ov::hint::enable_cpu_reservation(true)); | ||
* ie.set_property(ov::hint::enable_cpu_reservation(false)); | ||
* @endcode | ||
*/ | ||
static constexpr Property<bool> enable_cpu_reservation{"ENABLE_CPU_RESERVATION"}; | ||
|
||
/** | ||
* @brief This property define if using hyper threading during inference. | ||
* @ingroup ov_runtime_cpp_prop_api | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,10 +163,6 @@ void IStreamsExecutor::Config::update_executor_config() { | |
return; | ||
} | ||
|
||
if (_cpu_reservation && !_cpu_pinning) { | ||
_cpu_pinning = true; | ||
} | ||
|
||
if (!_streams_info_table.empty()) { | ||
streams_info_available = true; | ||
std::vector<int> threads_proc_type(HYPER_THREADING_PROC + 1, 0); | ||
|
@@ -265,7 +261,7 @@ void IStreamsExecutor::Config::update_executor_config() { | |
} | ||
} | ||
|
||
if (_cpu_pinning) { | ||
if (_cpu_pinning || _cpu_reservation) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If user set cpu_reservation only, change cpu_pinning to yes internally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, done. |
||
reserve_available_cpus(_streams_info_table, _stream_processor_ids, _cpu_reservation ? CPU_USED : NOT_USED); | ||
} | ||
|
||
|
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the property limits CPUs reuse not only between the plugins, but also within single plugin for different compiled models. That should be stated directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, done.