-
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
[Docs][PyOV] Documentation for Custom Python Operation #25615
base: master
Are you sure you want to change the base?
Conversation
073084e
to
e0f40f9
Compare
docs/articles_en/documentation/openvino-extensibility/custom-openvino-operations.rst
Outdated
Show resolved
Hide resolved
…penvino-operations.rst
This PR will be closed in a week because of 2 weeks of no activity. |
Hey everyone, can we finalize this one? It has been hanging for a while and Anastasia did a lot of good work here, would be a shame to let it go to waste. Even if it is not perfect, maybe we could go through with some polishing, merge, publish, and then continue improving in a separate PR? |
Hi @kblaszczak-intel , I'd like to complete this PR first, and then return back to this one. |
docs/articles_en/documentation/openvino-extensibility/custom-openvino-operations.rst
Outdated
Show resolved
Hide resolved
docs/articles_en/documentation/openvino-extensibility/custom-openvino-operations.rst
Outdated
Show resolved
Hide resolved
docs/articles_en/documentation/openvino-extensibility/custom-openvino-operations.rst
Outdated
Show resolved
Hide resolved
5. Override the ``visit_attributes`` method, which enables serialization and deserialization of operation attributes. An ``AttributeVisitor`` is passed to the method, and the implementation is expected to walk over all the attributes in the op using the type-aware ``on_attribute`` helper. Helpers are already implemented for standard C++ types like ``int64_t``, ``float``, ``bool``, ``vector``, and for existing OpenVINO defined types. | ||
There are some methods that can also be overridden if needed: | ||
|
||
4. Override the ``clone_with_new_inputs`` method, which enables graph manipulation routines to create copies of this operation and connect it to different nodes during optimization. |
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.
The description doesn't provide any reason why this function is optional. If I don't implement it, what does happen?
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.
the default ones will be called.
but overall I removed this phrase
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.
So, now clone_with_new_inputs
is mandatory according to the documentation? That was one of the things we were trying to fix for Python (this is one of the "Python Exclusives" in this case). And now we are not emphasizing it.
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've edited the sentence and added remark that it is optional
docs/articles_en/documentation/openvino-extensibility/custom-openvino-operations.rst
Outdated
Show resolved
Hide resolved
When Python API is used, there is no way to implement a custom OpenVINO operation. Even if custom OpenVINO operation is implemented in C++ and loaded into the runtime by a shared library, there is still no way to add a frontend mapping extension that refers to this custom operation. In this case, use C++ shared library approach to implement both operations semantics and framework mapping. | ||
|
||
Python can still be used to map and decompose operations when only operations from the standard OpenVINO operation set are used. | ||
If custom OpenVINO operation is implemented in C++ and loaded into the runtime using Python API by a shared library, there is no way to add a frontend mapping extension that refers to this custom operation. In this case, use C++ shared library approach to implement both operations semantics and framework mapping. |
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.
This limitation exists for both C++ and Python.
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.
updated
docs/articles_en/documentation/openvino-extensibility/custom-openvino-operations.rst
Outdated
Show resolved
Hide resolved
…penvino-operations.rst Co-authored-by: Sergey Lyalin <[email protected]>
45d9450
to
7ecd86d
Compare
Details:
Tickets: