-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Rework model loading in FE manager, implement PDPD probing #6358
Rework model loading in FE manager, implement PDPD probing #6358
Conversation
ngraph/frontend/frontend_manager/include/frontend_manager/frontend.hpp
Outdated
Show resolved
Hide resolved
5f4b211
to
29d2367
Compare
inference-engine/tests/functional/inference_engine/pdpd_reader/read_pdpd_model_test.cpp
Outdated
Show resolved
Hide resolved
inference-engine/tests/functional/inference_engine/pdpd_reader/read_pdpd_model_test.cpp
Outdated
Show resolved
Hide resolved
virtual bool | ||
supported_by_variants(const std::vector<std::shared_ptr<Variant>>& variants) const; |
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.
Looks like it is a service method, and I agree with @rkazants it shouldn't be a part of public API.
Or if it is a public method, why don't we have a documentation for it? I am a little bit confused, how should I implement this method in my own framework
ngraph/frontend/frontend_manager/include/frontend_manager/frontend.hpp
Outdated
Show resolved
Hide resolved
#else | ||
typedef std::string path_type; | ||
#endif | ||
|
||
class PDPD_API InputModelPDPD : public InputModel |
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.
Can we make public API more clear and remove classes which won't be used by end user?
public/developer API issue will be covered separately. |
inference-engine/tests/functional/inference_engine/pdpd_reader/read_pdpd_model_test.cpp
Show resolved
Hide resolved
virtual bool | ||
supported_by_variants(const std::vector<std::shared_ptr<Variant>>& variants) const; |
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.
@slyalin Do we have a plan to refactor API? Now it looks strange that we add service methods to public API
#endif | ||
|
||
template <typename T> | ||
bool endsWith(const std::basic_string<T>& str, const std::basic_string<T>& suffix) |
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.
It looks like a common util. should each frontend implement 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.
You mean to create static util library?
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.
Something like that. Moreover if I remember right we have the same methods in the Inference Engine
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.
How can I access methods from IE? I thought we don't link IE to ngraph
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.
In general it looks like it should be a common library. Could you add TODO to move such utility methods to common library and create a task?
* Remove supported_by_arguments from public api
ngraph/frontend/frontend_manager/include/frontend_manager/frontend_manager.hpp
Show resolved
Hide resolved
Ticket for further optimizing FrontendManager dependency is created: 60517. |
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.
Approved with the assumption that FEM will be split into 2 parts:
- static library with base implementation for FEs
- static / dynamic versions for FEM itself
- static version of FEM is used in IE, dynamic is used by MO / end users
#endif | ||
|
||
template <typename T> | ||
bool endsWith(const std::basic_string<T>& str, const std::basic_string<T>& suffix) |
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.
In general it looks like it should be a common library. Could you add TODO to move such utility methods to common library and create a task?
FRONT_END_GENERAL_CHECK(m_fw_ptr->ParseFromIstream(&pb_stream), | ||
"Model can't be parsed"); | ||
|
||
loadPlaces(); | ||
loadConsts(weights_stream ? "" : path, weights_stream.get()); | ||
loadConsts(weights_stream && weights_stream.is_open() ? std::basic_string<T>{} : path, |
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.
@nosovmik @mvafin This code only works with pdmodel & pdiparam files. However, there are legacy __model__
model files. If using __model__
The weights_stream is actually not valid.
loadConsts(weights_stream && weights_stream.is_open() ? std::basic_string<T>{} : path, | |
loadConsts(weights_stream && weights_stream.is_open() ? std::basic_string<T>{} : path, | |
weights_stream && weights_stream.is_open() ? &weights_stream : nullptr); |
…oolkit#6358) * Rework model loading in FE manager, implement PDPD probing * Fix build * Fix build * Fix build * Fix unicode * Fix merge issues * Fix codestyle * Read frontends path from frontend_manager library location * Fix codestyle * Fix FE dependency * Fix dependencies * Fix codestyle * Check if model file exists * Revert adding model to lfs * Add test model * Fix cmake dependencies * Apply review feedback * Revert pugixml * make getFrontendLibraryPath not public API * Fix codestyle * Apply fix from Ilya Lavrenov * Add FE dependency in legacy tests * Remove not needed dependency * Better support Unicode * Fix build * Fix build * Fix build * Add dependency foe deprecated tests * Fix dependency * Fix typo * Revert adding FE dependency to IESharedTests * Remove relative paths from frontend unit tests * Apply review feedback * Fix typo * Return allow-undefined, since kmb dependecies fail to link * Fix merge conflict * Compare functions in reader tests * Simplify code to load from variants * Remove supported_by_arguments from public api * Fix codestyle * Fix build * Compare names in reader tests * Fix wchar in variant Co-authored-by: Ilya Churaev <[email protected]>
…oolkit#6358) * Rework model loading in FE manager, implement PDPD probing * Fix build * Fix build * Fix build * Fix unicode * Fix merge issues * Fix codestyle * Read frontends path from frontend_manager library location * Fix codestyle * Fix FE dependency * Fix dependencies * Fix codestyle * Check if model file exists * Revert adding model to lfs * Add test model * Fix cmake dependencies * Apply review feedback * Revert pugixml * make getFrontendLibraryPath not public API * Fix codestyle * Apply fix from Ilya Lavrenov * Add FE dependency in legacy tests * Remove not needed dependency * Better support Unicode * Fix build * Fix build * Fix build * Add dependency foe deprecated tests * Fix dependency * Fix typo * Revert adding FE dependency to IESharedTests * Remove relative paths from frontend unit tests * Apply review feedback * Fix typo * Return allow-undefined, since kmb dependecies fail to link * Fix merge conflict * Compare functions in reader tests * Simplify code to load from variants * Remove supported_by_arguments from public api * Fix codestyle * Fix build * Compare names in reader tests * Fix wchar in variant Co-authored-by: Ilya Churaev <[email protected]>
…oolkit#6358) * Rework model loading in FE manager, implement PDPD probing * Fix build * Fix build * Fix build * Fix unicode * Fix merge issues * Fix codestyle * Read frontends path from frontend_manager library location * Fix codestyle * Fix FE dependency * Fix dependencies * Fix codestyle * Check if model file exists * Revert adding model to lfs * Add test model * Fix cmake dependencies * Apply review feedback * Revert pugixml * make getFrontendLibraryPath not public API * Fix codestyle * Apply fix from Ilya Lavrenov * Add FE dependency in legacy tests * Remove not needed dependency * Better support Unicode * Fix build * Fix build * Fix build * Add dependency foe deprecated tests * Fix dependency * Fix typo * Revert adding FE dependency to IESharedTests * Remove relative paths from frontend unit tests * Apply review feedback * Fix typo * Return allow-undefined, since kmb dependecies fail to link * Fix merge conflict * Compare functions in reader tests * Simplify code to load from variants * Remove supported_by_arguments from public api * Fix codestyle * Fix build * Compare names in reader tests * Fix wchar in variant Co-authored-by: Ilya Churaev <[email protected]>
Details:
Tickets: