[AUTO] Enable round robin policy for cumulative throughput mode of AUTO plugin (#20439)
* Add and implement the logic of property SCHEDULE_POLICY for MULTI plugin. * Updated. * Enable test case for schedule policy test. * enable test case for property ov::intel_auto::schedule_policy. * Update. * Updated. * Updated. * Update. * Update the lock logic here by considering the runtime fallback case. * Update. * Update. * Update. * Update default value of schedule policy to DEVICE_PRIORITY * Enable the function test case for schedule policy. * Add description for inference requests schedule policy within AUTO plugin cumulative mode. * Updated. * Python bindings for enum SchedulePolicy and property ov::intel_auto::schedule_policy. * Update. * Update. * Update. * Updated. --------- Co-authored-by: Chen Peter <peter.chen@intel.com> Co-authored-by: Wanglei Shen <wanglei.shen@intel.com>
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
# Copyright (C) 2018-2023 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Enums
|
||||
from openvino._pyopenvino.properties.intel_auto import SchedulePolicy
|
||||
|
||||
# Properties
|
||||
import openvino._pyopenvino.properties.intel_auto as __intel_auto
|
||||
from openvino.properties._properties import __make_properties
|
||||
|
||||
__make_properties(__intel_auto, __name__)
|
||||
|
||||
@@ -282,8 +282,14 @@ void regmodule_properties(py::module m) {
|
||||
py::module m_intel_auto =
|
||||
m_properties.def_submodule("intel_auto",
|
||||
"openvino.runtime.properties.intel_auto submodule that simulates ov::intel_auto");
|
||||
// Submodule intel_auto - enums
|
||||
py::enum_<ov::intel_auto::SchedulePolicy>(m_intel_auto, "SchedulePolicy", py::arithmetic())
|
||||
.value("ROUND_ROBIN", ov::intel_auto::SchedulePolicy::ROUND_ROBIN)
|
||||
.value("DEVICE_PRIORITY", ov::intel_auto::SchedulePolicy::DEVICE_PRIORITY)
|
||||
.value("DEFAULT", ov::intel_auto::SchedulePolicy::DEFAULT);
|
||||
|
||||
wrap_property_RW(m_intel_auto, ov::intel_auto::device_bind_buffer, "device_bind_buffer");
|
||||
wrap_property_RW(m_intel_auto, ov::intel_auto::enable_startup_fallback, "enable_startup_fallback");
|
||||
wrap_property_RW(m_intel_auto, ov::intel_auto::enable_runtime_fallback, "enable_runtime_fallback");
|
||||
wrap_property_RW(m_intel_auto, ov::intel_auto::schedule_policy, "schedule_policy");
|
||||
}
|
||||
|
||||
@@ -172,6 +172,8 @@ py::object from_ov_any(const ov::Any& any) {
|
||||
return py::cast(any.as<ov::hint::Priority>());
|
||||
} else if (any.is<ov::hint::PerformanceMode>()) {
|
||||
return py::cast(any.as<ov::hint::PerformanceMode>());
|
||||
} else if (any.is<ov::intel_auto::SchedulePolicy>()) {
|
||||
return py::cast(any.as<ov::intel_auto::SchedulePolicy>());
|
||||
} else if (any.is<ov::hint::SchedulingCoreType>()) {
|
||||
return py::cast(any.as<ov::hint::SchedulingCoreType>());
|
||||
} else if (any.is<ov::hint::ExecutionMode>()) {
|
||||
@@ -357,6 +359,8 @@ ov::Any py_object_to_any(const py::object& py_obj) {
|
||||
return py::cast<ov::hint::Priority>(py_obj);
|
||||
} else if (py::isinstance<ov::hint::PerformanceMode>(py_obj)) {
|
||||
return py::cast<ov::hint::PerformanceMode>(py_obj);
|
||||
} else if (py::isinstance<ov::intel_auto::SchedulePolicy>(py_obj)) {
|
||||
return py::cast<ov::intel_auto::SchedulePolicy>(py_obj);
|
||||
} else if (py::isinstance<ov::hint::SchedulingCoreType>(py_obj)) {
|
||||
return py::cast<ov::hint::SchedulingCoreType>(py_obj);
|
||||
} else if (py::isinstance<ov::log::Level>(py_obj)) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "openvino/core/type/element_type.hpp"
|
||||
#include "openvino/runtime/properties.hpp"
|
||||
#include "openvino/runtime/auto/properties.hpp"
|
||||
#include "openvino/pass/serialize.hpp"
|
||||
|
||||
namespace py = pybind11;
|
||||
|
||||
@@ -110,6 +110,14 @@ def test_deprecation():
|
||||
(log.Level.TRACE, "Level.TRACE", 4),
|
||||
),
|
||||
),
|
||||
(
|
||||
intel_auto.SchedulePolicy,
|
||||
(
|
||||
(intel_auto.SchedulePolicy.ROUND_ROBIN, "SchedulePolicy.ROUND_ROBIN", 0),
|
||||
(intel_auto.SchedulePolicy.DEVICE_PRIORITY, "SchedulePolicy.DEVICE_PRIORITY", 1),
|
||||
(intel_auto.SchedulePolicy.DEFAULT, "SchedulePolicy.DEVICE_PRIORITY", 1),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
def test_properties_enums(ov_enum, expected_values):
|
||||
|
||||
Reference in New Issue
Block a user