Closed akuporos closed 5 days ago
.take
Thank you for looking into this issue! Please let us know if you have any questions or require any help.
Is there a way to reduce the amount of build during the cmake step? i.e. limit Cmake build to only necessary files for this issue?
Hello @kcin96, yes there is - you can take a look at available CMake flags at https://github.com/openvinotoolkit/openvino/blob/master/docs/dev/cmake_options_for_custom_compilation.md.
Hi @kcin96,
You may turn off almost all Frontends (keep ENABLE_OV_IR_FRONTEND) and almost all plugins (keep ENABLE_INTEL_CPU and probably ENABLE_AUTO for running tests).
Thanks @akuporos & @p-wysocki! I've gotten to this point with the implementation of openvino.runtime.Node
model.def("get_sink_index",
[](ov::Model& self, const py::object& node) -> int64_t {
if (py::isinstance<ov::op::v6::Assign>(node)) {
auto sink = std::dynamic_pointer_cast<ov::op::Sink>(node.cast<std::shared_ptr<ov::op::v6::Assign>>());
int64_t pos = 0;
for (const auto& s: self.get_sinks()) {
if (s == sink) {
return pos;
}
pos++;
};
} else if (py::isinstance<ov::Node>(node)) {
auto sink = std::dynamic_pointer_cast<ov::op::Sink>(node.cast<std::shared_ptr<ov::Node>>());
int64_t pos = 0;
for (const auto& s: self.get_sinks()) {
if (s == sink) {
return pos;
}
pos++;
};
} else {
throw py::type_error("Incorrect argument type. Sink node is expected as argument.");
}
return -1;
},
py::arg("sink"),
R"(
Return index of sink.
Return -1 if `sink` not matched.
:param sink: Sink node.
:type sink: openvino.runtime.Node
:return: Index for sink node.
:rtype: int
)");
However, for openvino.runtime.Output
I am not sure how sink nodes relate to Output
? Also what's the function of sink nodes?
Hi @kcin96,
Each Node has Output (or several Outputs).
You can get sink Node from Output using get_node_shared_ptr()
method.
Context
Needs to add the new method to openvino.Model class in Python API.
What needs to be done?
There are methods
get_result_index
andget_parameter_index
of the Model class in Python API. We want to haveget_sink_index
here. Unlike the above methods, it is not implemented in the C++ API, so need to add it from scratch (only in Python API right now). It should take as input argumentopenvino.runtime.Output
/openvino.runtime.Node
-> thus, two overloads of the method should be implemented. The implementation of theremove_sink
method may be useful here to check the type of the input Sync Node.Also please cover this method by adding test to this file.
Example Pull Requests
No response
Resources
Contact points
@akuporos @p-wysocki @jiwaszki
Ticket
131043